/* Tech-focused Theme System with Dark/Light Mode Support */

:root {
  /* Light Theme Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #fafbff;
  --bg-tertiary: #f4f7ff;
  --bg-card: #ffffff;
  --bg-code: #1e293b;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  
  --border-primary: #e2e8f0;
  --border-secondary: #cbd5e1;
  --border-focus: #3b82f6;
  
  /* Tech-inspired Brand Colors */
  --brand-primary: #2563eb;
  --brand-secondary: #1d4ed8;
  --brand-tertiary: #1e40af;
  --brand-accent: #06b6d4;
  --brand-success: #10b981;
  --brand-warning: #f59e0b;
  --brand-error: #ef4444;
  
  /* Tech Gradients */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  --gradient-code: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  --gradient-glass: rgba(255, 255, 255, 0.1);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.3);
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  /* Typography */
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #243447;
  --bg-tertiary: #3a4a63;
  --bg-card: #243447;
  --bg-code: #0f172a;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;
  
  --border-primary: #334155;
  --border-secondary: #475569;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.5);
  
  --gradient-glass: rgba(255, 255, 255, 0.05);
}

/* Auto Theme (System Preference) */
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg-primary: #0f172a;
    --bg-secondary: #243447;
    --bg-tertiary: #3a4a63;
    --bg-card: #243447;
    --bg-code: #0f172a;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;
    
    --border-primary: #334155;
    --border-secondary: #475569;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.5);
    
    --gradient-glass: rgba(255, 255, 255, 0.05);
  }
}

/* Base Styles */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color var(--transition-normal), color var(--transition-normal);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Enhancement */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

h1 { font-size: 3.5rem; line-height: 1.1; }
h2 { font-size: 2.5rem; line-height: 1.2; }
h3 { font-size: 2rem; line-height: 1.3; }
h4 { font-size: 1.5rem; line-height: 1.4; }

@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.5rem; }
}

/* Enhanced Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--gradient-glass), transparent);
  transition: left var(--transition-slow);
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--gradient-secondary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-primary);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--brand-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Enhanced Card Styles */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, var(--brand-primary), transparent);
  opacity: 0;
  transition: opacity var(--transition-slow);
  z-index: -1;
}

.card:hover::before {
  opacity: 0.1;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--brand-primary);
}

.card-glow {
  box-shadow: var(--shadow-glow);
}

/* Glass Morphism Effect */
.glass {
  background: var(--gradient-glass);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Neon Effects for Tech Aesthetic */
.neon-text {
  text-shadow: 0 0 5px var(--brand-primary), 0 0 10px var(--brand-primary), 0 0 15px var(--brand-primary);
}

.neon-border {
  border: 2px solid var(--brand-primary);
  box-shadow: 0 0 10px var(--brand-primary), inset 0 0 10px var(--brand-primary);
}

/* Code Block Styling */
.code-block {
  background: var(--bg-code);
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  overflow-x: auto;
  border: 1px solid var(--border-secondary);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* Loading Animation */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.loading {
  animation: pulse 2s infinite;
}

.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--gradient-glass), transparent);
  animation: shimmer 2s infinite;
}

/* Theme Toggle Button */
.theme-toggle {
  position: relative;
  width: 60px;
  height: 30px;
  background: var(--bg-tertiary);
  border-radius: 15px;
  border: 2px solid var(--border-primary);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.theme-toggle::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: var(--brand-primary);
  border-radius: 50%;
  transition: transform var(--transition-normal);
}

.theme-toggle.dark::before {
  transform: translateX(28px);
}

/* Utility Classes */
.text-gradient {
  background: var(--gradient-secondary);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.backdrop-blur {
  backdrop-filter: blur(10px);
}

.border-gradient {
  border: 2px solid transparent;
  background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
              var(--gradient-secondary) border-box;
}

/* Responsive Design Enhancements */
@media (max-width: 640px) {
  .card {
    padding: 1rem;
  }
  
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
}

/* Focus States for Accessibility */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }
}

/* Mobile Navigation Enhancements */
@media (max-width: 767px) {
    /* Ensure mobile menu button is above theme toggle */
    .mobile-menu-button {
        z-index: 60 !important;
        position: relative;
    }
    
    /* Improve mobile menu */
    .mobile-menu {
        position: relative;
        z-index: 50;
    }
    
    /* Ensure proper touch targets */
    .mobile-menu-button {
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* Prevent zoom on focus for mobile */
    input[type="text"],
    input[type="email"],
    textarea,
    select {
        font-size: 16px !important;
    }
}


/* Professional Mobile Navigation Styles */
.mobile-nav-container {
    position: relative;
    isolation: isolate;
}

.mobile-menu-toggle {
    position: relative;
    z-index: 60;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.mobile-menu-toggle:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hamburger-line {
    background-color: currentColor;
    border-radius: 2px;
    transform-origin: center;
}

.mobile-menu-panel {
    position: relative;
    z-index: 50;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-link {
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid transparent;
}

.mobile-nav-link:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.mobile-nav-link:active {
    transform: translateX(2px) scale(0.98);
}

/* Enhanced Mobile Touch Interactions */
@media (max-width: 767px) {
    /* Larger touch targets */
    .mobile-menu-toggle {
        min-width: 48px !important;
        min-height: 48px !important;
        padding: 12px !important;
    }
    
    .mobile-nav-link {
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    /* Prevent text selection on touch */
    .mobile-menu-toggle,
    .mobile-nav-link {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
    
    /* Better visual feedback */
    .mobile-menu-toggle:active {
        transform: scale(0.95);
        background-color: rgba(255, 255, 255, 0.2) !important;
    }
    
    .mobile-nav-link:active {
        background-color: rgba(255, 255, 255, 0.15) !important;
    }
}

/* Improved Focus States for Accessibility */
.mobile-menu-toggle:focus-visible,
.mobile-nav-link:focus-visible,
#theme-toggle:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
    border-radius: 8px;
}

/* Smooth Animations */
.mobile-menu-panel {
    will-change: max-height, opacity;
}

.hamburger-line {
    will-change: transform, opacity;
}

.mobile-nav-link {
    will-change: transform, background-color;
}

#theme-toggle {
    will-change: transform, box-shadow, background-color;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .mobile-menu-panel,
    .hamburger-line,
    .mobile-nav-link,
    #theme-toggle {
        transition: none !important;
        animation: none !important;
    }
}

/* Professional FAB (Floating Action Button) Group System */








 