@import './variables.css';
@import './typography.css';

:root {
    --header-height: 64px;
    --footer-height: 56px;
    --gutter: 16px;
    --nav-width: 260px;
    --sidebar-width: 320px;
    --bg: #E8EDEE;
    --ink: #1d2939;
    --muted: #98a2b3;
    --border: #e5e7eb;
    --brand: #0ea5e9;
}
* {
    box-sizing: border-box;
}

html {
    font-size: 18px;
}

html,
body {
    height: 100%;
    margin: 0;
    color: var(--color-contrast);
    background: var(--bg);
    font-family: 'proxima-nova', sans-serif;
}

body {
    max-width: 1500px;
    margin: 0 auto;
}

/* Fixed header */
header {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 40;
}

h1 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand .logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: linear-gradient(135deg, #38bdf8, #3b82f6);
}

/* Fixed footer */
footer {
    position: fixed;
    inset: auto 0 0 0;
    height: var(--footer-height);
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 30;
    font-size: 13px;
    color: var(--muted);
}
footer a {
    color: inherit;
    text-decoration: none;
}
footer a:hover {
    color: var(--ink);
    text-decoration: underline;
}
.footer-left,
.footer-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* Live area layout */
.shell {
    padding-top: var(--header-height);
    padding-bottom: var(--footer-height);
}
.live {
    /* height: calc(100vh - var(--header-height) - var(--footer-height)); */
    padding: var(--gutter);
}
.grid {
    height: 100%;
    display: grid;
    /* grid-template-columns: var(--nav-width) 1fr var(--sidebar-width); */
    grid-template-columns: var(--nav-width) 1fr;
    gap: var(--gutter);
}

/* Left Navigation */

/* Stage */
.stage-wrap {
    min-width: 0;
}
.stage-return {
    display: flex;
    justify-content: flex-end;
}
.stage-return[hidden] {
    display: none;
}
.back-to-admin {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-contrast);
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}
.back-to-admin svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}
.stage-wrap {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px;
    /* Make sure the scrollable stage leaves room for the fixed footer
        so buttons or actions at the bottom aren't covered. */
    padding-bottom: calc(var(--footer-height) + 18px);
    /* Helpful for scroll-to behavior so focused elements land above footer */
    scroll-padding-bottom: calc(var(--footer-height) + 8px);
}
.stage {
    height: 100%;
    overflow: auto;
}
.stage h2 {
    margin: 0 0 8px 0;
    font-size: 18px;
}
.stage .hint {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 16px;
}
.panel.active {
    display: block;
}

/* Right Sidebar */
aside {
    position: relative;
}
.aside-inner {
    position: sticky;
    top: calc(var(--header-height) + var(--gutter));
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
}
.card h3 {
    margin: 0 0 8px 0;
    font-size: 15px;
}
.card p {
    margin: 0 0 12px 0;
    color: var(--muted);
}
.card .cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    background: #fff;
}
.card .cta.primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}


/* Responsiveness */
@media (max-width: 1400px) {
    :root {
        --sidebar-width: 220px;
    }
}
@media (max-width: 1240px) {
    .grid {
        grid-template-columns: var(--nav-width) 1fr;
    }
    aside {
        display: none;
    }
}
@media (max-width: 720px) {
    :root {
        --nav-width: 220px;
    }
    .grid {
        grid-template-columns: 1fr;
    }
    nav {
        order: -1;
    }
    .nav-inner {
        top: calc(var(--header-height) + 8px);
    }
}
