/* ============================================
   Global Styles — "The Digital Atelier"
   ============================================ */

* {
    margin: 0;
    padding: 0;
    font-family: var(--font-body, 'Manrope'), sans-serif;
    outline: none;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Fundação do app: altura total + superfície escura ===
   Sem isso o body fica branco e os layouts com min-height:100% colapsam. */
html, body {
    height: 100%;
}

body {
    background: var(--surface);
    color: var(--on-surface);
}

#root {
    height: 100%;
}

/* === Scrollbar Styling === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--surface-container-highest); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--outline-variant); }

/* === Selection === */
::selection {
    background: rgba(167, 139, 250, 0.3);
    color: var(--on-surface);
}

/* === Material Symbols === */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

/* === Layout Utilities === */
.o-scroll { overflow: scroll; }
.o-auto { overflow: auto; }
.of-auto { overflow: auto; }
.d-flex { display: flex; }
.d-grid { display: grid; }
.grid-2-col { grid-template-columns: repeat(2, 1fr); }
.gap-g { gap: 1em; }
.gap-m { gap: .5em; }
.gap-p { gap: .2em; }

.a-center,
.ai-center,
.centro { align-items: center; }
.a-end { align-items: end; }
.ac-center { align-content: center; }
.ac-between { align-content: space-between; }
.ac-start { align-content: start; }
.jc-center { justify-content: center; }
.jc-evenly { justify-content: space-evenly; }
.jc-between { justify-content: space-between; }
.row-mc { grid-template-rows: min-content; }
.ta-center { text-align: center; }
.ta-right { text-align: right; }
.w-80 { width: 80%; }
.h-100 { height: 100%; }
.w-100 { width: 100%; }
.max-h-80 { max-height: 80vh; }
.bottom-fixed { position: fixed; bottom: 0; }

/* === Typography Utilities === */
.font-headline { font-family: var(--font-headline); }
.font-body { font-family: var(--font-body); }
.font-label { font-family: var(--font-label); }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.05rem; }

/* === Spacing === */
button, .p-10 { padding: 10px; }
.p-l { padding: 1em; }
.p-m { padding: .5em; }
.p-s { padding: .2em; }
.pl-1 { padding-left: 1em; }

/* === Glass & Gradient Utilities === */
.glass-effect {
    background: rgba(19, 19, 19, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.gold-gradient {
    background: var(--gold-gradient);
}

/* === Headings (hierarquia editorial) === */
h1, h2, h3, h4 {
    font-family: var(--font-headline);
    color: var(--on-surface);
    letter-spacing: -0.01em;
}

h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.4rem; font-weight: 700; line-height: 1.25; }
h3 { font-size: 1.1rem; font-weight: 600; line-height: 1.3; }
h4 { font-size: 0.95rem; font-weight: 600; line-height: 1.35; }

/* === Base Elements === */
button {
    background-color: var(--surface-container-high);
    color: var(--on-surface);
    font-size: 16px;
    font-weight: 600;
    border: 1px solid rgba(167, 139, 250, 0.08);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease, background-color 0.2s ease;
}

button:hover { opacity: 0.9; border-color: rgba(167, 139, 250, 0.25); }
button:active { transform: scale(0.97); }
button:focus-visible {
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.35);
}

button.inner {
    background: var(--surface-container-highest) !important;
    color: inherit;
    padding: .3rem;
    display: grid;
    border-radius: 0.375rem;
}

button.inner svg { width: 25px; }

input,
select {
    background-color: var(--surface-container-high);
    color: var(--on-surface);
    border: 1px solid var(--outline-variant);
    padding: 12px 14px;
    font-size: 14px;
    border-radius: 0.625rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input:hover,
select:hover {
    border-color: var(--outline);
}

input:focus,
select:focus {
    border-color: var(--primary);
    background-color: var(--surface-container-highest);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.22);
}

input::placeholder,
select::placeholder {
    color: var(--outline);
    opacity: 0.5;
}

input.error,
select.error {
    border: 1px solid var(--error);
    background-color: rgba(147, 0, 10, 0.15);
}

/* === Icon === */
.icon {
    width: 100%;
    height: 100%;
}

