/* CSS Variables */
:root {
    /* Colors */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #8b5cf6;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    
    /* Neutral Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* 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);
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Typography */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --border-light: #475569;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-md);
    }
}

/* Header */
.header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--text-primary);
}

.logo i {
    font-size: var(--font-size-xl);
    color: var(--primary-color);
}

.logo h1 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin: 0;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: var(--space-xl);
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: var(--radius-full);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.search-container {
    position: relative;
}

.search-input {
    padding: var(--space-sm) var(--space-md) var(--space-sm) var(--space-2xl);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    min-width: 250px;
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(99 102 241 / 0.1);
}

.search-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.theme-toggle {
    padding: var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

/* Mobile Navigation */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: var(--space-md);
    }
    
    .nav {
        order: 3;
        width: 100%;
    }
    
    .nav-list {
        justify-content: center;
        gap: var(--space-lg);
    }
    
    .search-input {
        min-width: 200px;
    }
}

@media (max-width: 480px) {
    .header-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .search-container {
        order: 1;
    }
    
    .search-input {
        min-width: auto;
        width: 100%;
    }
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: var(--space-3xl) 0;
}

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

.hero-title {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: var(--space-lg);
    line-height: 1.2;
}

.hero-description {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-2xl);
    opacity: 0.9;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.stat-label {
    font-size: var(--font-size-sm);
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background-color: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: var(--font-size-lg);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-lg);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

@media (max-width: 768px) {
    .hero {
        padding: var(--space-2xl) 0;
    }
    
    .hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .hero-stats {
        gap: var(--space-lg);
    }
}

@media (max-width: 480px) {
    .hero-stats {
        flex-direction: column;
        gap: var(--space-md);
    }
}

/* Section Styles */
.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.section-description {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Tools Section */
.tools-section {
    padding: var(--space-3xl) 0;
    background-color: var(--bg-secondary);
}

.category-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-2xl);
}

.filter-btn {
    padding: var(--space-sm) var(--space-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.tool-card {
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

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

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    transform: scaleX(0);
    transition: transform var(--transition-fast);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-lg);
}

.tool-info h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.tool-info p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-md);
}

.tool-tag {
    padding: var(--space-xs) var(--space-sm);
    background-color: var(--bg-secondary);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

/* Favorites Section */
.favorites-section {
    padding: var(--space-3xl) 0;
}

.empty-state {
    text-align: center;
    padding: var(--space-3xl);
    color: var(--text-muted);
}

.empty-state i {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-lg);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-sm);
}

/* About Section */
.about-section {
    padding: var(--space-3xl) 0;
    background-color: var(--bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
}

.about-card {
    text-align: center;
    padding: var(--space-xl);
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.about-card i {
    font-size: var(--font-size-2xl);
    color: var(--primary-color);
    margin-bottom: var(--space-lg);
}

.about-card h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.about-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Footer */
.footer {
    background-color: var(--bg-tertiary);
    padding: var(--space-2xl) 0 var(--space-lg);
    margin-top: var(--space-3xl);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-xl);
}

.footer-brand {
    max-width: 300px;
}

.footer-brand .logo {
    margin-bottom: var(--space-md);
}

.footer-brand .logo span {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.footer-brand p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-xl);
}

.footer-section h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: var(--space-sm);
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Utilities */
.hidden {
    display: none !important;
}

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

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* Smooth animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}