/* ==========================================================================
   TikOyun Web Theme - Dark Gaming Aesthetic
   ========================================================================== */

:root {
  --bg-dark: #0a0a0d;
  --bg-card: rgba(22, 22, 29, 0.75);
  --bg-card-hover: rgba(30, 30, 42, 0.9);
  --bg-input: rgba(14, 14, 18, 0.9);
  --text-main: #f1f1f4;
  --text-muted: #9a9aa6;
  --text-dim: #6c6c7a;
  --primary: #22d3d2;
  --primary-glow: rgba(34, 211, 210, 0.35);
  --accent: #7c5cff;
  --accent-glow: rgba(124, 92, 255, 0.35);
  --gold: #fbbf24;
  --danger: #ef4444;
  --success: #22c55e;
  --border-light: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(34, 211, 210, 0.5);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

header.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 13, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: #fff;
}

.logo-brand .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a0a0d;
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: -0.5px;
}

.logo-brand span.highlight {
  color: var(--primary);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  list-style: none;
}

.main-nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  padding: 0.4rem 0;
}

.main-nav a:hover,
.main-nav a.active {
  color: #fff;
}

.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: nowrap;
}

/* Zero-delay header authentication states (Instant FOUC elimination) */
html.is-authenticated .nav-actions > a[href="/login"],
html.is-authenticated .nav-actions > a[href="/register"] {
  display: none !important;
}

html.is-guest .user-auth-wrap,
html.is-guest .user-auth-pill,
html.is-guest .btn-admin-nav,
html.is-guest .btn-logout {
  display: none !important;
}

.user-auth-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: nowrap;
}

.user-auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(34, 211, 210, 0.08);
  border: 1px solid rgba(34, 211, 210, 0.35);
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.user-auth-pill:hover,
.user-auth-pill.active {
  background: rgba(34, 211, 210, 0.18);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(34, 211, 210, 0.3);
}

.user-auth-pill img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--primary);
}

.user-auth-pill .user-name {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-auth-pill .user-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
}

.btn-admin-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff !important;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-admin-nav:hover,
.btn-admin-nav.active {
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.45);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.btn-logout {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #fff !important;
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 2px;
}

.lang-btn {
  background: none;
  border: none;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 16px;
  transition: all 0.2s ease;
}

