/* Color Palettes */
:root {
    /* Default Palette (Blue) */
    --palette-primary: #2563eb;
    --palette-primary-hover: #1d4ed8;
    --palette-bg: #ffffff;
    --palette-text: #1f2937;
    --palette-text-light: #6b7280;
    --palette-card: #f9fafb;
    --palette-border: #e5e7eb;
    --palette-shadow: rgba(0, 0, 0, 0.1);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
    
    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --line-height: 1.6;
    --border-radius: 8px;
    
    /* Colors - These will be overridden by palette themes */
    --accent-color: var(--palette-primary);
    --accent-hover: var(--palette-primary-hover);
    --bg-color: var(--palette-bg);
    --text-color: var(--palette-text);
    --text-light: var(--palette-text-light);
    --card-bg: var(--palette-card);
    --border-color: var(--palette-border);
    --shadow: var(--palette-shadow);
}

/* Green Palette */
[data-theme="light"][data-palette="green"] {
    --palette-primary: #059669;
    --palette-primary-hover: #047857;
    --palette-bg: #f0fdf4;
    --palette-text: #1f2937;
    --palette-text-light: #6b7280;
    --palette-card: #dcfce7;
    --palette-border: #bbf7d0;
    --palette-shadow: rgba(5, 150, 105, 0.1);
}

/* Dark Theme Palettes */
[data-theme="dark"] {
    --palette-bg: #111827;
    --palette-text: #f9fafb;
    --palette-text-light: #9ca3af;
    --palette-card: #1f2937;
    --palette-border: #374151;
    --palette-shadow: rgba(0, 0, 0, 0.3);
}

[data-theme="dark"][data-palette="green"] {
    --palette-primary: #34d399;
    --palette-primary-hover: #10b981;
    --palette-bg: #064e3b;
    --palette-card: #065f46;
    --palette-border: #047857;
}

/* Non-critical CSS - Loaded asynchronously */

/* Dark theme colors */
[data-theme="dark"] {
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    will-change: background-color, color;
}

/* Base styles (non-critical) */
body {
    font-family: var(--font-main);
    line-height: var(--line-height);
    /* Only transition colors for better performance */
    transition: background-color 0.3s ease, color 0.3s ease;
    /* Optimize for performance */
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-sm);
}

p {
    margin-bottom: var(--spacing-sm);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Social Section */
.social-section {
    background: var(--card-bg);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: var(--spacing-lg);
}

.social-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: var(--spacing-md);
    justify-content: center;
}

.social-link {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    color: var(--text-color);
    background: var(--card-bg);
    text-decoration: none;
    font-weight: 500;
    min-height: 3.5rem;
    box-sizing: border-box;
    min-width: 10rem;
    will-change: transform, box-shadow, border-color;
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    border-color: var(--accent-color);
    /* Optimize animations */
    will-change: transform, box-shadow, border-color;
}

.social-icon {
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
    fill: currentColor;
    flex-shrink: 0;
}

/* Specific icon colors */
.social-link.linkedin {
    color: var(--palette-text);
}

.social-link.github {
    color: var(--text-color);
}

/* Dark mode adjustments */
[data-theme="dark"] .social-link.github {
    color: #f8f9fa;
}

/* Animation for theme toggle */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.theme-toggle:active .theme-icon {
    animation: rotate 0.5s ease;
}

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

/* Print styles */
@media print {
    .theme-toggle {
        display: none;
    }
    
    .social-links {
        justify-content: flex-start;
    }
}