/* ===== components.css ===== */
/* Optimized component styles for enhanced functionality and performance */

/* Ensure color variables are available if styles.css doesn't load first */
:root {
    --muted-blue-gray: #6B7280; /* Fallback definition */
}

/* Loading Animation with hardware acceleration */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(139, 158, 183, 0.2);
    border-radius: 50%;
    border-top-color: var(--muted-blue-gray);
    animation: spin 1s linear infinite;
    will-change: transform;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Button Variants aligned with 60-30-10 color system */
/* Standard button classes */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Primary button - using our brand color (30%) */
.btn-primary {
    background-color: var(--primary-600);
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: var(--primary-400);
    transform: translateY(-2px);
}

/* Accent button - using our accent color (10%) */
.btn-accent {
    background-color: var(--accent-500);
    color: var(--neutral-800);
    border: none;
}

.btn-accent:hover {
    background-color: #e2c89c; /* Lighter shade of accent */
    transform: translateY(-2px);
}

/* Outline button - neutral color (60%) */
.btn-outline {
    background: transparent;
    color: var(--neutral-600);
    border: 1px solid var(--neutral-300);
}

.btn-outline:hover {
    border-color: var(--primary-400);
    color: var(--primary-400);
}

.btn-ghost {
    background: transparent;
    color: var(--primary-600);
    border: 1px solid var(--primary-600);
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.btn-ghost:hover {
    background: var(--primary-600);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.3);
}

/* Secondary brand button (steel blue) */
.btn-ghost.secondary {
    color: var(--primary-400);
    border: 1px solid var(--primary-400);
}

.btn-ghost.secondary:hover {
    background: var(--primary-400);
    color: white;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

/* Accent button (warm gold) */
.btn-ghost.accent {
    color: var(--accent-500);
    border: 1px solid var(--accent-500);
}

.btn-ghost.accent:hover {
    background: var(--accent-500);
    color: white;
    box-shadow: 0 8px 20px rgba(215, 186, 137, 0.3);
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-400));
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-gradient-secondary {
    background: linear-gradient(135deg, var(--accent-500), var(--primary-600));
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
}

/* Minimizing color combinations to maintain the 60-30-10 rule */
.btn-gradient-accent {
    background: linear-gradient(135deg, var(--accent-500), var(--primary-400));
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

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

/* Advanced Card Variants */
.card-elevated {
    background: white;
    border-radius: 16px;
    padding: var(--space-xl);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(30, 58, 138, 0.05);
    transition: all 400ms cubic-bezier(0.23, 1, 0.320, 1);
}

.card-elevated:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 30px 60px rgba(30, 58, 138, 0.1);
}

.card-glassmorphism {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Progress Bars - Using our 60-30-10 color system */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--neutral-200); /* Neutral color (60%) */
    border-radius: 3px;
    overflow: hidden;
    margin: var(--space-sm) 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-600), var(--primary-400)); /* Brand colors (30%) */
    border-radius: 3px;
    transition: width 2s ease-in-out;
    width: 0%;
}

.progress-fill.accent {
    background: linear-gradient(90deg, var(--accent-500), var(--primary-400)); /* Accent (10%) + Brand (30%) */
}

.progress-fill.neutral {
    background: linear-gradient(90deg, var(--neutral-600), var(--neutral-400)); /* Neutral colors (60%) */
}

/* Skill Level Indicators */
.skill-level {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: var(--space-sm) 0;
}

.skill-dots {
    display: flex;
    gap: 4px;
}

.skill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neutral-200); /* Neutral color (60%) */
    transition: background-color 0.3s ease;
}

.skill-dot.filled {
    background: var(--primary-600); /* Primary brand color (30%) */
}

.skill-dot.filled.accent {
    background: var(--accent-500); /* Accent color (10%) */
}

.skill-dot.filled.neutral {
    background: var(--neutral-600); /* Neutral color (60%) */
}

/* Timeline Component - Using our 60-30-10 color system */
.timeline {
    position: relative;
    padding-left: var(--space-xl);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-600), var(--primary-400)); /* Brand colors (30%) */
}

.timeline.accent::before {
    background: linear-gradient(to bottom, var(--accent-500), var(--primary-600)); /* Accent (10%) + Brand (30%) */
}

.timeline.neutral::before {
    background: linear-gradient(to bottom, var(--neutral-800), var(--neutral-600)); /* Neutral colors (60%) */
}

.timeline.tertiary::before {
    background: linear-gradient(to bottom, var(--muted-blue-gray), var(--deep-navy));
}

.timeline-item {
    position: relative;
    margin-bottom: var(--space-xl);
    padding-left: var(--space-md);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--deep-navy);
    border: 3px solid var(--off-white);
    box-shadow: 0 0 0 3px var(--deep-navy);
}

.timeline.secondary .timeline-item::before {
    background: var(--warm-gold);
    box-shadow: 0 0 0 3px var(--warm-gold);
}

.timeline.tertiary .timeline-item::before {
    background: var(--muted-blue-gray);
    box-shadow: 0 0 0 3px var(--muted-blue-gray);
}

/* Statistics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-lg);
    margin: 0;
}

.stat-card {
    text-align: center;
    padding: var(--space-xl);
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-top: 4px solid var(--deep-navy);
}

.stat-card.secondary {
    border-top: 4px solid var(--warm-gold);
}

.stat-card.secondary .stat-number {
    color: var(--warm-gold);
}

.stat-card.tertiary {
    border-top: 4px solid var(--muted-blue-gray);
}

.stat-card.tertiary .stat-number {
    color: var(--muted-blue-gray);
}

.stat-number {
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--deep-navy);
    display: block;
    margin-bottom: var(--space-sm); /* Increased from space-xs to space-sm for better visual separation */
}

