/* =========================================================
   BASE / RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;

    --green: #22c55e;
    --orange: #f97316;
    --yellow: #facc15;
    --red: #ef4444;
    --purple: #8b5cf6;

    --background: #f5f7fb;
    --card: #ffffff;

    --border: #e5e7eb;

    --text: #111827;
    --text-light: #6b7280;

    --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);

    --radius: 18px;
}

body.dark {
    --background: #101827;
    --card: #1d2433;
    --border: #303c53;

    --text: #f9fafb;
    --text-light: #a5b4c8;

    --shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

body {
    font-family: "Inter", sans-serif;
    background: var(--background);
    color: var(--text);

    min-height: 100vh;

    transition:
        background 0.25s ease,
        color 0.25s ease;
}

/* =========================================================
   HEADER
========================================================= */

.header {
    width: min(1480px, calc(100% - 48px));

    margin: 0 auto;

    padding: 24px 0 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}

.header h1 {
    display: flex;
    align-items: center;
    gap: 12px;

    font-size: 1.65rem;
    font-weight: 700;

    line-height: 1.2;
}

.header h1 i {
    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: linear-gradient(
        135deg,
        #4f7df3,
        #6366f1
    );

    color: white;

    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.25);
}

.header p {
    margin-top: 5px;
    margin-left: 56px;

    color: var(--text-light);

    font-size: 0.9rem;
}

/* =========================================================
   THEME BUTTON
========================================================= */

.iconButton {
    width: 46px;
    height: 46px;

    border: 1px solid var(--border);
    border-radius: 13px;

    background: var(--card);
    color: var(--text);

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    font-size: 17px;

    box-shadow: var(--shadow);

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
}

.iconButton:hover {
    transform: translateY(-2px);

    background: var(--primary);
    color: white;
}

/* =========================================================
   MAIN CONTAINER
========================================================= */

main {
    width: 100%;
}

.container {
    width: min(1480px, calc(100% - 48px));

    margin: 0 auto;

    padding-bottom: 50px;
}

/* =========================================================
   SECTION TITLES
========================================================= */

section > h2 {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 16px;

    font-size: 1rem;
    font-weight: 700;
}

section > h2 i {
    color: var(--primary);
    font-size: 15px;
}

/* =========================================================
   DIVIDERS
========================================================= */

.sectionDivider {
    display: none;
}

/* =========================================================
   GENERAL CARDS
========================================================= */

.statCard,
.dashboardCard,
.calendarContainer,
.weeklyChart,
.empty,
.favoriteCard,
.activityRow,
.achievementCard {
    background: var(--card);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

/* =========================================================
   BUTTONS
========================================================= */

button,
input,
select {
    font-family: inherit;
}

button {
    cursor: pointer;
}

button:focus,
input:focus,
select:focus {
    outline: none;
}

/* =========================================================
   EMPTY STATES
========================================================= */

.empty {
    padding: 32px 20px;

    text-align: center;

    color: var(--text-light);
}

.empty i {
    display: block;

    margin-bottom: 10px;

    font-size: 28px;

    color: #b7c0d0;
}

.empty p {
    line-height: 1.5;
}

/* =========================================================
   FOOTER
========================================================= */

footer {
    width: min(1480px, calc(100% - 48px));

    margin: 30px auto 0;

    padding: 20px 0;

    border-top: 1px solid var(--border);

    color: var(--text-light);

    font-size: 0.8rem;
}

footer p + p {
    margin-top: 4px;
}

/* =========================================================
   FLOATING BUTTON
========================================================= */

.floatingButton {
    position: fixed;

    right: 22px;
    bottom: 22px;

    width: 44px;
    height: 44px;

    border: none;
    border-radius: 50%;

    background: var(--primary);
    color: white;

    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 1000;
}

/* =========================================================
   LOADING SCREEN
   Keep CSS harmless in case old HTML still has it.
========================================================= */

.loadingScreen {
    display: none !important;
}

/* =========================================================
   RESPONSIVE BASE
========================================================= */

@media (max-width: 900px) {

    .header {
        width: calc(100% - 30px);

        padding-top: 18px;
    }

    .container {
        width: calc(100% - 30px);
    }

}

@media (max-width: 600px) {

    .header {
        width: calc(100% - 24px);
    }

    .container {
        width: calc(100% - 24px);
    }

    .header h1 {
        font-size: 1.35rem;
    }

    .header h1 i {
        width: 38px;
        height: 38px;

        font-size: 14px;
    }

    .header p {
        margin-left: 50px;
        font-size: 0.8rem;
    }

    .iconButton {
        width: 42px;
        height: 42px;
    }

}
/* =========================================================
   SETTINGS / CUSTOM UI BACKGROUND
========================================================= */

body.settings-open {
    overflow: hidden;
}

body.custom-background {
    background-repeat: no-repeat;
}
