/* The look of the app: three main colors, its fonts, roomy rounded shapes and a landscape
   behind every page. dark.css holds what changes in dark mode. */

:root {
    --black-c: #2D2926;
    --mountain-view: #2E3D30;
    --comet-streak: #909986;
    /* The photo is dimmed by this, so it stays calm and text on the page stays readable. */
    --page-tint: rgb(6 64 43 / 0.7);
    /* Rubik covers Hebrew and Latin alike. The rest are for a moment before it loads, or if it
       can't: each has Hebrew on its own system (Windows, Android). */
    --app-font: "Rubik", "Segoe UI", "Noto Sans Hebrew", Arial, sans-serif;
}

html { background-color: #06402b; }
html.theme-dark { background-color: var(--black-c); --page-tint: rgb(45 41 38 / 0.82); }
body, body.body--dark { background: transparent; }

/* The page is dark in both modes, so text on it is light. Cards and menus stay light in light
   mode, so text on them is dark. */
body { color: #eef0ea; }
.q-card, .q-menu, .q-uploader, .chip-surface, .heart-surface { color: var(--black-c); }

/* Two layers, so that muting the photo's colors doesn't change the tint's. */
body::before, body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
}
body::before {
    background: var(--page-photo, none) center / cover no-repeat;
    filter: saturate(0.75);
}
body::after { background-color: var(--page-tint); }

/* ---------- Fonts ---------- */

body, button, input, textarea, select, .q-btn, .q-field, .q-field__native, .q-field__label,
.q-item, .q-tooltip, .q-notification, .q-uploader, .leaflet-container {
    font-family: var(--app-font);
}

/* ---------- Text colors, nudged towards the palette ---------- */

/* On the page. */
.text-stone-700 { color: #eef0ea; }
.text-stone-600 { color: #dfe3d9; }
.text-stone-500 { color: #cdd2c5; }
.text-stone-400 { color: #bcc3b1; }
.text-primary { --q-primary: #cdd2c5; }

/* On a card or menu. */
.q-card .text-stone-700, .q-menu .text-stone-700 { color: var(--black-c); }
.q-card .text-stone-600, .q-menu .text-stone-600 { color: #474c42; }
.q-card .text-stone-500, .q-menu .text-stone-500 { color: #565c50; }
.q-card .text-stone-400, .q-menu .text-stone-400 { color: #676d60; }
.q-card .text-primary, .q-menu .text-primary, .q-uploader .text-primary, .chip-surface .text-primary {
    --q-primary: #2E3D30;
}

/* A text box or menu sitting on the page keeps a light background, so its dark text reads. */
body:not(.body--dark) .q-field--outlined .q-field__control { background-color: rgb(255 255 255 / 0.92); }

/* ---------- Roomy, rounded shapes ---------- */

.q-header { box-shadow: 0 1px 0 rgb(144 153 134 / 0.4); }

.q-card {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 14px rgb(45 41 38 / 0.1);
}
.nicegui-card:not(.p-0) { padding: 1.5rem; }

.q-btn:not(.q-btn--round) { border-radius: 12px; }
.q-btn-group { border-radius: 12px; overflow: hidden; }
.q-field--outlined .q-field__control { border-radius: 12px; }
.q-uploader, .q-menu, .q-notification { border-radius: 16px; }
.q-tooltip { border-radius: 8px; }
.leaflet-container { border-radius: 20px; }
.rounded { border-radius: 12px; }
.rounded-lg { border-radius: 16px; }

/* The assistant's chat panel: as wide as a phone allows, up to a comfortable reading width. */
/* Above the page's cards and the map's controls (1000), below the header (2000) and its menus. */
.assistant-corner { z-index: 1500; }
.assistant-panel { width: min(380px, calc(100vw - 40px)); }
.assistant-messages { height: min(420px, calc(100vh - 260px)); }
.assistant-messages .q-scrollarea__content { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem; }
.assistant-bubble {
    max-width: 85%;
    padding: 0.5rem 0.75rem;
    border-radius: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
