@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@600;700&family=Outfit:wght@400;600;700;800&display=swap');

/* ==========================================================================
   CSS CUSTOM PROPERTIES / THEMES
   ========================================================================== */
:root {
  /* Default: Modern Glass (Theme 1) */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Playfair Display', serif;
  
  --bg-color: #0b1120;
  --surface-color: rgba(15, 23, 42, 0.75);
  --border-color: rgba(255, 255, 255, 0.12);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #00f2fe;
  --primary-hover: #38bdf8;
  --secondary: #a855f7;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-blur: 16px;
  
  --layout-max-width: 1200px;
}

/* Theme 2: Clean Content (Minimal) */
body.theme-minimal {
  --font-sans: 'Inter', sans-serif;
  --bg-color: #fcfcfc;
  --surface-color: rgba(255, 255, 255, 0.95);
  --border-color: #e5e7eb;
  --text-main: #111827;
  --text-muted: #4b5563;
  --primary: #0f172a;
  --primary-hover: #334155;
  --secondary: #2563eb;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --glass-bg: #ffffff;
  --glass-border: #e5e7eb;
}

/* Theme 3: Luxury Dark (Elegant) */
body.theme-dark-elegant {
  --font-sans: 'Inter', sans-serif;
  --bg-color: #0f0f11;
  --surface-color: rgba(24, 24, 27, 0.85);
  --border-color: rgba(255, 255, 255, 0.12);
  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --primary: #d4af37; /* Gold */
  --primary-hover: #f59e0b;
  --secondary: #e4d00a;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(212, 175, 55, 0.25);
}

/* Theme 4: Magazine Pro */
body.theme-magazine {
  --font-sans: 'Inter', sans-serif;
  --bg-color: #f3f4f6;
  --surface-color: rgba(255, 255, 255, 0.96);
  --border-color: #e5e7eb;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --primary: #dc2626; /* News Red */
  --primary-hover: #b91c1c;
  --secondary: #ea580c;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  --glass-bg: #ffffff;
  --glass-border: #e5e7eb;
}

/* Theme 5: Gaming/Tech Vibrant (Neon) */
body.theme-neon {
  --font-sans: 'Outfit', sans-serif;
  --bg-color: #070913;
  --surface-color: rgba(13, 17, 34, 0.85);
  --border-color: rgba(6, 182, 212, 0.2);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #06b6d4; /* Neon Cyan */
  --primary-hover: #22d3ee;
  --secondary: #ec4899; /* Neon Pink */
  --shadow: 0 8px 30px -5px rgba(6, 182, 212, 0.25);
  --glass-bg: rgba(13, 17, 34, 0.6);
  --glass-border: rgba(6, 182, 212, 0.25);
}

/* ==========================================================================
   GLOBAL RESET & RESPONSIVE CONSTRAINTS
   ========================================================================== */
html {
  box-sizing: border-box;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
*, *:before, *:after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;
}

/* Body scroll lock when mobile navigation is opened */
body.mobile-nav-open {
  overflow: hidden !important;
  touch-action: none;
}

/* Fluid responsive typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
h1 { font-size: clamp(1.85rem, 4vw + 0.5rem, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw + 0.4rem, 2rem); }
h3 { font-size: clamp(1.15rem, 2.5vw + 0.2rem, 1.5rem); }
p, li { word-wrap: break-word; overflow-wrap: break-word; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}
a:hover {
  color: var(--primary-hover);
}

/* Media Elements */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Form Elements Touch Target & Safari Zoom Fix */
input, select, textarea, button {
  font-family: inherit;
  font-size: 1rem;
}
@media (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important; /* Prevents auto-zoom on mobile iOS Safari */
  }
}

/* ==========================================================================
   AMBIENT BACKGROUND GLOW SHAPES (NO HORIZONTAL OVERFLOW)
   ========================================================================== */
