/* ============================================================
   GAMDEO PREMIUM UI OVERHAUL v1
   Drop-in visual layer. Does not replace business logic.
   Load AFTER style.css and games.css.
   ============================================================ */

:root {
  --ui-bg: #070a0f;
  --ui-bg-2: #0a0f16;
  --ui-surface: #0e141c;
  --ui-surface-2: #121923;
  --ui-surface-3: #161f2a;
  --ui-line: rgba(255,255,255,.075);
  --ui-line-2: rgba(255,255,255,.12);
  --ui-text: #f7f8fa;
  --ui-muted: #8b96a7;
  --ui-dim: #5e6877;
  --ui-red: var(--primary, #e11d2e);
  --ui-green: #18c58a;
  --ui-gold: #f7b84b;
  --ui-radius: 14px;
  --ui-radius-lg: 18px;
  --ui-shadow: 0 18px 55px rgba(0,0,0,.28);
}

/* ---------- FOUNDATION ---------- */

html,
body {
  background:
    radial-gradient(900px 450px at 50% -160px, color-mix(in srgb, var(--ui-red) 12%, transparent), transparent 65%),
    linear-gradient(180deg, #070a0f 0%, #090d13 42%, #070a0f 100%);
}

body {
  color: var(--ui-text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

#views {
  position: relative;
}

.app-view {
  min-height: calc(100dvh - 90px);
}

/* ---------- HEADER ---------- */

.header {
  min-height: 72px !important;
  background: rgba(6, 9, 14, .88) !important;
  border-bottom: 1px solid var(--ui-line) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  backdrop-filter: blur(24px) saturate(140%) !important;
}

#header-logo-container img {
  max-height: 38px;
}

#user-avatar {
  width: 38px !important;
  height: 38px !important;
  border-radius: 12px !important;
  background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.03)) !important;
  border-color: var(--ui-line-2) !important;
}

.user-info > div[style*="min-width: 70px"] {
  height: 38px !important;
  min-width: 112px !important;
  padding: 0 12px !important;
  border-radius: 11px !important;
  background: rgba(255,255,255,.045) !important;
  border-color: var(--ui-line) !important;
}

#avatar-menu {
  background: #10161f !important;
  border-color: var(--ui-line-2) !important;
  border-radius: 14px !important;
  box-shadow: var(--ui-shadow) !important;
}

/* ---------- GENERIC SURFACES ---------- */

.glass-card {
  background: linear-gradient(180deg, rgba(18,25,34,.92), rgba(12,17,24,.94)) !important;
  border: 1px solid var(--ui-line) !important;
  border-radius: var(--ui-radius-lg) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,.16) !important;
  backdrop-filter: blur(14px) !important;
}

.glass-card:hover {
  border-color: var(--ui-line-2) !important;
}

.section-title {
  font-size: 18px !important;
  font-weight: 800 !important;
  letter-spacing: -.025em !important;
}

/* ---------- BUTTON SYSTEM ---------- */

.btn-primary {
  min-height: 46px;
  border-radius: 12px !important;
  background: linear-gradient(135deg, var(--ui-red), color-mix(in srgb, var(--ui-red) 78%, #8b1020)) !important;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--ui-red) 22%, transparent) !important;
}

.btn-primary:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.btn-secondary {
  min-height: 44px;
  border-radius: 12px !important;
  background: rgba(255,255,255,.045) !important;
  border-color: var(--ui-line) !important;
}

/* ---------- HOME HERO ---------- */

#home-slideshow {
  margin-bottom: 18px !important;
  border-radius: 18px !important;
  border-color: var(--ui-line-2) !important;
  box-shadow: 0 22px 60px rgba(0,0,0,.25) !important;
  background: #0b1017 !important;
}

#home-slideshow .slide-item img {
  border-radius: inherit;
}

#sports-cta-banner {
  border-radius: 18px !important;
  box-shadow: var(--ui-shadow);
}

#sports-cta-banner > div {
  min-height: 118px;
  padding: 24px !important;
  background:
    radial-gradient(400px 180px at 85% 20%, rgba(255,255,255,.12), transparent 55%),
    linear-gradient(135deg, color-mix(in srgb, var(--ui-red) 78%, #0b1017), #0b1118) !important;
}

/* ---------- QUICK ACTIONS ---------- */

#home-view button[onclick*="deposit"],
#home-view button[onclick*="withdraw"] {
  min-height: 48px !important;
  border-radius: 12px !important;
  font-size: 13px !important;
  transition: transform .18s ease, border-color .18s ease, background .18s ease !important;
}

#home-view button[onclick*="deposit"]:hover,
#home-view button[onclick*="withdraw"]:hover {
  transform: translateY(-2px);
}

/* ---------- WIN TICKER ---------- */

#big-wins-ticker {
  background: rgba(255,255,255,.028) !important;
  border-color: var(--ui-line) !important;
  border-radius: 12px !important;
}

