/* ========================================
   CYBERSECURITY PLAYGROUND DESIGN SYSTEM
   Mobile-First, Perfectly Synced Dark/Light
   ======================================== */

/* ========================================
   CSS VARIABLES - DARK MODE (DEFAULT)
   ======================================== */

:root {
  /* Brand Colors */
  --color-brand-green: #00ff88;
  --color-brand-neon: #00ff00;
  
  /* Backgrounds */
  --bg-page: #0a0e14;
  --bg-surface: #141922;
  --bg-card: #1a1f2e;
  --bg-input: #1e2433;
  --bg-hover: #252b3a;
  
  /* Text */
  --text-primary: #e8eef5;
  --text-secondary: #a0a8b5;
  --text-muted: #6b7280;
  
  /* Borders */
  --border-subtle: rgba(0, 255, 136, 0.12);
  --border-medium: rgba(0, 255, 136, 0.25);
  --border-strong: rgba(0, 255, 136, 0.4);
  
  /* Gradients */
  --gradient-card: linear-gradient(135deg, rgba(0, 255, 136, 0.08) 0%, rgba(26, 31, 46, 1) 100%);
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 4px 24px rgba(0, 255, 136, 0.15);
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 250ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========================================
   LIGHT MODE - MATCHING MAIN SITE EXACTLY
   ======================================== */

[data-theme="light"] {
  /* Brand Colors - Adjusted for light */
  --color-brand-green: #00cc77;
  --color-brand-neon: #00ff88;
  
  /* Backgrounds - EXACT MATCH TO MAIN SITE */
  --bg-page: #888c8c;              /* Medium gray (main site background) */
  --bg-surface: #a0a4a4;           /* Lighter gray for nav/footer */
  --bg-card: #3a4244;              /* Dark charcoal cards (main site cards) */
  --bg-input: #ffffff;             /* White inputs */
  --bg-hover: #4a5254;             /* Slightly lighter on hover */
  
  /* Text - Inverted for dark cards */
  --text-primary: #ffffff;         /* White text on dark cards */
  --text-secondary: #e0e4e4;       /* Light gray secondary */
  --text-muted: #b8bcbc;           /* Muted light gray */
  
  /* Borders - Adjusted for light mode */
  --border-subtle: rgba(255, 255, 255, 0.15);
  --border-medium: rgba(0, 200, 120, 0.35);
  --border-strong: rgba(0, 200, 120, 0.55);
  
  /* Gradients - Dark card gradient */
  --gradient-card: linear-gradient(135deg, #3a4244 0%, #2a3234 100%);
  
  /* Shadows - Softer for light backgrounds */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 4px 20px rgba(0, 200, 120, 0.3);
}

/* ========================================
   BASE STYLES
   ======================================== */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-page);
  min-height: 100vh;
}

/* ========================================
   CONTAINER
   ======================================== */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

/* ========================================
   TOP NAVIGATION
   ======================================== */

.top-nav {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-weight: 500;
  font-size: 0.9375rem;
}

.nav-back:hover {
  color: var(--color-brand-green);
  background: rgba(0, 255, 136, 0.1);
}

.nav-back svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: rgba(0, 255, 136, 0.1);
  border-color: var(--border-medium);
  transform: scale(1.05);
}

.theme-toggle:active {
  transform: scale(0.95);
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
  padding: 2rem 0 1.5rem;
  text-align: center;
}

@media (min-width: 768px) {
  .hero {
    padding: 4rem 0 3rem;
  }
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

@media (min-width: 768px) {
  .hero-icon {
    font-size: 3.5rem;
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-brand-neon);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

@media (min-width: 640px) {
  .hero-title {
    font-size: 2.5rem;
  }
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3rem;
  }
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.5;
}

@media (min-width: 640px) {
  .hero-subtitle {
    font-size: 1.125rem;
  }
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

@media (min-width: 640px) {
  .hero-stats {
    gap: 2.5rem;
  }
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-brand-green);
  display: block;
  line-height: 1;
}

@media (min-width: 640px) {
  .stat-value {
    font-size: 2rem;
  }
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

@media (min-width: 640px) {
  .stat-label {
    font-size: 0.875rem;
  }
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main-content {
  padding: 2rem 0 4rem;
}

@media (min-width: 768px) {
  .main-content {
    padding: 3rem 0 5rem;
  }
}

.module-section {
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .module-section {
    margin-bottom: 4rem;
  }
}

.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .section-title {
    font-size: 1.25rem;
  }
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .status-dot {
    width: 12px;
    height: 12px;
  }
}

.status-dot--active {
  background: var(--color-brand-green);
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.6);
}

.status-dot--soon {
  background: #ffaa00;
  box-shadow: 0 0 12px rgba(255, 170, 0, 0.4);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

/* ========================================
   MODULES GRID
   ======================================== */

.modules-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .modules-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .modules-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

/* ========================================
   MODULE CARD
   ======================================== */

.module-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

@media (min-width: 640px) {
  .module-card {
    padding: 1.5rem;
  }
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-brand-green), var(--color-brand-neon));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.module-card:hover::before {
  opacity: 1;
}

.module-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.module-card:active {
  transform: translateY(-2px);
}

.module-card--disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.module-card--disabled:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  border-color: var(--border-subtle);
}

.module-card--disabled::before {
  display: none;
}

/* Module Card Components */

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.module-icon {
  font-size: 2rem;
  line-height: 1;
}

@media (min-width: 640px) {
  .module-icon {
    font-size: 2.5rem;
  }
}

.module-badge {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (min-width: 640px) {
  .module-badge {
    font-size: 0.75rem;
  }
}

.module-badge--active {
  background: rgba(0, 255, 136, 0.2);
  color: var(--color-brand-neon);
  border: 1px solid rgba(0, 255, 136, 0.4);
}

.module-badge--soon {
  background: rgba(255, 170, 0, 0.2);
  color: #ffcc66;
  border: 1px solid rgba(255, 170, 0, 0.4);
}

.module-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

@media (min-width: 640px) {
  .module-title {
    font-size: 1.25rem;
  }
}

.module-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.module-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.feature-tag {
  padding: 0.25rem 0.625rem;
  background: rgba(0, 255, 136, 0.15);
  color: var(--color-brand-green);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.module-meta {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.meta-item {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.module-footer {
  margin-top: auto;
  padding-top: 0.75rem;
}

.module-link {
  color: var(--color-brand-green);
  font-weight: 500;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  transition: all var(--transition-fast);
}

.module-card:hover .module-link {
  gap: 0.5rem;
}

/* ========================================
   FOOTER
   ======================================== */

.site-footer {
  margin-top: auto;
  padding: 2rem 0;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.footer-content {
  text-align: center;
}

.footer-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.footer-note {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.footer-link {
  color: var(--color-brand-green);
  text-decoration: none;
  transition: all var(--transition-fast);
  font-weight: 500;
}

.footer-link:hover {
  color: var(--color-brand-neon);
  text-decoration: underline;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }
.text-secondary { color: var(--text-secondary); }
.text-mono { font-family: 'Consolas', 'Monaco', monospace; }
.text-accent { color: var(--color-brand-green); }

/* ========================================
   ACCESSIBILITY
   ======================================== */

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

:focus-visible {
  outline: 2px solid var(--color-brand-green);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