.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  -webkit-filter: blur(90px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.14;
}
.shape-1 {
  top: -80px;
  right: -80px;
  width: min(450px, 60vw);
  height: min(450px, 60vw);
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}
.shape-2 {
  bottom: 10%;
  left: -100px;
  width: min(400px, 55vw);
  height: min(400px, 55vw);
  background: radial-gradient(circle, var(--secondary, #8b5cf6) 0%, transparent 70%);
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.container {
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}
@media (max-width: 640px) {
  .container {
    padding: 0 1rem;
  }
}
.section {
  margin: 3.5rem 0;
}
@media (max-width: 768px) {
  .section {
    margin: 2rem 0;
  }
}
.main-content {
  flex: 1;
  padding: 2rem 0 3rem;
  width: 100%;
}
@media (max-width: 640px) {
  .main-content {
    padding: 1.25rem 0 2rem;
  }
}

/* ==========================================================================
   NAVBAR & MOBILE HAMBURGER NAVIGATION
   ========================================================================== */
.navbar {
  background-color: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  text-decoration: none;
  z-index: 1005;
}
.nav-logo {
  height: 38px;
  max-height: 38px;
  width: auto;
  object-fit: contain;
}
.site-name-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
  white-space: nowrap;
}
@media (max-width: 480px) {
  .site-name-text {
    font-size: 1.25rem;
  }
  .nav-logo {
    height: 32px;
    max-height: 32px;
  }
}

/* Desktop Navigation Menu */
.nav-links {
  display: flex;
  gap: 1.4rem;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

/* Mobile Hamburger Toggle Button */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  z-index: 1005;
  outline: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.mobile-nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}
.mobile-nav-toggle:focus-visible {
  box-shadow: 0 0 0 2px var(--primary);
}
.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  margin: 2.5px 0;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, background-color 0.2s ease;
}

/* Hamburger Morphing Animation to "X" */
.mobile-nav-toggle.is-active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  background-color: var(--primary);
}
.mobile-nav-toggle.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.mobile-nav-toggle.is-active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  background-color: var(--primary);
}

/* Mobile Backdrop Overlay */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-nav-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   MOBILE DRAWER NAVIGATION (SCREENS <= 880px)
   ========================================================================== */
@media (max-width: 880px) {
  .mobile-nav-toggle {
    display: flex;
  }
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(85vw, 320px);
    height: 100vh;
    height: 100dvh;
    background: rgba(11, 17, 32, 0.94);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--border-color);
    box-shadow: -15px 0 40px rgba(0, 0, 0, 0.6);
    flex-direction: column;
    align-items: stretch;
    padding: 5.5rem 1.5rem 2rem;
    gap: 0.5rem;
    overflow-y: auto;
    z-index: 1000;
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .nav-links.is-open {
    right: 0;
  }
  .nav-links li {
    width: 100%;
  }
  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    border: 1px solid transparent;
    transition: all 0.2s ease;
  }
  .nav-links a:hover,
  .nav-links a.active {
    background: rgba(255, 255, 255, 0.06);
    color: var(--primary);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
  }
}

/* ==========================================================================
   CARDS & GLASSMORPHIC COMPONENTS
   ========================================================================== */
.card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
}
.card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
@media (max-width: 640px) {
  .card-content {
    padding: 1.15rem;
  }
}
.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
.card-title a { color: var(--text-main); }
.card-title a:hover { color: var(--primary); }
.card-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex: 1;
}

/* Glass Cards (About, Contact, Privacy, Terms) */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}
.glass-card.glass {
  padding: 2.5rem 2rem;
}
@media (max-width: 640px) {
  .glass-card.glass {
    padding: 1.5rem 1.15rem !important;
    border-radius: 14px !important;
  }
}

