/* Base CSS - Design system, reset, header, footer, common components */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0f0f12;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-elevated: #18181b;
    --bg-input: #1a1a1d;
    --text: #ffffff;
    --text-muted: #a1a1aa;
    --text-dim: #71717a;
    --accent: #f97316;
    --accent-glow: rgba(249, 115, 22, 0.15);
    --purple: #a855f7;
    --purple-dim: rgba(168, 85, 247, 0.15);
    --green: #22c55e;
    --green-dim: rgba(34, 197, 94, 0.15);
    --blue: #3b82f6;
    --blue-dim: rgba(59, 130, 246, 0.15);
    --yellow: #eab308;
    --yellow-dim: rgba(234, 179, 8, 0.15);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.15);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --font-body: 'Outfit', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

.bg-gradient {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(249, 115, 22, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(168, 85, 247, 0.1), transparent),
        radial-gradient(ellipse 50% 30% at 0% 100%, rgba(59, 130, 246, 0.08), transparent);
    pointer-events: none;
    z-index: 0;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(15, 15, 18, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 2rem;
}

.header-content {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

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

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), #fb923c);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.header-nav a {
    padding: 0.5rem 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
}

.header-nav a:hover {
    color: var(--text);
    background: var(--bg-card);
}

.header-nav a.active {
    color: var(--text);
    background: var(--bg-card);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.6rem 0.4rem 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.user-menu:hover {
    background: var(--bg-card-hover);
}

.user-avatar {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-header {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-header:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-header-primary {
    background: linear-gradient(135deg, var(--accent), #fb923c);
    border: none;
    color: white;
}

.btn-header-primary:hover {
    opacity: 0.9;
}

nav form {
    display: contents;
}

.nav-logout {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: none;
    padding: 0.5rem 0.9rem;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-logout:hover {
    color: var(--text);
    background: var(--bg-card);
}

/* Footer */
footer {
    position: relative;
    z-index: 1;
    padding: 2rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* Common utilities */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #fb923c);
    color: white;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn svg {
    width: 16px;
    height: 16px;
}

/* Mobile menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(15, 15, 18, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    z-index: 99;
}

.mobile-nav.open {
    display: block;
}

.mobile-nav a,
.mobile-nav button {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-family: var(--font-body);
    cursor: pointer;
}

.mobile-nav a:hover,
.mobile-nav button:hover {
    background: var(--bg-card);
    color: var(--text);
}

@media (max-width: 768px) {
    header {
        padding: 0 1rem;
    }

    .header-left {
        gap: 1rem;
    }

    .header-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .header-right .btn-header,
    .header-right .user-menu,
    .header-right form {
        display: none;
    }

    .logo-text {
        font-size: 1rem;
    }
}