.lang-btn.active {
  background: var(--primary);
  color: #0a0a0d;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #10b981);
  color: #0a0a0d;
  box-shadow: 0 4px 18px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(34, 211, 210, 0.5);
  color: #0a0a0d;
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-outline:hover {
  border-color: var(--primary);
  background: rgba(34, 211, 210, 0.08);
  color: var(--primary);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #9333ea);
  color: #fff;
  box-shadow: 0 4px 18px var(--accent-glow);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(124, 92, 255, 0.5);
  color: #fff;
}

.btn-full {
  width: 100%;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-section {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 1.5rem 5rem;
  overflow: hidden;
  background: radial-gradient(circle at 50% 25%, rgba(124, 92, 255, 0.15), transparent 60%);
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-glow-1 {
  position: absolute;
  top: 15%;
  left: 20%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(34, 211, 210, 0.18), transparent 70%);
  filter: blur(50px);
}

.hero-glow-2 {
  position: absolute;
  top: 30%;
  right: 15%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.18), transparent 70%);
  filter: blur(50px);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  background: rgba(34, 211, 210, 0.1);
  border: 1px solid rgba(34, 211, 210, 0.3);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
  animation: pulse-border 2.5s infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: rgba(34, 211, 210, 0.3); }
  50% { border-color: rgba(34, 211, 210, 0.8); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.4rem;
  letter-spacing: -0.03em;
  color: #fff;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 2.4rem;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Sections Layout & Utilities
   ========================================================================== */

section {
  padding: 5rem 1.5rem;
  position: relative;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3.5rem;
}

.section-subtitle {
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 0.8rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Grid System */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.8rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer.site-footer {
  margin-top: auto;
  background: #060608;
  border-top: 1px solid var(--border-light);
  padding: 4.5rem 1.5rem 2rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  max-width: 1240px;
  margin: 0 auto 3rem;
}

.footer-brand p {
  color: var(--text-muted);
  margin-top: 1rem;
  font-size: 0.92rem;
  max-width: 320px;
}

.footer-col h5 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1.2rem;
  letter-spacing: -0.01em;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-col ul a {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-col ul a:hover {
  color: var(--primary);
}

.footer-bottom {
  max-width: 1240px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ==========================================================================
   Responsive Breakpoints & Universal Mobile Optimization
   ========================================================================== */

/* Universal Responsive Guards */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
}

button, a, input, select, textarea {
  touch-action: manipulation;
}

@media (max-width: 1200px) {
  .container {
    max-width: 100%;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (max-width: 992px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  .footer-top {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.2rem 1.5rem;
  }
  .nav-container {
    padding: 0.75rem 1.2rem;
  }
  .main-nav {
    gap: 1.1rem;
  }
  .main-nav a {
    font-size: 0.88rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }

  /* Header & Navigation */
  header.site-header {
    height: 62px;
  }
  .nav-container {
    padding: 0.65rem 1rem;
    height: 100%;
    gap: 0.5rem;
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
  }
  .mobile-menu-toggle:active {
    background: rgba(34, 211, 210, 0.2);
    border-color: var(--primary);
  }

  .main-nav {
    display: none;
    position: fixed;
    top: 62px;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(100vh - 62px);
    background: rgba(10, 10, 14, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    flex-direction: column;
    padding: 1.5rem 1.2rem 3rem;
    gap: 0.4rem;
    z-index: 9999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.85);
    animation: slideDownNav 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes slideDownNav {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    font-size: 1.05rem;
    font-weight: 600;
    color: #e2e8f0;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
  }

  .main-nav a:hover,
  .main-nav a.active {
    background: rgba(34, 211, 210, 0.12);
    border-color: rgba(34, 211, 210, 0.35);
    color: var(--primary);
  }
  .main-nav a.active::after {
    display: none;
  }

  /* Compact Navbar Actions */
  .nav-actions {
    gap: 0.4rem;
  }
  .user-auth-pill {
    padding: 0.2rem 0.5rem;
    gap: 0.35rem;
  }
  .user-auth-pill .user-name {
    max-width: 75px;
    font-size: 0.78rem;
  }
  .user-auth-pill .user-badge {
    display: none;
  }
  .btn-admin-nav {
    padding: 0.25rem 0.5rem;
    font-size: 0.72rem;
  }
  .btn-logout {
    padding: 0.25rem 0.45rem;
    font-size: 0.72rem;
  }

  /* Hero Sections */
  .hero-section {
    padding: 5.5rem 1rem 3rem;
  }
  .hero-title {
    font-size: clamp(1.85rem, 6.8vw, 2.8rem);
    line-height: 1.15;
    margin-bottom: 1rem;
  }
  .hero-subtitle {
    font-size: 0.98rem;
    line-height: 1.55;
    margin-bottom: 1.8rem;
    padding: 0 0.25rem;
  }
  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    gap: 0.8rem;
  }
  .hero-cta-group .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* Universal Grids Stacking */
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
    gap: 1.3rem;
  }

  /* Section Headers */
  .section-header {
    margin-bottom: 2rem;
  }
  .section-title {
    font-size: 1.7rem;
    line-height: 1.25;
  }
  .section-desc {
    font-size: 0.92rem;
    padding: 0 0.5rem;
  }

  /* Cards */
  .feature-card {
    padding: 1.6rem 1.3rem;
  }
  .pricing-card {
    padding: 2rem 1.4rem;
  }
  .pricing-card.featured {
    border-width: 1.5px;
  }
  .pricing-price {
    font-size: 2.2rem;
  }

  /* Footer */
  .footer-top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  /* Admin Dashboard Mobile Responsiveness */
  .admin-container {
    padding: 1.5rem 1rem;
  }
  .stats-row {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.8rem;
  }
  .stat-card {
    padding: 1rem 0.9rem;
    border-radius: 10px;
  }
  .stat-num {
    font-size: 1.65rem;
  }
  .stat-label {
    font-size: 0.72rem;
  }
  .table-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1rem 1.1rem;
  }
  .table-header-bar > div {
    width: 100%;
  }
  .table-header-bar input#user-search-input {
    width: 100% !important;
  }
  .filter-pills {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.3rem;
  }
  .filter-pill {
    padding: 0.3rem 0.75rem;
    font-size: 0.76rem;
    white-space: nowrap;
  }
  .table-card > div[style*="grid"] {
    grid-template-columns: 1fr !important;
    padding: 1rem !important;
    gap: 1rem !important;
  }
  .table-card div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Universal Table Horizontal Scroll */
  div[style*="overflow-x: auto"],
  .table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table.admin-table {
    min-width: 650px;
  }

  /* Modals */
  .lightbox-modal > div,
  .payment-modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    padding: 1.4rem 1.1rem !important;
    border-radius: 14px !important;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .logo-brand {
    font-size: 1.12rem;
    gap: 0.45rem;
  }
  .logo-brand .logo-icon {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  .lang-switcher {
    padding: 2px;
  }
  .lang-btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.68rem;
  }

  .user-auth-pill .user-name {
    display: none;
  }

  .auth-box {
    margin: 1.5rem auto;
    padding: 1.6rem 1rem;
    border-radius: 12px;
    width: 100%;
  }
  .auth-header h3 {
    font-size: 1.25rem;
  }

  .input-control {
    font-size: 16px !important; /* Prevents auto-zoom on mobile iOS/Android */
    padding: 0.6rem 0.8rem;
  }

  .btn {
    font-size: 0.85rem;
  }
  .btn-lg {
    padding: 0.75rem 1.2rem;
    font-size: 0.92rem;
  }

  .pricing-ribbon {
    top: -10px;
    right: 12px;
    font-size: 0.65rem;
    padding: 0.18rem 0.6rem;
  }

  .qr-frame {
    width: 160px !important;
    height: 160px !important;
  }
}

