/* Django ML/Data Science Template - Base Styles */
/* Common styles shared across all pages */

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

:root {
    /* Spacing & Layout (theme-independent) */
    --spacing-unit: 1rem;
    --max-width: 1200px;
    --border-radius: 8px;
}

/* Light Theme */
[data-theme="light"] {
    --color-bg: #f8f9fa;
    --color-surface: #ffffff;
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-text: #1f2937;
    --color-text-light: #6b7280;
    --color-border: #e5e7eb;
    --color-success: #059669;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Dark Theme (Default) */
[data-theme="dark"] {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-primary: #3b82f6;
    --color-primary-hover: #60a5fa;
    --color-text: #f1f5f9;
    --color-text-light: #94a3b8;
    --color-border: #334155;
    --color-success: #10b981;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Typography - System Fonts */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto',
                 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-unit) 0;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 100;
}

.header-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
}

nav ul {
    display: flex;
    list-style: none;
    gap: calc(var(--spacing-unit) * 2);
    align-items: center;
}

nav a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    display: block;
    padding: 0.5rem 0;
}

nav a:hover {
    color: var(--color-primary);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    color: var(--color-text);
}

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

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

.dropdown-toggle {
    cursor: pointer;
    color: var(--color-text);
    font-weight: 500;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dropdown-toggle:hover {
    color: var(--color-primary);
}

.dropdown-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

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

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0;
}

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

.dropdown-menu li {
    list-style: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.4rem 1.5rem;
    color: var(--color-text);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    line-height: 1;
}

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

/* Main Content */
main {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 2);
    width: 100%;
}

/* Footer */
footer {
    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: calc(var(--spacing-unit) * 2) 0;
    margin-top: auto;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 2);
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: var(--spacing-unit);
    }

    nav ul {
        gap: var(--spacing-unit);
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0;
        margin-top: 0.5rem;
        display: none;
    }

    .dropdown:hover .dropdown-menu {
        display: block;
    }

    main {
        padding: calc(var(--spacing-unit) * 2) var(--spacing-unit);
    }
}

@media (max-width: 480px) {
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        width: 100%;
    }

    .dropdown {
        width: 100%;
    }

    .dropdown-toggle {
        justify-content: center;
    }
}
