/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark theme (default) */
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #1f2937;
    --bg-card: #111827;
    --border-primary: #374151;
    --border-secondary: #4b5563;
    --text-primary: #ffffff;
    --text-secondary: #e5e7eb;
    --text-tertiary: #d1d5db;
    --text-muted: #9ca3af;
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --shadow-primary: rgba(0, 0, 0, 0.3);
    --shadow-secondary: rgba(0, 0, 0, 0.2);
}

body.light-mode {
    /* Light theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #ffffff;
    --bg-card: #f1f5f9;
    --border-primary: #e2e8f0;
    --border-secondary: #cbd5e1;
    --text-primary: #1e293b;
    --text-secondary: #334155;
    --text-tertiary: #475569;
    --text-muted: #64748b;
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --shadow-primary: rgba(0, 0, 0, 0.1);
    --shadow-secondary: rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    padding: 1.5rem 0;
    box-shadow: 0 1px 3px var(--shadow-secondary);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo h1 {
    font-size: 1.75rem;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: 0.25rem;
}

.logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 400;
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-tertiary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
}

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

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: ' ▼';
    font-size: 0.7rem;
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
}

.dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-primary);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    list-style: none;
    padding: 0.5rem 0;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0;
}

.dropdown-menu a:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Theme Toggle */
.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--border-primary);
    transform: scale(1.05);
}

.theme-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(20deg);
}

/* Main content */
main {
    padding: 4rem 0;
}

/* Hero section */
.hero {
    text-align: center;
    margin-bottom: 5rem;
}

.hero h2 {
    font-size: 2.5rem;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-tertiary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Tools section */
.tools-section {
    margin-bottom: 5rem;
}

.tools-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.tool-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 6px var(--shadow-primary);
    transition: all 0.2s ease;
    position: relative;
}

.tool-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
    background: var(--bg-card);
}

.tool-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.tool-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
    background: var(--border-primary);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.tool-card:hover .tool-icon {
    background: var(--border-secondary);
}

.tool-card h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

.tool-card p {
    color: var(--text-tertiary);
    margin-bottom: 2rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.tool-button {
    display: inline-flex;
    align-items: center;
    background: var(--accent-primary);
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.tool-button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.tool-button:active {
    transform: translateY(0);
}

/* Features section */
.features-section {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 3rem;
    margin: 0 auto;
    max-width: 500px;
    box-shadow: 0 4px 6px var(--shadow-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    text-align: center;
}

.feature-item h4 {
    font-size: 1.125rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.feature-item p {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
    filter: grayscale(0.2);
}

/* Footer */
footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-primary);
    padding: 2.5rem 0;
    margin-top: 5rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-left p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

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

.separator {
    color: var(--border-secondary);
    font-size: 0.8rem;
}

/* Legal pages styles */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 4px 6px var(--shadow-secondary);
    font-size: 0.9rem;
}

.legal-content h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-primary);
    padding-bottom: 1rem;
}

.last-updated {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 2.5rem;
    font-style: italic;
}

.legal-section {
    margin-bottom: 2rem;
}

.legal-section h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent-primary);
    padding-left: 1rem;
}

.legal-section h4 {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
}

.legal-section p {
    color: var(--text-tertiary);
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.legal-section ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.legal-section li {
    color: var(--text-tertiary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.info-block {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 1.2rem;
    margin: 1rem 0;
}

.info-block p {
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.info-block p:last-child {
    margin-bottom: 0;
}

.legal-content a {
    color: #60a5fa;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.legal-content a:hover {
    color: #93c5fd;
}

.back-link {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-primary);
    text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .logo {
        margin-bottom: 1rem;
    }
    
    .main-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: none;
        padding: 0;
        margin-top: 0.5rem;
    }
    
    .dropdown-menu li {
        margin: 0.25rem 0;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .tools-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tool-card {
        padding: 2rem;
    }
    
    .features-section {
        padding: 2rem;
    }
    
    .legal-content {
        padding: 2rem;
    }
    
    .legal-content h2 {
        font-size: 1.75rem;
    }
    
    .legal-section h3 {
        font-size: 1.25rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    main {
        padding: 3rem 0;
    }
    
    .hero {
        margin-bottom: 3rem;
    }
    
    .hero h2 {
        font-size: 1.75rem;
    }
    
    .tools-section {
        margin-bottom: 3rem;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
    
    .tool-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .tool-icon {
        margin-right: 0;
    }
    
    .legal-content {
        padding: 1.5rem;
        margin: 0 -16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .legal-content h2 {
        font-size: 1.5rem;
    }
    
    .legal-section h3 {
        font-size: 1.1rem;
    }
}