@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* ============================================================================
   Base CSS - Shared Variables and Layout Components
   ============================================================================ */

:root {
    /* Light Theme Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #010307;
    --text-secondary: #16a34a;
    --text-tertiary: #4b5563;
    --border-color: #e2e8f0;
    --accent-primary: #16a34a;
    --accent-secondary: #15803d;
    --accent-hover: #15803d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --gradient: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    --bg-gradient: var(--gradient);
    --success: #16a34a;
    --error: #ef4444;
    --warning: #f59e0b;
    --font-size-base: clamp(1rem, 0.4vw + 0.875rem, 1.125rem);
    --container-max-width: 1200px;
    --navbar-height: 80px;
}

[data-theme="dark"] {
    /* Dark Theme Colors */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #1a1a1a;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #a3f8b8;
    --border-color: #2a2a2a;
    --accent-primary: #22863b;
    --accent-secondary: #67c089;
    --accent-hover: #22d631;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

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

body {
    font-family: inherit;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: var(--font-size-base);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================================
   Theme Toggle Button
   ============================================================================ */
.theme-toggle {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    transform: rotate(15deg);
}

.sun-icon {
    display: block;
}

.moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

/* ============================================================================
   Navbar & Header
   ============================================================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease;
}

/* Glass effect support */
@supports (backdrop-filter: blur(10px)) {
    .navbar {
        background: color-mix(in srgb, var(--bg-primary) 80%, transparent);
        backdrop-filter: blur(12px);
    }
}

.navbar-container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 clamp(1rem, 5vw, 2rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.logo {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.brand-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 1;
}

.logo-subtitle {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.divider {
    width: 1px;
    height: 24px;
    background-color: var(--border-color);
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn {
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    border: none;
    text-decoration: none;
    display: inline-block;
}

.btn-login {
    background: transparent;
    color: var(--text-secondary);
}

.btn-login:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.btn-register {
    background: var(--gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-register:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    opacity: 0.95;
}

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

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border-color: var(--error);
}

/* ============================================================================
   Hamburger Menu & Mobile
   ============================================================================ */
.hamburger-menu {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.hamburger-menu:hover {
    background: var(--bg-secondary);
}



.mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 999;
}

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

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-login-mobile,
.btn-register-mobile, 
.btn-logout-mobile {
    width: 100%;
    padding: 0.75rem;
    text-align: center;
    border-radius: 0.5rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

.btn-register-mobile {
    background: var(--gradient);
    color: white;
}

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

@media (max-width: 768px) {
    :root {
        --navbar-height: 70px;
    }
    .desktop-only {
        display: none !important;
    }
    .hamburger-menu {
        display: block;
    }
}
