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

:root {
  /* Colors */
  --bg-primary: #0f111a;
  --bg-secondary: #1a1d2d;
  --text-primary: #ffffff;
  --text-secondary: #a0aec0;
  
  --accent-primary: #6366f1; /* Indigo */
  --accent-secondary: #ec4899; /* Pink */
  --accent-tertiary: #10b981; /* Emerald */
  
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Spacing */
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  /* Add subtle background gradient mesh */
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(236, 72, 153, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.15) 0px, transparent 50%);
  background-attachment: fixed;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-secondary);
}

/* Glassmorphism Utilities */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow);
  padding: var(--spacing-lg);
}

.glass-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.glass-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.08);
}

/* Modern Layout */
.dashboard-layout {
  max-width: 100vw;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--glass-border);
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  height: 100vh;
  position: sticky;
  top: 0;
  background: rgba(15, 17, 26, 0.8);
  backdrop-filter: blur(16px);
  z-index: 40;
}

.main-content {
  padding: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

/* Buttons */
.btn-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
  color: white;
}

.btn-secondary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Gradients text */
.text-gradient {
  background: linear-gradient(to right, #6366f1, #ec4899, #10b981);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

/* Animations */
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }

/* Responsive adjustments */
@media (max-width: 1024px) {
  .dashboard-layout {
  max-width: 100vw;
  overflow-x: hidden;
    grid-template-columns: 240px 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard-layout {
  max-width: 100vw;
  overflow-x: hidden;
    display: block;
    width: 100vw;
    padding-bottom: 80px; /* For mobile bottom nav */
  }
  
  .sidebar {
    display: none; /* Hide sidebar on mobile, show bottom nav instead */
  }
  
  .main-content {
    padding: var(--spacing-md);
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  
  .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 17, 26, 0.9);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    padding: var(--spacing-sm);
    z-index: 50;
  }
  
  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.75rem;
    gap: 4px;
  }
  
  .mobile-nav-item.active {
    color: var(--accent-primary);
  }
}

/* Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.w-full { width: 100%; }

/* Critical Mobile Layout Overrides */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100vw !important;
}

select, .btn, .btn2, .btn3, .btn4, input {
  max-width: 100% !important;
}

.workorder-card, .container {
  max-width: 100vw !important;
  box-sizing: border-box !important;
}

/* Mobile Nav Text Color Fix */
.mobile-nav-item span, .mobile-nav-item .material-icons {
  color: #a0aec0 !important; /* Force light gray */
}

.mobile-nav-item:hover span, .mobile-nav-item.active span,
.mobile-nav-item:hover .material-icons, .mobile-nav-item.active .material-icons {
  color: #6366f1 !important; /* Accent primary */
}

.mobile-nav-item {
  padding: 8px 12px;
  background: transparent !important;
}

/* Mobile Header */
.mobile-header {
  display: none;
  padding: 1rem 1.5rem;
  background: rgba(15, 17, 26, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 40;
  text-align: center;
}

@media (max-width: 768px) {
  .mobile-header {
    display: block;
  }
}

/* Better Quiz Selector UI */
select#Category {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-primary) !important;
    padding: 12px 20px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    width: 100% !important;
    max-width: calc(100vw - 32px) !important; /* Prevent overflow */
    box-sizing: border-box !important;
    cursor: pointer !important;
    text-align: center !important;
    box-shadow: var(--glass-shadow) !important;
    transition: all var(--transition-fast) !important;
    /* Custom SVG dropdown arrow */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 1.2em !important;
    margin: 0 auto !important;
}

select#Category:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-2px) !important;
}

select#Category:focus {
    outline: none !important;
    border-color: var(--accent-secondary) !important;
    box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.3) !important;
}

select#Category option {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    font-size: 1rem !important;
    padding: 10px !important;
}

/* Better Footer Buttons UI */
footer .btn, footer .btn2, footer .btn3, footer .btn4 {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)) !important;
    color: white !important;
    border-radius: var(--radius-full) !important;
    border: none !important;
    padding: 12px 24px !important;
    font-size: 1rem !important;
    font-family: var(--font-heading) !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3) !important;
    transition: all var(--transition-fast) !important;
    max-width: calc(100vw - 32px) !important;
    box-sizing: border-box !important;
    margin: 5px auto !important;
    display: inline-block !important;
    width: 100% !important;
    text-align: center !important;
}

footer .btn:hover, footer .btn2:hover, footer .btn3:hover, footer .btn4:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5) !important;
}

footer ul.social {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 15px !important;
    padding: 20px 10px !important;
    margin: 0 !important;
    list-style: none !important;
    background: transparent !important;
}

footer ul.social li {
    width: 100% !important;
    max-width: 250px !important;
    margin: 0 auto !important;
    display: flex !important;
    justify-content: center !important;
}

/* ============================================================
   World-Class Promo / Monetization CTA Components
   (Go-PRO, Donate, Tutorials & Tools hub — replaces ad slots)
   ============================================================ */
.promo-banner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.75rem 2rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgba(99, 102, 241, 0.18), rgba(236, 72, 153, 0.14) 55%, rgba(16, 185, 129, 0.14));
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  isolation: isolate;
}

.promo-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(600px circle at 15% 20%, rgba(255,255,255,0.08), transparent 60%);
}

.promo-banner-text h3 {
  margin-bottom: 0.35rem;
  font-size: 1.25rem;
}

.promo-banner-text p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 46ch;
  margin: 0;
}

.promo-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn-pro {
  background: linear-gradient(135deg, #0f0f0f, #2b2b2b);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 18px rgba(0,0,0,0.45);
  transition: all var(--transition-fast);
}

.btn-pro:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.55);
  color: #fff;
}

.btn-pro i, .btn-pro svg { font-size: 1.1rem; }

.btn-play {
  background: linear-gradient(135deg, #00875f, #00c47a);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 18px rgba(0, 135, 95, 0.4);
  transition: all var(--transition-fast);
}

.btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 135, 95, 0.55);
  color: #fff;
}

.btn-play i, .btn-play svg { font-size: 1.1rem; }

.btn-donate {
  background: linear-gradient(135deg, #ec4899, #f97316);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
  transition: all var(--transition-fast);
}

.btn-donate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.55);
  color: #fff;
}

@media (max-width: 640px) {
  .promo-banner { flex-direction: column; align-items: flex-start; padding: 1.5rem; }
  .promo-banner-actions { width: 100%; }
  .btn-pro, .btn-play, .btn-donate { flex: 1; justify-content: center; }
}

/* Hero section */
.hero-section {
  text-align: center;
  padding: 2rem 1rem 1rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 60ch;
  margin: 0 auto 1.5rem;
}

/* Footer links (modern, replaces old bare button stack) */
.site-footer {
  padding: 2.5rem 1.5rem 2rem;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.footer-link {
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary) !important;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  text-decoration: none !important;
}

.footer-link:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}

.footer-link.footer-link-pro {
  background: linear-gradient(135deg, #0f0f0f, #2b2b2b);
  border-color: rgba(255,255,255,0.15);
}

.footer-link.footer-link-donate {
  background: linear-gradient(135deg, #ec4899, #f97316);
  border: none;
}

.footer-copyright {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Legacy-theme pages upgraded to modern CTA (no dashboard-layout) */
.content-page-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* Ensure mobile header title fits on one line */
.mobile-header h2 {
    font-size: 1.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

@media (max-width: 400px) {
    .mobile-header h2 {
        font-size: 1.2rem;
    }
}
