
/* =========================================
   BIRTHDAY STUDIO v2.0
   DASHBOARD FOUNDATION
   Version: 2.0.0-dev.1
========================================= */


/* =========================================
   1. DESIGN TOKENS
========================================= */

:root {

    color-scheme: dark;

    --bg-primary: #11131b;
    --bg-secondary: #181b25;
    --bg-card: #20232f;
    --bg-hover: #292d3b;

    --text-primary: #f5f5fa;
    --text-secondary: #a9adbd;
    --text-muted: #83889b;

    --accent: #8263df;
    --accent-hover: #9377ed;
    --accent-soft: rgba(130, 99, 223, 0.14);

    --border: #333747;

    --success: #4cc38a;
    --warning: #e5ae56;
    --danger: #ef7272;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --shadow: 0 8px 30px rgba(0, 0, 0, 0.16);

    --transition: 180ms ease;

    --sidebar-width: 240px;
    --header-height: 68px;
    --bottom-nav-height: 68px;

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    --font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

}


/* =========================================
   2. LIGHT THEME
========================================= */

:root[data-theme="light"] {

    color-scheme: light;

    --bg-primary: #f5f6fa;
    --bg-secondary: #eef0f6;
    --bg-card: #ffffff;
    --bg-hover: #f0edf9;

    --text-primary: #222432;
    --text-secondary: #626779;
    --text-muted: #73798b;

    --accent: #7354cc;
    --accent-hover: #6245b8;
    --accent-soft: rgba(115, 84, 204, 0.10);

    --border: #e1e3eb;

    --success: #25885a;
    --warning: #986416;
    --danger: #c74141;

    --shadow: 0 8px 30px rgba(30, 35, 60, 0.08);

}


/* =========================================
   3. GLOBAL RESET
========================================= */

*,
*::before,
*::after {

    box-sizing: border-box;

}

html {

    margin: 0;
    padding: 0;

    min-height: 100%;

    -webkit-text-size-adjust: 100%;

}

body {

    margin: 0;
    padding: 0;

    min-height: 100vh;
    min-height: 100dvh;

    font-family: var(--font-family);

    background: var(--bg-primary);
    color: var(--text-primary);

    line-height: 1.5;

    -webkit-font-smoothing: antialiased;

}

button,
input,
select,
textarea {

    font: inherit;

}

button,
a {

    -webkit-tap-highlight-color: transparent;

}

button {

    cursor: pointer;

}

button:disabled {

    opacity: 0.5;
    cursor: not-allowed;

}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {

    outline: 2px solid var(--accent);
    outline-offset: 4px;

}

img,
svg {

    max-width: 100%;

}

h1,
h2,
h3,
p {

    margin: 0;

}

a {

    color: var(--accent);
    text-decoration: none;

}

[hidden] {

    display: none !important;

}


/* =========================================
   4. APPLICATION ROOT
========================================= */

#app {

    width: 100%;

    min-height: 100vh;
    min-height: 100dvh;

}


/* =========================================
   5. LOADING SCREEN
========================================= */

#loadingScreen {

    min-height: 100vh;
    min-height: 100dvh;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 16px;

    padding: 28px;

    text-align: center;

    background:

        radial-gradient(
            ellipse at 50% 35%,
            var(--accent-soft),
            transparent 65%
        ),

        var(--bg-primary);

}

.brand-logo {

    width: 80px;
    height: 80px;

    display: grid;
    place-items: center;

    border-radius: 24px;

    background: var(--accent);

    font-size: 38px;

    box-shadow:
        0 10px 35px rgba(130, 99, 223, 0.25);

    animation: logo-enter 600ms ease both;

}

#loadingScreen h1 {

    font-size: clamp(28px, 7vw, 40px);

    font-weight: 750;

    letter-spacing: -1px;

}

.tagline {

    color: var(--text-secondary);

    font-size: 13px;

    letter-spacing: 1px;

}

.loading-indicator {

    width: min(200px, 80vw);
    height: 4px;

    margin-top: 18px;

    background: var(--border);

    border-radius: 100px;

    overflow: hidden;

}

.loading-indicator span {

    display: block;

    width: 40%;
    height: 100%;

    background: var(--accent);

    border-radius: 100px;

    animation: loading-slide 1.3s ease-in-out infinite;

}

#loadingStatus {

    font-size: 13px;

    color: var(--text-muted);

}

.version {

    margin-top: 18px;

    font-size: 11px;

    color: var(--text-muted);

}


/* =========================================
   6. ERROR SCREEN
========================================= */

