@import url("./nav.css");
@import url("./footer.css");

/* =========================================================
   THEME VARIABLES
   Light theme = Blue ice
   Dark theme = Forest green
   ========================================================= */

:root {
    --page-bg: linear-gradient(180deg, #23c6c8 0%, #39b7cf 50%, #35a8d8 100%);
    --nav-bg: rgba(230, 248, 248, 0.78);
    --footer-bg: rgba(230, 248, 248, 0.55);

    /* make white containers transparent */
    --card-bg: rgba(255, 255, 255, 0.82);
    --panel-bg: rgba(255, 255, 255, 0.72);
    --input-bg: rgba(255, 255, 255, 0.88);
    --input-text: #1f3b63;
    --input-placeholder: #7a8da8;

    --text-main: #1f3b63;
    --text-muted: #60738f;
    --text-light: #ffffff;

    --border-soft: rgba(31, 59, 99, 0.12);
    --border-light: rgba(255, 255, 255, 0.45);

    --button-main: #39FF8F;
    --button-main-hover: #28db76;

    --danger-main: #d94b3d;
    --danger-hover: #b83c31;

    --success-main: #39FF8F;
    --success-hover: #28db76;

    --shadow-card: 0 18px 45px rgba(0, 0, 0, 0.10);
    --shadow-nav: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Dark forest theme */
:root[data-theme="forest"] {
    --page-bg: linear-gradient(
        180deg,
        #1a1333 0%,
        #2a1f5e 25%,
        #2f3fa8 38%,
        #3a6fb0 44%,
        #6fd3b0 58%,
        #3a6fb0 72%,
        #2f3fa8 88%,
        #4a2f7a 100%
    );

    --nav-bg: rgba(70, 55, 130, 0.55);
    --footer-bg: rgba(70, 55, 130, 0.22);

    /* Main containers */
    --card-bg: rgba(95, 75, 165, 0.34);

    /* Inner panels, table rows, leaderboard rows, etc. */
    --panel-bg: rgba(65, 53, 178, 0.34);

    --input-bg: rgba(244, 248, 241, 0.92);
    --input-text: #1f3b63;
    --input-placeholder: #6f7f96;

    --text-main: #f5f0ff;
    --text-muted: #d8d0ff;
    --text-light: #ffffff;

    --border-soft: rgba(255, 255, 255, 0.22);
    --border-light: rgba(255, 255, 255, 0.18);

    --button-main: #ff7ad9;
    --button-main-hover: #e85ec4;

    --danger-main: #ff6b8a;
    --danger-hover: #e05572;

    --success-main: #7ef0ff;
    --success-hover: #4dd9e8;

    --shadow-card: 0 18px 45px rgba(20, 10, 60, 0.25);
    --shadow-nav: 0 8px 24px rgba(20, 10, 60, 0.22);
}

/* Forest theme glass effect */
:root[data-theme="forest"] .content-box,
:root[data-theme="forest"] .admin-card,
:root[data-theme="forest"] .auth-card,
:root[data-theme="forest"] .site-footer {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}


/* =========================================================
   GLOBAL RESET
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html,
body {
    min-height: 100%;
}

body {
    min-height: 100vh;
    color: var(--text-main);
    transition:
        background 0.25s ease,
        color 0.25s ease;
}

button {
    cursor: pointer;
}


/* =========================================================
   PAGE BACKGROUNDS
   ========================================================= */

body.dashboard-page,
body.admin-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--page-bg);
    color: var(--text-main);
}


/* =========================================================
   STICKY FOOTER LAYOUT
   Footer stays at bottom on short pages
   ========================================================= */

body.dashboard-page > main,
body.admin-page > main {
    flex: 1;
    width: 100%;
    align-self: stretch;
}

#site-nav,
#site-footer {
    width: 100%;
    flex-shrink: 0;
}

#site-footer {
    margin-top: auto;
}


/* =========================================================
   COMMON ELEMENT DEFAULTS
   ========================================================= */

a {
    color: inherit;
}

img {
    max-width: 100%;
}

input,
textarea,
select,
button {
    font: inherit;
}

input,
textarea,
select {
    color: var(--input-text);
}

input::placeholder,
textarea::placeholder {
    color: var(--input-placeholder);
}


/* =========================================================
   ACCESSIBILITY HELPERS
   ========================================================= */

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(31, 79, 138, 0.35);
    outline-offset: 3px;
}

:root[data-theme="forest"] button:focus-visible,
:root[data-theme="forest"] a:focus-visible,
:root[data-theme="forest"] input:focus-visible,
:root[data-theme="forest"] textarea:focus-visible,
:root[data-theme="forest"] select:focus-visible {
    outline: 3px solid rgba(47, 107, 69, 0.35);
}


/* =========================================================
   UTILITIES
   ========================================================= */

.hidden {
    display: none !important;
}

/* =========================================================
   PAGE BACK LINK
   ========================================================= */

.page-back-wrap {
    width: 100%;
    max-width: 760px;
    margin: 0 auto 16px;
}

.page-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 10px 14px;
    border-radius: 999px;

    background: rgba(255, 255, 255, 0.88);
    color: var(--text-main);

    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;

    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.page-back-link:hover {
    transform: translateY(-1px);
    background: var(--card-bg);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.page-back-link:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 79, 138, 0.18);
}

@media (max-width: 600px) {
    .page-back-wrap {
        padding: 0 12px;
        margin-bottom: 12px;
    }

    .page-back-link {
        font-size: 0.9rem;
        padding: 9px 12px;
    }
}