/* ---------- GAME LOBBIES ---------- */

.lobby-tab-btn {
  min-height: 36px;
  padding: 8px 14px !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,.035) !important;
  border-color: var(--ui-line) !important;
  color: var(--ui-muted) !important;
}

.lobby-tab-btn.active {
  color: #fff !important;
  background: color-mix(in srgb, var(--ui-red) 15%, transparent) !important;
  border-color: color-mix(in srgb, var(--ui-red) 34%, transparent) !important;
  box-shadow: none !important;
}

.game-card-netflix {
  width: 158px !important;
  border-radius: 14px !important;
  background: #0f151d !important;
  border-color: var(--ui-line) !important;
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
}

.game-card-netflix img {
  height: 166px !important;
}

.game-card-netflix:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--ui-red) 30%, transparent);
  box-shadow: 0 18px 34px rgba(0,0,0,.28);
}

.game-card-premium .game-favorite-btn {
  background: rgba(0,0,0,.65) !important;
  border-color: rgba(255,255,255,.12) !important;
  backdrop-filter: blur(10px);
}

/* ---------- SEARCH ---------- */

#slotSearch,
#casinoSearch {
  min-height: 46px !important;
  border-radius: 12px !important;
  background: rgba(255,255,255,.04) !important;
  border-color: var(--ui-line) !important;
}

#slotSearch:focus,
#casinoSearch:focus {
  border-color: color-mix(in srgb, var(--ui-red) 45%, transparent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-red) 10%, transparent);
}

/* ---------- BOTTOM NAV: MOBILE ---------- */

.nav-bar {
  height: 70px !important;
  background: rgba(7,10,15,.94) !important;
  border-top: 1px solid var(--ui-line) !important;
  box-shadow: 0 -12px 36px rgba(0,0,0,.32) !important;
  backdrop-filter: blur(24px) saturate(140%) !important;
}

.nav-item {
  color: #7f8997 !important;
  font-size: 9px !important;
  gap: 4px !important;
}

.nav-item.active {
  color: #fff !important;
}

.nav-item.active:not(.nav-home)::after {
  width: 4px !important;
  height: 4px !important;
  bottom: 6px !important;
  border-radius: 50% !important;
  background: var(--ui-red) !important;
  box-shadow: 0 0 10px color-mix(in srgb, var(--ui-red) 70%, transparent);
}

.nav-icon {
  font-size: 18px !important;
}

.nav-item.active:not(.nav-home) .nav-icon {
  font-size: 19px !important;
  transform: translateY(-1px);
}

.nav-item.nav-home {
  width: 48px !important;
  height: 48px !important;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--ui-red) 25%, transparent) !important;
}

.nav-item.nav-home i {
  font-size: 19px !important;
}

/* ---------- MODALS / MENUS ---------- */

#full-menu {
  background: #080c12 !important;
}

#full-menu-header {
  min-height: 64px;
  background: rgba(8,12,18,.96);
  border-color: var(--ui-line) !important;
}

.loader > .glass-card,
#profile-modal > .glass-card {
  background: #10161f !important;
  border-color: var(--ui-line-2) !important;
  box-shadow: 0 30px 90px rgba(0,0,0,.42) !important;
}

/* ---------- FORM CONTROLS ---------- */

input,
select,
textarea {
  background: #0e141b !important;
  border: 1px solid var(--ui-line) !important;
  border-radius: 12px !important;
}

input:focus,
select:focus,
textarea:focus {
  outline: none !important;
  border-color: color-mix(in srgb, var(--ui-red) 48%, transparent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-red) 10%, transparent);
}

/* ---------- SPORTSBOOK COMMON ---------- */

#sport-view {
  max-width: none !important;
}

#sport-view .glass-card {
  margin-bottom: 10px;
}

#sport-view [class*="odds"],
#sport-view [class*="market"] {
  border-radius: 10px;
}

#sport-view button {
  border-radius: 10px;
}

#sport-view .quick-sport-card {
  min-width: 270px;
  background: #0f151d !important;
  border-color: var(--ui-line) !important;
}

#sport-view .quick-sport-card:hover {
  border-color: color-mix(in srgb, var(--ui-red) 32%, transparent) !important;
}

#sport-view .quick-sport-live-badge {
  color: var(--ui-red) !important;
}

#sport-view .quick-sport-league {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--ui-line);
}

/* ---------- DESKTOP APP SHELL ---------- */