#errorScreen {

    min-height: 100vh;
    min-height: 100dvh;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 18px;

    padding: 28px;

    text-align: center;

}

#errorScreen h2 {

    font-size: 24px;

}

#errorMessage {

    max-width: 420px;

    color: var(--text-secondary);

}

#retryButton {

    min-height: 46px;

    padding: 12px 24px;

    border: none;
    border-radius: var(--radius-md);

    background: var(--accent);

    color: #ffffff;

    font-weight: 600;

}


/* =========================================
   7. DASHBOARD SHELL
========================================= */

#dashboardRoot {

    min-height: 100vh;
    min-height: 100dvh;

}

.dashboard-shell {

    min-height: 100vh;
    min-height: 100dvh;

}

.dashboard-header {

    position: sticky;
    top: 0;

    z-index: 20;

    min-height: calc(
        var(--header-height) + var(--safe-top)
    );

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;

    padding:
        calc(12px + var(--safe-top))
        18px
        12px;

    background: var(--bg-primary);

    border-bottom: 1px solid var(--border);

}

.dashboard-brand {

    display: flex;
    align-items: center;

    gap: 12px;

    min-width: 0;

}

.dashboard-brand-icon {

    flex-shrink: 0;

    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    border-radius: var(--radius-md);

    background: var(--accent);

    font-size: 21px;

}

.dashboard-brand h1 {

    font-size: 18px;
    font-weight: 700;

}

.dashboard-brand p {

    font-size: 11px;
    color: var(--text-muted);

}

.header-actions {

    display: flex;
    align-items: center;

    gap: 8px;

}


/* =========================================
   8. MAIN CONTENT
========================================= */

.dashboard-main {

    width: 100%;

    max-width: 1200px;

    margin: 0 auto;

    padding:
        24px
        18px
        calc(
            var(--bottom-nav-height)
            + var(--safe-bottom)
            + 24px
        );

}

.page-heading {

    margin-bottom: 24px;

}

.page-heading h2 {

    font-size: clamp(24px, 5vw, 32px);

    font-weight: 700;

    letter-spacing: -0.6px;

}

.page-heading p {

    margin-top: 6px;

    color: var(--text-secondary);

    font-size: 14px;

}

.section-heading {

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin: 28px 0 14px;

}

.section-heading h3 {

    font-size: 17px;
    font-weight: 650;

}


/* =========================================
   9. CARDS
========================================= */

.card {

    min-width: 0;

    padding: 18px;

    background: var(--bg-card);

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

}

.create-project-card {

    width: 100%;

    padding: 24px;

    border: 0;

    border-radius: var(--radius-lg);

    background: linear-gradient(
        135deg,
        #8263df,
        #6548bb
    );

    color: #ffffff;

    text-align: left;

    box-shadow:
        0 8px 24px rgba(130, 99, 223, 0.18);

    transition:
        transform var(--transition),
        filter var(--transition);

}

.create-project-card:active {

    transform: scale(0.98);

}

.create-project-icon {

    display: block;

    font-size: 30px;

    margin-bottom: 14px;

}

.create-project-card h3 {

    font-size: 20px;

}

.create-project-card p {

    margin-top: 6px;

    font-size: 13px;

    color: rgba(255, 255, 255, 0.86);

}


/* =========================================
   10. STATISTICS
========================================= */

.stats-grid {

    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 10px;

    margin-top: 20px;

}

.stat-card {

    padding: 15px 12px;

}

.stat-value {

    display: block;

    font-size: clamp(21px, 6vw, 30px);

    font-weight: 700;

}

.stat-label {

    display: block;

    margin-top: 4px;

    font-size: 12px;

    color: var(--text-muted);

    overflow-wrap: anywhere;

}


/* =========================================
   11. EMPTY STATE
========================================= */

.empty-state {

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 12px;

    min-height: 200px;

    padding: 28px 18px;

    text-align: center;

}

.empty-state-icon {

    font-size: 38px;

    opacity: 0.8;

}

.empty-state h3 {

    font-size: 16px;

}

.empty-state p {

    max-width: 300px;

    font-size: 13px;

    color: var(--text-muted);

}


/* =========================================
   12. BUTTON COMPONENTS
========================================= */

.btn {

    min-height: 44px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 11px 18px;

    border-radius: var(--radius-md);

    font-size: 13px;
    font-weight: 600;

    transition:
        background var(--transition),
        transform var(--transition);

}

.btn:active {

    transform: scale(0.97);

}

