/* Garud - Mobile-App Style Compact Theme */
:root {
  --zon-app-radius: 12px;
  --zon-app-radius-sm: 8px;
  --zon-app-radius-lg: 16px;
  --zon-app-shadow: 0 2px 12px rgba(0,0,0,.08);
  --zon-app-shadow-lg: 0 4px 20px rgba(0,0,0,.12);
  --zon-safe-top: env(safe-area-inset-top, 0px);
  --zon-safe-bottom: env(safe-area-inset-bottom, 0px);
  --zon-safe-left: env(safe-area-inset-left, 0px);
  --zon-safe-right: env(safe-area-inset-right, 0px);
}

/* Compact container - mobile-first */
.zon-container { 
  max-width: 100%; 
  margin: 0 auto; 
  padding: 12px 16px; 
  padding-left: calc(16px + var(--zon-safe-left));
  padding-right: calc(16px + var(--zon-safe-right));
}

@media (min-width: 640px) {
  .zon-container { padding: 16px 20px; }
}

@media (min-width: 1024px) {
  .zon-container { max-width: 1200px; padding: 20px 24px; }
}

.zon-game-container { 
  max-width: 100%; 
  margin: 0 auto; 
  padding: 12px 16px; 
}

/* Header - compact, app-style */
.head__action__button { 
  min-width: 44px; 
  min-height: 44px; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  border-radius: var(--zon-app-radius-sm);
  -webkit-tap-highlight-color: transparent;
}
.head__action__button svg { height: 22px; width: 22px; }
.head__action__button svg path { stroke: #000; transition: .2s; stroke-width: 2.2px; }
.head__action__button:hover svg path { stroke: var(--zon-theme-color); }
.head__action__button:active { background: rgba(0,0,0,.06); }

/* Mobile: dark header with white icons */
@media (max-width: 767px) {
  .garud-header {
    background: #1a1a1a !important;
    border-color: rgba(255,255,255,.1) !important;
  }
  .garud-header .head__action__button svg path { stroke: #fff; }
  .garud-header .head__action__button:hover svg path { stroke: rgba(255,255,255,.8); }
  .garud-header .head__action__button:active { background: rgba(255,255,255,.1); }
}

/* Mobile: dark bottom nav with white icons */
@media (max-width: 768px) {
  .garud-bottom-nav {
    background: #1a1a1a !important;
    border-color: rgba(255,255,255,.12) !important;
  }
  .garud-bottom-nav .bottom-nav-item { color: rgba(255,255,255,.65) !important; }
  .garud-bottom-nav .bottom-nav-item.garud-nav-active { color: #fff !important; }
}

/* Footer nav - proper spacing */
.garud-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
  padding: 16px 0;
  list-style: none;
}

.garud-footer-nav li { margin: 0; }

.garud-footer-nav a {
  display: inline-block;
  padding: 6px 12px;
  font-size: 13px;
  color: #4b5563;
  text-transform: capitalize;
  border-radius: 8px;
  transition: background .2s, color .2s, transform .15s ease;
}

.garud-footer-nav a:hover {
  background: var(--zon-theme-color);
  color: #fff !important;
}

.garud-footer-nav a:active {
  transform: scale(0.95);
}

.garud-footer .garud-footer-divider {
  margin: 20px 0;
  border: 0;
  border-top: 1px solid #e5e7eb;
}

@media (min-width: 640px) {
  .garud-footer-nav {
    gap: 10px 20px;
    padding: 20px 0;
  }
  .garud-footer-nav a { font-size: 14px; padding: 8px 14px; }
}

/* Mobile: dark main footer */
@media (max-width: 768px) {
  .garud-footer-hr { border-color: #1a1a1a; }
  .garud-footer {
    position: relative;
    color: rgba(255,255,255,.9);
  }
  .garud-footer::before {
    content: '';
    position: absolute;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    width: 100vw;
    top: 0;
    bottom: 0;
    background: #1a1a1a;
    z-index: -1;
  }
  .garud-footer .garud-footer-nav a { color: rgba(255,255,255,.8) !important; }
  .garud-footer .garud-footer-nav a:hover { color: #fff !important; }
  .garud-footer .footer-content { color: rgba(255,255,255,.7); }
  .garud-footer .footer-content a { color: rgba(255,255,255,.9); }
  .garud-footer hr,
  .garud-footer .garud-footer-divider { border-color: rgba(255,255,255,.15); margin: 16px 0; }
  .garud-footer .text-gray-500,
  .garud-footer .text-center { color: rgba(255,255,255,.6) !important; }
  .garud-footer .text-center a { color: rgba(255,255,255,.7); }
  .garud-footer .text-center a:hover { color: #fff; }
}

/* Game grid - compact, app-style */
.game { 
  position: relative;
  border-radius: var(--zon-app-radius);
  overflow: hidden;
  z-index: 1;
  box-shadow: var(--zon-app-shadow);
  transition: transform .2s, box-shadow .2s;
}
.game:active { transform: scale(0.97); }

.new__badge::before {
  content: 'NEW';
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 9px;
  font-weight: 700;
  background: var(--zon-theme-color);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
  z-index: 9;
}

.game__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 10px;
  grid-auto-rows: minmax(130px, auto);
}

@media (min-width: 768px) {
  .game__grid {
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 16px;
    grid-auto-rows: minmax(160px, auto);
  }
}

@media (min-width: 1024px) {
  .game__grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    grid-gap: 18px;
    grid-auto-rows: minmax(160px, auto);
  }
}

.game.large {
  grid-column-end: span 2;
  grid-row-end: span 2;
}

@media (max-width: 767px) {
  .game.large { grid-column-end: span 2; grid-row-end: span 2; }
}

.game .game__thumb { display: block; height: 100%; width: 100%; }

.game .game__thumb img {
  position: absolute;
  top: 0; left: 0;
  height: 100%; width: 100%;
  object-fit: cover;
  z-index: 1;
}

.game .game_name {
  display: block;
  width: 100%;
  position: absolute;
  bottom: -100%;
  font-weight: 600;
  left: 0;
  padding: 6px 8px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9;
  font-size: 11px;
  text-align: center;
  transition: bottom .25s;
  text-transform: capitalize;
  line-height: 1.2;
}

.game:hover .game_name,
.game:focus-within .game_name { bottom: 0; }

/* Categories - compact horizontal scroll */
.game__categories {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 12px 0;
  margin: 0 -16px;
  padding-left: calc(16px + var(--zon-safe-left));
  padding-right: calc(16px + var(--zon-safe-right));
  scrollbar-width: none;
}
.game__categories::-webkit-scrollbar { display: none; }

.game__categories .category {
  flex: 0 0 auto;
  width: 140px;
  min-height: 70px;
  padding: 10px 12px;
  border-radius: var(--zon-app-radius);
  display: flex;
  align-items: center;
  gap: 10px;
  scroll-snap-align: start;
  box-shadow: var(--zon-app-shadow);
  transition: transform .2s;
}
.game__categories .category:active { transform: scale(0.97); }

.game__categories .category img,
.game__categories .category > a img {
  width: 48px;
  height: 48px;
  min-width: 48px;
  object-fit: cover;
  border-radius: var(--zon-app-radius-sm);
}

.game__categories .category > a { flex-shrink: 0; }

.game__categories .category .text { flex: 1; min-width: 0; }
.game__categories .category .category__name {
  font-size: 13px;
  font-weight: 700;
  color: #000;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game__categories .category .category__name:hover { color: var(--zon-theme-color); }
.game__categories .category p {
  font-size: 11px;
  color: var(--zon-muted-color);
  margin-top: 2px;
}

/* Search drawer - stack categories vertically */
.search-drawer .game__categories {
  display: grid;
  grid-template-columns: 1fr;
  overflow: visible;
  scroll-snap-type: none;
  margin: 0;
  padding: 0;
}

.search-drawer .game__categories .category {
  width: 100%;
  min-height: auto;
}

@media (min-width: 768px) {
  .game__categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    grid-gap: 12px;
    overflow: visible;
    scroll-snap-type: none;
    margin: 0;
    padding: 0;
  }
  .game__categories .category {
    width: auto;
    min-height: 80px;
  }
  .game__categories .category img,
  .game__categories .category > a img {
    width: 56px;
    height: 56px;
    min-width: 56px;
  }
}

.more_games_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  margin-top: 16px;
  padding: 12px 28px;
  border-radius: 99px;
  color: #fff;
  transition: transform .2s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.more_games_button:active { transform: scale(0.96); }

/* Drawers - bottom sheet style on mobile */
.search-container,
.menu-container {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(4px);
  z-index: 9999;
  transition: opacity .3s, visibility .3s;
  opacity: 0;
  visibility: hidden;
}

.search-container.active,
.menu-container.active { opacity: 1; visibility: visible; }

.search-drawer,
.menu-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(360px, 100%);
  max-height: 100%;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0,0,0,.15);
  padding: 16px;
  padding-top: calc(16px + var(--zon-safe-top));
  padding-bottom: calc(16px + var(--zon-safe-bottom));
  overflow-y: auto;
  transition: right .35s cubic-bezier(0.32, 0.72, 0, 1);
}

.search-container.active .search-drawer,
.menu-container.active .menu-drawer { right: 0; }

@media (max-width: 500px) {
  .search-drawer, .menu-drawer {
    width: calc(100% - 24px);
    right: -100%;
    border-radius: var(--zon-app-radius-lg) 0 0 var(--zon-app-radius-lg);
  }
  .search-container.active .search-drawer,
  .menu-container.active .menu-drawer { right: 12px; }
}

.search-drawer form {
  width: 100%;
  display: flex;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  border-radius: var(--zon-app-radius);
}

.search-drawer form input {
  height: 44px;
  width: 100%;
  padding: 0 16px;
  font-size: 15px;
}

.search-drawer form button {
  padding: 0 16px;
  min-width: 48px;
}

.close-drawer {
  position: absolute;
  top: calc(12px + var(--zon-safe-top));
  left: 12px;
  background: #f3f4f6;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border-radius: 50%;
  height: 40px;
  width: 40px;
  cursor: pointer;
  user-select: none;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
}

.menu-drawer a {
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--zon-app-radius);
  margin-bottom: 8px;
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
}