/* ==========================================================================
   BUTTONS & INPUTS
   ========================================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #0b1120 !important;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 1.6rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 242, 254, 0.25);
  text-decoration: none;
}
.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.35);
}
.btn-primary:active {
  transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVE GRIDS
   ========================================================================== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.75rem;
}
.grid-sidebar {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
}
@media (max-width: 960px) {
  .grid-sidebar {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
@media (max-width: 640px) {
  .grid, .grid-2, .grid-3, .category-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
  .article-content {
    padding: 1.25rem !important;
  }
}

/* Page & Article Responsive Typography & Media */
.page-title {
  font-size: clamp(1.85rem, 4vw + 0.5rem, 2.5rem);
  line-height: 1.25;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.article-title {
  font-size: clamp(1.7rem, 4vw + 0.4rem, 2.45rem);
  line-height: 1.25;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.article-featured-img {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 2rem;
}
@media (max-width: 640px) {
  .article-featured-img {
    max-height: 280px;
    border-radius: 8px;
    margin-bottom: 1.25rem;
  }
  .category-card .card-content {
    padding: 1.15rem !important;
  }
}

/* Article Content Responsive Safety */
.article-content pre,
.article-content code {
  max-width: 100%;
  overflow-x: auto;
  word-break: break-word;
}
.article-content table {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  display: block;
}
.article-content iframe,
.article-content video {
  max-width: 100%;
}

/* ==========================================================================
   AFFILIATE BOX & AD SLOTS (FULLY RESPONSIVE)
   ========================================================================== */
.affiliate-box {
  background: var(--surface-color);
  border: 2px solid var(--primary);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow);
  position: relative;
  margin-bottom: 2rem;
}
.affiliate-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background: var(--primary);
  color: #0b1120;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.affiliate-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}
.affiliate-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.ad-slot {
  background-color: rgba(128, 128, 128, 0.05);
  border: 1px dashed var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 2rem auto;
  border-radius: 6px;
  max-width: 100%;
}
.ad-slot::before {
  content: "Advertisement";
  font-size: 0.7rem;
  text-transform: uppercase;
  margin-bottom: 5px;
  opacity: 0.7;
  letter-spacing: 1px;
}
.ad-leaderboard {
  width: 100%;
  max-width: 970px;
  min-height: 90px;
  height: auto;
  padding: 1rem;
}
.ad-rectangle {
  width: 100%;
  max-width: 300px;
  height: 270px;
  margin: 0 auto 2rem;
}
.ad-skyscraper {
  width: 100%;
  max-width: 300px;
  height: 600px;
  margin: 0 auto 2rem;
}

/* ==========================================================================
   FOOTER (RESPONSIVE)
   ========================================================================== */
.footer {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--surface-color);
  margin-top: auto;
  color: var(--text-muted);
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.footer-newsletter-card {
  width: 100%;
  max-width: 600px;
  text-align: center;
  padding: 2rem;
  border-radius: 14px;
}
.footer-newsletter-form {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  align-items: center;
  width: 100%;
}
@media (max-width: 580px) {
  .footer-newsletter-card {
    padding: 1.5rem 1.15rem;
  }
  .footer-newsletter-form {
    flex-direction: column;
    align-items: stretch;
  }
  .footer-newsletter-form input,
  .footer-newsletter-form button {
    width: 100% !important;
    min-width: 100% !important;
  }
}

/* Footer Links Touch Targets */
.footer-links-wrap {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}
.footer-links-wrap a {
  padding: 6px 10px;
  display: inline-block;
}

/* ==========================================================================
   POST META & ARTICLE CONTENT
   ========================================================================== */
.post-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}
.post-category {
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.75rem;
}
.section-title {
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

/* ==========================================================================
   THEME SPECIFICS & DRAWER THEME OVERRIDES
   ========================================================================== */
body.theme-minimal .navbar {
  border-bottom: 1px solid #eaeaea;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
body.theme-minimal .nav-links {
  background: rgba(255, 255, 255, 0.98);
}
body.theme-minimal .hamburger-line {
  background-color: #111;
}
body.theme-minimal .mobile-nav-toggle {
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.theme-minimal .btn-primary {
  color: #fff !important;
}

body.theme-magazine .navbar {
  border-top: 4px solid var(--primary);
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}
body.theme-magazine .nav-links a {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 0.85rem;
}
body.theme-magazine .nav-links {
  background: #ffffff;
}
body.theme-magazine .hamburger-line {
  background-color: #111;
}
body.theme-magazine .mobile-nav-toggle {
  background: #fff;
  border-color: #e5e7eb;
}
body.theme-magazine .btn-primary {
  color: #fff !important;
}

body.theme-dark-elegant h1, body.theme-dark-elegant h2, body.theme-dark-elegant .nav-brand {
  font-family: var(--font-serif);
}
body.theme-dark-elegant .navbar {
  border-bottom: 1px solid #27272a;
}
body.theme-dark-elegant .nav-links {
  background: rgba(18, 18, 20, 0.97);
  border-left-color: #27272a;
}
body.theme-dark-elegant .btn-primary {
  color: #000 !important;
}

body.theme-neon .navbar {
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.08);
}
body.theme-neon .nav-links {
  background: rgba(7, 9, 19, 0.97);
  box-shadow: -15px 0 40px rgba(6, 182, 212, 0.2);
}