.btn-primary {

    border: 1px solid transparent;

    background: var(--accent);

    color: #ffffff;

}

.btn-secondary {

    border: 1px solid var(--border);

    background: var(--bg-card);

    color: var(--text-primary);

}

.icon-button {

    width: 44px;
    height: 44px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    border: 1px solid var(--border);

    border-radius: var(--radius-md);

    background: var(--bg-card);

    color: var(--text-primary);

    font-size: 18px;

}


/* =========================================
   13. STORAGE INDICATOR
========================================= */

.storage-heading {

    display: flex;
    align-items: center;
    justify-content: space-between;

    flex-wrap: wrap;

    gap: 10px;

}

.storage-heading h3 {

    font-size: 14px;

}

.storage-usage {

    font-size: 12px;

    color: var(--text-muted);

}

.progress-track {

    width: 100%;
    height: 7px;

    margin-top: 14px;

    background: var(--border);

    border-radius: 100px;

    overflow: hidden;

}

.progress-fill {

    height: 100%;

    width: 0%;

    background: var(--accent);

    border-radius: 100px;

    transition: width 300ms ease;

}

.storage-caption {

    margin-top: 10px;

    color: var(--text-muted);

    font-size: 12px;

}


/* =========================================
   14. MOBILE NAVIGATION
========================================= */

.bottom-navigation {

    position: fixed;

    left: 0;
    right: 0;
    bottom: 0;

    z-index: 30;

    display: flex;
    align-items: center;
    justify-content: space-around;

    min-height: calc(
        var(--bottom-nav-height)
        + var(--safe-bottom)
    );

    padding:
        8px
        8px
        calc(8px + var(--safe-bottom));

    background: var(--bg-secondary);

    border-top: 1px solid var(--border);

}

.nav-item {

    min-width: 60px;
    min-height: 44px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 4px;

    padding: 6px 8px;

    border: none;

    border-radius: var(--radius-sm);

    background: transparent;

    color: var(--text-muted);

    font-size: 11px;

}

.nav-icon {

    font-size: 19px;

    line-height: 1.2;

}

.nav-item.active {

    color: var(--accent);

    background: var(--accent-soft);

}


/* =========================================
   15. DESKTOP SIDEBAR
========================================= */

.desktop-sidebar {

    display: none;

}


/* =========================================
   16. DESKTOP RESPONSIVE LAYOUT
========================================= */

@media (min-width: 900px) {

    .desktop-sidebar {

        position: fixed;

        top: 0;
        left: 0;
        bottom: 0;

        z-index: 30;

        width: var(--sidebar-width);

        display: flex;
        flex-direction: column;

        gap: 24px;

        padding: 22px 16px;

        background: var(--bg-secondary);

        border-right: 1px solid var(--border);

    }

    .desktop-sidebar .nav-item {

        flex-direction: row;

        justify-content: flex-start;

        gap: 12px;

        padding: 12px;

        font-size: 13px;

    }

    .dashboard-header {

        margin-left: var(--sidebar-width);

        padding: 14px 30px;

    }

    .dashboard-main {

        width: calc(
            100% - var(--sidebar-width)
        );

        margin-left: var(--sidebar-width);

        padding: 32px;

    }

    .bottom-navigation {

        display: none;

    }

    .stats-grid {

        gap: 18px;

    }

    .stat-card {

        padding: 22px;

    }

}


/* =========================================
   17. SMALL MOBILE SCREENS
========================================= */

@media (max-width: 360px) {

    .dashboard-main {

        padding-left: 12px;
        padding-right: 12px;

    }

    .dashboard-header {

        padding-left: 12px;
        padding-right: 12px;

    }

    .dashboard-brand h1 {

        font-size: 16px;

    }

    .stats-grid {

        gap: 6px;

    }

    .stat-card {

        padding: 12px 8px;

    }

    .nav-item {

        min-width: 52px;

    }

}


/* =========================================
   18. ANIMATIONS
========================================= */

@keyframes logo-enter {

    from {

        opacity: 0;

        transform: translateY(12px) scale(0.92);

    }

    to {

        opacity: 1;

        transform: translateY(0) scale(1);

    }

}

@keyframes loading-slide {

    from {

        transform: translateX(-110%);

    }

    to {

        transform: translateX(360%);

    }

}


/* =========================================
   19. REDUCED MOTION
========================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {

        animation-duration: 0.01ms !important;

        animation-iteration-count: 1 !important;

        transition-duration: 0.01ms !important;

        scroll-behavior: auto !important;

    }

}