.icon-size {
    width: 25px;
    height: 25px;
}

.pointer { cursor: pointer; }

/* === Card (Global) === */
.card {
    background-color: var(--surface-container-high);
    padding: 1rem;
    border-radius: 0.875rem;
    border: 1px solid rgba(167, 139, 250, 0.09);
    box-shadow: 0 4px 16px rgba(3, 2, 12, 0.35);
    align-content: baseline;
}

/* === Status Tags (admin lists) === */
.tag-success,
.tag-warning,
.tag-danger {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 2rem;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-label);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.tag-success {
    background: rgba(52, 211, 153, 0.14);
    color: #6ee7b7;
    border: 1px solid rgba(52, 211, 153, 0.35);
}

.tag-warning {
    background: rgba(251, 191, 36, 0.12);
    color: #fcd34d;
    border: 1px solid rgba(251, 191, 36, 0.35);
}

.tag-danger {
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.35);
}

/* === Main Layout === */
main {
    background-color: var(--surface);
    color: var(--on-surface);
}

.main {
    height: calc(100vh - 2em);
    padding: 1em;
    grid-template-rows: min-content;
    background: var(--surface);
    color: var(--on-surface);
}

/* === Map === */
.map {
    height: 100%;
    width: 100%;
    border-radius: 0.75rem;
}

/* === Floating Action Button === */
.add {
    position: absolute;
    bottom: 2em;
    transform: translate(-50%, 0);
    left: 50%;
    border-radius: 50%;
    height: 80px;
    width: 80px;
    padding: 15px;
    background: var(--gold-gradient);
    color: #ffffff;
    box-shadow: 0 10px 40px rgba(167, 139, 250, 0.4);
}

@media (max-width: 992px) {
    .add {
        height: 17vw;
        width: 17vw;
    }
}

/* === Menu/Overlay === */
.menu-icon {
    width: 40px;
    display: grid;
    align-content: center;
}

.menu-background {
    position: absolute;
    top: 0;
    left: 0;
    padding: 1em;
    height: calc(100vh - 2em);
    width: calc(100vw - 2em);
    background-color: rgba(0, 0, 0, 0.4);
    z-index: -1;
    transition: .2s;
    opacity: 0;
}

.menu-background.show {
    z-index: 1;
    opacity: 1;
}

.menu {
    background-color: var(--surface-container-low);
    border-radius: 0.75rem;
    padding: .8em;
    height: calc(80% - 1.6em);
    transition: .5s;
    transform: translate(0, -100%);
}

.show .menu {
    transform: translate(0, 0);
}

/* === Calendar === */
.day {
    background-color: var(--primary);
    color: var(--on-primary);
    padding: .5em;
    border-radius: 0.375rem;
}

.week {
    grid-template-columns: repeat(7, 1fr);
}

/* === Object List === */
.object-list div,
.object-list label {
    background-color: var(--surface-container-high);
    padding: .5em;
    color: var(--on-surface);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.object-list div:hover,
.object-list label:hover {
    background-color: var(--surface-container-highest);
}

.object-list div.checked,
.object-list label.checked {
    background-color: var(--primary);
    color: var(--on-primary);
}

.object-list div.mainadapter {
    background-color: var(--surface-container);
    color: var(--on-surface);
}

.object-list p {
    padding: .5em 0 .5em .5em;
}

/* === Aux Button === */
button.aux {
    background: var(--gold-gradient) !important;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35);
}

/* === Modal Footer === */
.modal .footer {
    display: flex;
    gap: 1em;
}

form .footer button {
    width: 100%;
}

/* === Show State === */
.show {
    color: var(--on-surface);
    padding-left: 10px;
}

/* === State Components === */
.state-component {
    position: absolute;
    padding: 1em;
    width: calc(100% - 2em);
    display: grid;
    height: calc(100% - 2em);
    overflow: auto;
}


@media (max-width: 992px) {
    .state-component {
        width: 100%;
        height: 100%;
    }
}


.flex-state-component {
    display: flex;
    overflow: hidden;
    flex-direction: column;
    position: absolute;
    padding: 1em;
    width: calc(100% - 2em);
    height: calc(100% - 2em);
}
