/* Base CSS - Common styles */
:root {
    --bg: #0a0a0c;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --surface: #1e1e2a;
    --surface-2: #252535;
    --text: #e8e8ec;
    --text-dim: #9999aa;
    --text-muted: #55556a;
    --purple: #8a5cf5;
    --purple-dim: #6b4ac4;
    --purple-subtle: rgba(138, 92, 245, 0.12);
    --orange: #f5875c;
    --orange-dim: #c46a48;
    --green: #4caf50;
    --red: #ef5350;
    --cookie: #d4a574;
    --cookie-dark: #8b6914;
    --chip: #5c3d1e;
    --border: #2a2a3a;
    --border-light: #3a3a4a;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --transition: 0.2s ease;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--purple);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--orange);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

::selection {
    background: var(--purple);
    color: var(--text);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Navigation */
.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
    background: rgba(18, 18, 26, 0.9);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--purple);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.nav-logo-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.nav-logo:hover {
    color: var(--orange);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition);
    padding: 0.25rem 0;
    position: relative;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--purple);
    transition: width var(--transition);
    border-radius: 1px;
}

.nav-links a:hover::after {
    width: 100%;
}

/* User menu */
.nav-user {
    display: flex;
    align-items: center;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--purple);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
}

.login-btn:hover {
    background: var(--purple-dim);
    color: var(--text);
    transform: translateY(-1px);
}

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.user-menu:hover {
    background: var(--bg-tertiary);
}

.user-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 160px;
    box-shadow: var(--shadow-lg);
    display: none;
    overflow: hidden;
    z-index: 1001;
}

.user-menu.open .user-dropdown {
    display: block;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    transition: all var(--transition);
}

.user-dropdown a svg {
    flex-shrink: 0;
    opacity: 0.65;
}

.user-dropdown a:hover {
    background: var(--purple-subtle);
    color: var(--text);
}

/* Footer */
.site-footer {
    padding: 1.5rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: auto;
    background: var(--bg-secondary);
}

.site-footer .footer-label {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.site-footer .email {
    color: var(--purple);
    font-size: 0.8rem;
}

#app {
    flex: 1;
}

/* Mobile nav */
@media (max-width: 768px) {
    .site-nav {
        padding: 0.6rem 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        font-size: 0.8rem;
    }

    .user-name {
        display: none;
    }
}