/* ===== THEME VARIABLES ===== */
:root {
    /* Light Theme (Default) */
    --primary: #4361ee;
    --primary-dark: #3a0ca3;
    --primary-light: #4895ef;
    --secondary: #7209b7;
    --accent: #f72585;
    --success: #4cc9f0;
    --warning: #f9c74f;
    --danger: #e63946;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    
    --shadow-sm: 0 1px 2px 0 var(--shadow-color);
    --shadow: 0 4px 6px -1px var(--shadow-color), 0 2px 4px -1px var(--shadow-color);
    --shadow-md: 0 10px 15px -3px var(--shadow-color), 0 4px 6px -2px var(--shadow-color);
    --shadow-lg: 0 20px 25px -5px var(--shadow-color), 0 10px 10px -5px var(--shadow-color);
    --shadow-xl: 0 25px 50px -12px var(--shadow-color);
    
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --border-color: #334155;
    --shadow-color: rgba(0, 0, 0, 0.3);
    
    --primary: #6366f1;
    --primary-dark: #818cf8;
    --primary-light: #a5b4fc;
    --secondary: #a855f7;
    --accent: #ec4899;
    --success: #22d3ee;
    --warning: #fbbf24;
    --danger: #ef4444;
}

/* ===== THEME TRANSITIONS ===== */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.navbar,
.tool-card,
.step-card,
.blog-card,
.pricing-card,
.footer {
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ===== DARK THEME SPECIFIC STYLES ===== */
[data-theme="dark"] {
    /* Hero section adjustments for dark theme */
    .hero-section {
        background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%);
    }
    
    .hero-card {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Ad placeholder adjustments */
    .ad-placeholder {
        background: var(--bg-tertiary);
        border-color: var(--border-color);
    }
    
    /* CTA section adjustments */
    .cta-section {
        background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%);
    }
}

/* ===== THEME TOGGLE ANIMATIONS ===== */
.theme-toggle {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
}

/* ===== SYSTEM PREFERENCE DETECTION ===== */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
        
        --border-color: #334155;
        --shadow-color: rgba(0, 0, 0, 0.3);
        
        --primary: #6366f1;
        --primary-dark: #818cf8;
        --primary-light: #a5b4fc;
        --secondary: #a855f7;
        --accent: #ec4899;
        --success: #22d3ee;
        --warning: #fbbf24;
        --danger: #ef4444;
    }
}

/* ===== HIGH CONTRAST MODE SUPPORT ===== */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #000000;
        --text-secondary: #333333;
        --border-color: #000000;
    }
    
    [data-theme="dark"] {
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --border-color: #ffffff;
    }
    
    .nav-link::after,
    .tool-card::before {
        height: 3px;
    }
    
    .btn {
        border-width: 2px;
    }
}

/* ===== REDUCED MOTION SUPPORT ===== */
@media (prefers-reduced-motion: reduce) {
    :root {
        --transition: none;
        --transition-slow: none;
    }
    
    .theme-toggle:hover {
        transform: none;
    }
    
    .tool-card:hover,
    .step-card:hover,
    .blog-card:hover,
    .pricing-card:hover {
        transform: none;
    }
    
    .tool-cta:hover,
    .blog-link:hover {
        gap: 0.5rem;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar,
    .theme-toggle,
    .mobile-menu-btn,
    .back-to-top,
    .ad-section {
        display: none !important;
    }
    
    body {
        padding-top: 0;
        background: white !important;
        color: black !important;
    }
    
    .hero-section {
        background: none !important;
        color: black !important;
    }
    
    .hero-title,
    .hero-description,
    .stat-number,
    .stat-label {
        color: black !important;
    }
    
    .tool-card,
    .step-card,
    .blog-card,
    .pricing-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }
}