.stat-label {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Animated Counter */
.counter {
    font-variant-numeric: tabular-nums;
}

/* Interactive Elements */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(30, 58, 138, 0.3);
}

.hover-glow.secondary:hover {
    box-shadow: 0 0 20px rgba(215, 186, 137, 0.4);
}

.hover-glow.tertiary:hover {
    box-shadow: 0 0 20px rgba(139, 158, 183, 0.4);
}

/* Scroll Indicators */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--soft-gray);
    z-index: 1000;
}

.scroll-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--muted-blue-gray), var(--warm-gold));
    width: 0%;
    transition: width 0.1s ease;
}

/* Modal Component */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: white;
    border-radius: 16px;
    padding: var(--space-2xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translate(-50%, -50%) scale(1);
}

/* Notification Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--muted-blue-gray);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1001;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: #10B981;
}

.toast.error {
    background: #EF4444;
}

.toast.warning {
    background: #F59E0B;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* We'll use classes instead of root variables to prevent theme conflicts */
    body.dark-mode {
        --off-white: #1a1a1a;
        --soft-gray: #2d2d2d;
        --text-primary: #ffffff;
        --text-secondary: #a0a0a0;
        --text-tertiary: #666666;
        --bg-white: #2d2d2d;
    }
    
    body.dark-mode .card, 
    body.dark-mode .card-elevated, 
    body.dark-mode .project-card {
        background: #2d2d2d;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    /* Fix for stat cards in dark mode */
    body.dark-mode .stat-card {
        background: #2d2d2d;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }
    
    /* Fix for form elements in dark mode */
    body.dark-mode input, 
    body.dark-mode textarea {
        background-color: #333 !important;
        color: #fff !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
    }
    
    body.dark-mode input::placeholder, 
    body.dark-mode textarea::placeholder {
        color: #888 !important;
    }
    
    /* Fix for timeline in dark mode */
    body.dark-mode .timeline-item::before {
        border: 3px solid #2d2d2d;
        z-index: 1;
    }
    
    body.dark-mode .skill-category {
        background: #252525;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
        border-left-color: currentColor;
    }
    
    body.dark-mode .skill-category:nth-child(1) {
        background: linear-gradient(to right, rgba(30, 58, 138, 0.15), rgba(30, 58, 138, 0.05));
    }
    
    body.dark-mode .skill-category:nth-child(2) {
        background: linear-gradient(to right, rgba(215, 186, 137, 0.15), rgba(215, 186, 137, 0.05));
    }
    
    body.dark-mode .skill-category:nth-child(3) {
        background: linear-gradient(to right, rgba(139, 158, 183, 0.15), rgba(139, 158, 183, 0.05));
    }
    
    body.dark-mode .skill-tag {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
        border: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
        transition: all 0.2s ease-in-out;
    }
    
    body.dark-mode .skill-tag:hover {
        background: rgba(255, 255, 255, 0.15);
        transform: translateY(-2px);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    }
    
    body.dark-mode .nav {
        background: rgba(26, 26, 26, 0.95);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Fix modal in dark mode */
    body.dark-mode .modal {
        background: #2d2d2d;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Remove inline nav background in dark mode */
    body.dark-mode .nav[style*="background"] {
        background: rgba(26, 26, 26, 0.95) !important;
    }
}

/* Print Styles */
@media print {
    .nav, .mobile-menu, .btn, .modal-overlay {
        display: none;
    }
    
    .hero {
        min-height: auto;
        padding-top: 0;
    }
    
    .section {
        padding: var(--space-lg) 0;
    }
    
    .project-card, .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --muted-blue-gray: #374151; /* Darker blue-gray for high contrast */
        --text-primary: #000000;
        --text-secondary: #000000;
    }
    
    .btn-primary {
        background: #000000;
        border: 2px solid #000000;
    }
    
    .card, .project-card {
        border: 2px solid #000000;
    }
}

/* Animation Performance */
@media (prefers-reduced-motion: reduce) {
    .lazy-load,
    .hover-lift,
    .hover-glow,
    .btn,
    .project-card,
    .card-elevated {
        animation: none;
        transition: none;
    }
}

/* Section Heading Alignment - Enhanced for modern UI/UX */
.section-heading-container {
    display: flow-root; /* prevent margin-collapsing so bottom spacing is respected */
    text-align: center;
    max-width: var(--content-width-medium);
    margin: 0 auto var(--space-2xl) auto;
    padding: 0 var(--space-md);
}

.section-heading-container h2 {
    margin-bottom: var(--space-lg);
    max-width: var(--content-width-narrow);
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--space-md);
}

.section-heading-container p {
    max-width: var(--content-width-narrow);
    margin: 0 auto;
    color: var(--text-secondary);
    font-size: var(--text-lg);
    line-height: var(--line-height-relaxed);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
        max-width: 300px;
        margin: 0 auto;
    }
    
    .stat-card {
        padding: var(--space-lg);
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
    }
    
    .stat-number {
        font-size: var(--text-3xl);
        margin-bottom: 0;
        margin-right: var(--space-md);
        min-width: 60px;
    }
    
    .stat-label {
        font-size: var(--text-sm);
        text-align: right;
        flex: 1;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        gap: var(--space-sm);
        max-width: 280px;
    }
    
    .stat-card {
        padding: var(--space-md);
    }
    
    .stat-number {
        font-size: var(--text-2xl);
        margin-right: var(--space-sm);
        min-width: 50px;
    }
    
    .stat-label {
        font-size: var(--text-xs);
        line-height: 1.3;
    }
}