/* =========================================
   1. RESET & BASE
   ========================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family-base);
    background: var(--color-bg);
    color: var(--color-text-primary);
    line-height: var(--line-height-base);
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}




/* =========================================
   2. VARIABLES (THEME TOKENS)
   ========================================= */

:root {
    /* Colors */
    --gray-100: #f3f4f6;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-800: #1f2937;
    --brand-500: #6366f1;
    --brand-700: #4f46e5;
    --color-bg: #0F172A;
    --color-surface: #1E293B;
    --color-foreground: var(--gray-800);
    --color-text-primary: #F1F5F9;
    --color-text-secondary: #94A3B8;
    --color-muted: var(--gray-500);
    --color-accent: #38BDF8;
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    --color-highlight: #A78BFA;
    /* Spacing */
    --space-0: 0;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    /* Typography */
    --font-family-base: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial;
    --font-size-sm: 13px;
    --font-size-base: 16px;
    --font-size-lg: 20px;
    --line-height-base: 1.5;
    --font-weight-regular: 400;
    --font-weight-bold: 700;
    /* Borders & Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --border-1: 1px solid rgba(0,0,0,0.06);
    /* Shadows */
    --shadow-1: 0 1px 3px rgba(2,6,23,0.06);
    --shadow-2: 0 6px 18px rgba(2,6,23,0.12);
    /* Motion */
    --duration-fast: 120ms;
    --duration-base: 200ms;
    --ease-default: cubic-bezier(.2,.8,.2,1);
    /* Z-index */
    --z-dropdown: 1000;
    --z-modal: 1100;
    /* Component-specific */
    --nav-height: 3.5em;
    --footer-height: 2em;
}

/* =========================================
   3. UTILITIES (YOUR OWN)
   ========================================= */

.u-shadow-soft {
    box-shadow: var(--shadow-1);
}

.u-rounded-sm {
    border-radius: var(--radius-sm);
}

.u-rounded-md {
    border-radius: var(--radius-md);
}

.u-text-muted {
    color: var(--color-muted);
}

.u-hidden {
    display: none !important;
}
.u-border-none {
    border: none;
    outline: none;
    background: none;
    cursor: pointer;
}

/* =========================================
   4. LAYOUT
   ========================================= */

.layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.layout__main {
    flex: 1;
}

/* =========================================
   5. NAVIGATION (SITE-NAV)
   ========================================= */

.site-nav {
    background-color: var(--color-surface);
    color: var(--color-text-primary);
    height: var(--nav-height);
    display: flex;
    align-items: center;
    box-shadow: 0 1px 0 rgba(0,0,0,0.1);
}

.site-nav--sticky {
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-nav__inner {
    width: 100%;
    padding: 0 var(--space-4);
    display: flex;
    justify-content: left;
    align-items: center;
}

.site-nav__brand {
    color: var(--color-text-primary);
    text-decoration: none;
    font-weight: var(--font-weight-bold);
    margin-right: var(--space-4);
}

.site-nav__logout {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
}
.site-nav__logout:focus-visible {
    outline: 2px solid #0078ff; /* Custom focus ring */
    outline-offset: 2px;
}
.site-nav__link {
    color: var(--color-text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    position: relative;
    transition: color 0.25s ease;
}

    /* Underline hover effect */
    .site-nav__link::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: -2px;
        width: 0;
        height: 2px;
        background: currentColor;
        transition: width 0.25s ease;
    }

    .site-nav__link:hover,
    .site-nav__link:focus-visible {
        color: var(--color-accent, #4a7aff);
    }

        .site-nav__link:hover::after,
        .site-nav__link:focus-visible::after {
            width: 100%;
        }

/* Optional: active state */
.site-nav__link--active {
    color: var(--color-accent, #4a7aff);
}

    .site-nav__link--active::after {
        width: 100%;
    }

.site-nav__toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
}
    .site-nav__toggle span {
        width: 24px;
        height: 3px;
        background: var(--color-text-primary);
        border-radius: 2px;
    }
.site-nav__items {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding-top: 1rem;
}

    /* When open */
    .site-nav__items.open {
        display: flex;
    }
/* =========================================
   6. FOOTER
   ========================================= */

.site-footer {
    height: var(--footer-height);
    margin-top: auto;
    width: 100%;
    background: var(--gray-800);
    color: var(--color-muted);
    padding: 5px ;
    z-index: 1000; /* keeps it above content */
}

.site-footer__inner {
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.site-footer__link {
    color: var(--color-muted);
    text-decoration: none;
    margin-left: var(--space-3);
}

/* =========================================
   7. CARDS
   ========================================= */

.card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    box-shadow: var(--shadow-1);
}

.card--flat {
    box-shadow: none;
}

.card--shadow {
    box-shadow: var(--shadow-2);
}

.card__title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-3);
}

.card__body {
}

/* =========================================
   8. BUTTONS
   ========================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    font-weight: var(--font-weight-bold);
}

.btn--primary {
    background: var(--color-accent);
    color: white;
}

.btn--secondary {
    background: var(--gray-300);
    color: var(--gray-800);
}

.btn--outline {
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    background: transparent;
}

/* =========================================
   9. FORMS
   ========================================= */

.form__group {
    margin-bottom: var(--space-4);
}

.form__label {
    display: block;
    margin-bottom: var(--space-1);
    font-weight: var(--font-weight-bold);
}

.form__input,
.form__textarea,
.form__select {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: var(--border-1);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
}

.form__input--invalid {
    border-color: var(--color-danger);
}

.form__error {
    color: var(--color-danger);
    font-size: var(--font-size-sm);
    margin-top: var(--space-1);
}


@media (min-width: 769px) {
    .site-nav__toggle {
        display: none;
    }

    .site-nav__items {
        display: flex !important;
        flex-direction: row;
        gap: 1rem;
        padding: 0;
    }
}

@media (max-width: 768px) {
    .site-nav__toggle {
        display: flex;
    }

    .site-nav__items div {
        padding: 0.5rem 0;
    }
}