/* global.css */

/* =======================================
   Color Palette and Root Variables
   ======================================= */
/* Color Palette:
- Main accent (turquoise): #20B2AA
- Lighter turquoise: #AFEEEE
- Darker turquoise: #008080
- White: #FFFFFF
- Relaxed white for dark: #F0F4F8
- Black: #000000
- Text secondary: #333333 (light), #CCCCCC (dark)
*/

:root {
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --text-primary: #05141c;
    --text-secondary: #333333;
    --accent-primary: #20B2AA;
    --accent-secondary: #008080;
    --border-color: #AFEEEE;
    --delete-red: #FF4444;
    --sidebar-height: 60px;
    --hover-bg: rgba(32, 178, 170, 0.1);
    --navbar-height: 80px;
    --navbar-height-shrunk: 60px;
    --navbar-sidebar-gap: 0px;
    --sidebar-padding-top: 10px;
    --main-padding-top: 20px;
    --ui-zoom: 0.75;
    --page-scrollbar-inset: 10px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #05141c;
        --bg-secondary: #1A1A1A;
        --text-primary: #F0F4F8;
        --text-secondary: #CCCCCC;
        --hover-bg: rgba(32, 178, 170, 0.2);
    }
}

/* =======================================
   Global Styles
   ======================================= */
html {
    zoom: var(--ui-zoom);
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: border-top-width 0.3s ease, background-color 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh / var(--ui-zoom));
    min-height: calc(100dvh / var(--ui-zoom));
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

a {
    text-decoration: none;
}

.privacy-consent-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: end center;
    padding: 24px;
    background: rgba(5,20,28,0.58);
    box-sizing: border-box;
    backdrop-filter: blur(5px);
}

.privacy-consent-backdrop[hidden],
.privacy-consent-summary[hidden],
.privacy-consent-customize[hidden],
.privacy-settings-button[hidden] {
    display: none;
}

.privacy-consent-card {
    width: min(1040px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 34px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.32);
}

.privacy-consent-summary,
.privacy-consent-customize {
    padding: 28px;
}

.privacy-consent-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px 20px;
    align-items: start;
}

.privacy-consent-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    color: #fff;
    background: var(--accent-primary);
    border-radius: 14px;
    font-size: 24px;
    font-weight: 700;
}

.privacy-consent h2 {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-size: 1.4rem;
}

.privacy-consent p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.privacy-consent-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.privacy-button,
.privacy-settings-button,
.privacy-close {
    font-family: inherit;
    cursor: pointer;
}

.privacy-button {
    min-height: 46px;
    padding: 10px 20px;
    border: 1px solid var(--accent-primary);
    border-radius: 999px;
    font-weight: 600;
}

.privacy-button-primary {
    color: #fff;
    background: var(--accent-primary);
}

.privacy-button-secondary {
    color: var(--accent-secondary);
    background: transparent;
}

.privacy-button:hover,
.privacy-button:focus-visible,
.privacy-settings-button:hover,
.privacy-settings-button:focus-visible {
    box-shadow: 0 0 0 3px rgba(32,178,170,0.22);
    outline: none;
}

.privacy-consent-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.privacy-close {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 28px;
    line-height: 1;
}

.privacy-choice-list {
    display: grid;
    gap: 10px;
    margin: 24px 0;
}

.privacy-choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
}

.privacy-choice span {
    display: grid;
    gap: 4px;
}

.privacy-choice small {
    color: var(--text-secondary);
}

.privacy-choice input {
    position: relative;
    flex: 0 0 auto;
    width: 50px;
    height: 28px;
    margin: 0;
    appearance: none;
    background: #8b969c;
    border: 2px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.privacy-choice input::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    content: '';
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.28);
    transition: transform 0.18s ease;
}

.privacy-choice input:checked {
    background: var(--accent-primary);
}

.privacy-choice input:checked::after {
    transform: translateX(22px);
}

.privacy-choice input:focus-visible {
    border-color: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(32,178,170,0.35);
    outline: none;
}

.privacy-choice input:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

.privacy-settings-button {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 9999;
    padding: 10px 15px;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    font-weight: 600;
}

@media (max-width: 700px) {
    /* Room at the end of each page so the floating "Privacy" and "?" buttons
       never cover the last content. */
    .main:not(.floorplan-main):not(.rd-main)::after,
    .main-profile::after {
        content: "";
        display: block;
        height: 72px;
    }

    .privacy-settings-button {
        left: 12px;
        bottom: 12px;
        padding: 7px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 640px) {
    .privacy-consent-backdrop {
        padding: 12px;
    }

    .privacy-consent-card {
        max-height: calc(100vh - 24px);
        border-radius: 26px;
    }

    .privacy-consent-summary,
    .privacy-consent-customize {
        padding: 20px;
    }

    .privacy-consent-summary {
        grid-template-columns: 1fr;
    }

    .privacy-consent-icon {
        display: none;
    }

    .privacy-consent-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .privacy-button {
        width: 100%;
    }
}

/* =======================================
   Main Content Styles
   ======================================= */
main {
    margin-top: 0;
    padding-top: var(--main-padding-top);
    padding-bottom: 40px;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    position: relative;
    z-index: auto;
    flex: 1 0 auto;
}

main .grid-container {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

main h1 {
    margin-bottom: 30px;
    font-size: 2em;
}


.marketing-page main h1 {
    font-size: 2.6em;
}

body:has(main) {
    border-top: var(--navbar-height) solid var(--bg-primary);
    border-bottom: var(--page-scrollbar-inset) solid var(--bg-primary);
}

body:not(.logged-in).shrunk:has(main) {
    border-top-width: var(--navbar-height-shrunk);
}

body.sidebar-open:has(main) {
    border-top-width: calc(var(--navbar-height) + var(--sidebar-height));
}

body:not(.logged-in).shrunk.sidebar-open:has(main),
body.logged-in.sidebar-open:has(main) {
    border-top-width: calc(var(--navbar-height-shrunk) + var(--sidebar-height));
}

/* =======================================
   Scrollbars
   ======================================= */
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track,
*::-webkit-scrollbar-track-piece,
*::-webkit-scrollbar-corner {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

body::-webkit-scrollbar-button {
    width: 8px;
    height: 14px;
    background-color: transparent;
}

body::-webkit-scrollbar-button:hover {
    background-color: var(--hover-bg);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}