@media (min-width: 1024px) {
  body {
    overflow-y: scroll;
  }

  .header {
    min-height: 76px !important;
  }

  .nav-bar {
    display: none !important;
  }

  #web-sidebar {
    display: block !important;
    position: fixed !important;
    left: 20px;
    top: 92px;
    bottom: 20px;
    width: 235px;
    z-index: 1000;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--ui-line);
    border-radius: 18px;
    background: rgba(11,16,23,.88);
    box-shadow: var(--ui-shadow);
    backdrop-filter: blur(20px) saturate(140%);
  }

  #views {
    padding-left: 252px;
  }

  /* #views dışında #app'e doğrudan bağlı görünümler (slot/casino/spor) sidebar'ı aşmasın */
  #app > .app-view {
    padding-left: 252px;
  }

  #home-view {
    max-width: 1180px;
    margin: 0 auto;
  }

  #slot-view,
  #casino-view {
    max-width: 1320px;
    margin: 0 auto;
  }

  #home-slideshow {
    aspect-ratio: 2.55 / 1 !important;
  }

  .game-card-netflix {
    width: 176px !important;
  }

  .game-card-netflix img {
    height: 184px !important;
  }

  /* Desktop home becomes denser and more editorial. */
  #home-view .section-title {
    margin-top: 24px;
  }

  #home-view .quick-sports-wrapper {
    gap: 14px;
  }

  /* Hide the old floating sports back affordance on desktop. */
  #sport-back-btn {
    display: none !important;
  }
}

/* ---------- WIDE DESKTOP ---------- */

@media (min-width: 1400px) {
  .app-container {
    max-width: 1840px;
  }

  #web-sidebar {
    left: 26px;
    width: 248px;
  }

  #home-view {
    max-width: 1360px;
  }
}

/* ---------- TABLET ---------- */

@media (min-width: 768px) and (max-width: 1023px) {
  .game-card-netflix {
    width: 155px !important;
  }
}

/* ---------- MOBILE ---------- */

@media (max-width: 767px) {
  html,
  body {
    background: #070a0f;
  }

  body::before {
    display: none;
  }

  .header {
    min-height: 62px !important;
  }

  #header-logo-container {
    max-width: 44%;
  }

  #header-logo-container img {
    max-height: 30px;
  }

  .user-info > div[style*="min-width: 70px"] {
    min-width: 86px !important;
    height: 34px !important;
  }

  #home-view .section-title {
    font-size: 15px !important;
  }

  #home-slideshow {
    aspect-ratio: 16 / 8.3 !important;
    border-radius: 15px !important;
  }

  #sports-cta-banner > div {
    min-height: 100px;
    padding: 18px !important;
  }

  .quick-sports-wrapper {
    gap: 8px !important;
    margin-right: -12px;
    padding-right: 12px;
  }

  .quick-sport-card {
    min-width: 248px !important;
    border-radius: 14px !important;
  }

  .netflix-row-header {
    padding: 0 1px;
  }

  .netflix-row-title {
    font-size: 14px !important;
    font-weight: 800 !important;
  }

  .game-card-netflix {
    width: 132px !important;
    border-radius: 12px !important;
  }

  .game-card-netflix img {
    height: 132px !important;
  }

  .game-card-netflix-info {
    padding: 7px 9px 9px !important;
  }

  .nav-bar {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  /* Full-bleed sportsbook on mobile. */
  #sport-view {
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 10px;
    padding-right: 10px;
  }

  /* Avoid oversized typography in compact Telegram viewport. */
  #sport-view .section-title {
    font-size: 14px !important;
  }

  /* Keep modal controls touch-friendly. */
  button {
    min-height: 42px;
  }
}

/* ---------- DESKTOP HOME GRID: 4 sütun ---------- */

@media (min-width: 1100px) {
  #home-view .games-grid-container {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px;
  }
}

/* ---------- DESKTOP SOL MENÜ: ALT WIDGET ---------- */

#web-sidebar {
  padding-bottom: 96px;
}

.web-sidebar-foot {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ui-line);
  background: inherit;
}

.web-sidebar-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #229ED9, #2AABEE);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(42, 171, 238, 0.3);
  transition: filter 0.15s, transform 0.15s;
}

.web-sidebar-login:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.web-sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.web-sidebar-user i {
  color: rgba(255, 255, 255, 0.5);
}

.web-sidebar-mini-actions {
  display: flex;
  gap: 8px;
}

.web-sidebar-mini-actions .mini {
  flex: 1;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 11px;
  border: 1px solid var(--ui-line-2);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.web-sidebar-mini-actions .mini.primary {
  background: linear-gradient(135deg, var(--ui-red), color-mix(in srgb, var(--ui-red) 78%, #8b1020));
  border: none;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--ui-red) 22%, transparent);
}

.web-sidebar-mini-actions .mini:hover {
  filter: brightness(1.07);
}

.web-sidebar-logout {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.web-sidebar-logout:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #f97373;
}

/* ---------- MOTION ---------- */

@media (prefers-reduced-motion: no-preference) {
  .glass-card,
  .game-card-netflix,
  .quick-sport-card,
  .btn-primary,
  .btn-secondary {
    transition:
      transform .18s cubic-bezier(.2,.7,.2,1),
      border-color .18s ease,
      box-shadow .18s ease,
      background .18s ease,
      filter .18s ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- SAFE AREA ---------- */

@supports (padding: max(0px)) {
  .nav-bar {
    padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
  }
}