.menu-drawer a:active { background: #f3f4f6; }

.scroll-none::-webkit-scrollbar { display: none; }

/* Share modal - compact */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(8px);
}

.share-modal .modal-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(340px, calc(100% - 32px));
  background: #fff;
  transform: translate(-50%,-50%);
  border-radius: var(--zon-app-radius-lg);
  box-shadow: var(--zon-app-shadow-lg);
  padding: 24px;
}

.liked svg { fill: red; }
.liked svg path { stroke: red; }

@media screen and (max-width: 578px) {
  .game-meta-container { flex-direction: column; }
}

.ads {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.ads img { border-radius: var(--zon-app-radius); }

/* Bottom nav - mobile only */
.garud-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding-bottom: env(safe-area-inset-bottom, 0);
  -webkit-tap-highlight-color: transparent;
}

.garud-bottom-nav-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  min-height: 56px;
  padding: 8px 4px;
  gap: 2px;
  max-width: 100%;
  box-sizing: border-box;
}

.garud-bottom-nav .bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  padding: 6px 4px;
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  color: #6b7280;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .2s, transform .2s ease;
  box-sizing: border-box;
}

.garud-bottom-nav .bottom-nav-item:active {
  transform: scale(0.92);
}

.garud-bottom-nav .bottom-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-bottom: 2px;
  flex-shrink: 0;
}

.garud-bottom-nav .bottom-nav-icon svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.garud-bottom-nav .bottom-nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.2;
}

@media (min-width: 769px) {
  .garud-bottom-nav { display: none !important; }
}

/* Add padding when bottom nav visible */
@media (max-width: 768px) {
  body.garud-theme footer { padding-bottom: 80px; }
}
