/* ============================================================
   Background Themes — full-screen single composition (NOT tiled)
   Issue 2026-07-29: заменены 3 SVG на 4 пользовательских JPEG:
   - night.jpeg         (тёмно-синий космос)
   - sunset.jpeg        (розово-сиреневый закат)
   - lavender-soft.jpeg (нежный лиловый)
   - dawn.jpeg          (разноцветный рассвет)
   ============================================================ */

body {
    background-color: #FDFCFB;
}

body.theme-default {
    background-color: #FDFCFB;
}

/* ===== Night: dark cosmic blue ===== */
body.theme-night {
    background-color: #0B1538;
    background-image: url('/static/img/themes/night.jpeg');
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

/* ===== Sunset: pink-lilac sunset ===== */
body.theme-sunset {
    background-color: #C4A1C4;
    background-image: url('/static/img/themes/sunset.jpeg');
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

/* ===== Lavender Soft: gentle pastel ===== */
body.theme-lavender-soft {
    background-color: #E5C8C8;
    background-image: url('/static/img/themes/lavender-soft.jpeg');
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

/* ===== Dawn: multicolored sunrise ===== */
body.theme-dawn {
    background-color: #4F9AAE;
    background-image: url('/static/img/themes/dawn.jpeg');
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

/* ===== Полупрозрачные карточки, чтобы фон был виден ===== */
.card,
.om-card,
.od-block,
.od-panel,
.form-container,
.table-wrap,
.panel,
.box,
.list-card,
.cg-event {
    background-color: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.nav-bar,
.header,
.topbar,
.site-header {
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Для тёмных тем (night) — инвертируем цвет карточек */
body.theme-night .card,
body.theme-night .om-card,
body.theme-night .od-block,
body.theme-night .od-panel,
body.theme-night .form-container,
body.theme-night .table-wrap,
body.theme-night .panel,
body.theme-night .box,
body.theme-night .list-card,
body.theme-night .cg-event {
    background-color: rgba(20, 25, 55, 0.78);
    color: #E5E7EB;
}

/* ============================================================
   Profile picker — 5 swatches (default + 4 themes)
   ============================================================ */
.theme-picker {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 8px;
}
.theme-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
    background: rgba(255, 255, 255, 0.5);
}
.theme-swatch:hover {
    border-color: #A78BFA;
    transform: translateY(-1px);
}
.theme-swatch.is-active {
    border-color: #4F46E5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.18);
    background: rgba(255, 255, 255, 0.78);
}
.theme-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
}
.theme-preview.theme-default-preview {
    background: linear-gradient(135deg, #FDFCFB 0%, #E5E7EB 100%);
}
.theme-preview.theme-night-preview {
    background-image: url('/static/img/themes/night.jpeg');
}
.theme-preview.theme-sunset-preview {
    background-image: url('/static/img/themes/sunset.jpeg');
}
.theme-preview.theme-lavender-soft-preview {
    background-image: url('/static/img/themes/lavender-soft.jpeg');
}
.theme-preview.theme-dawn-preview {
    background-image: url('/static/img/themes/dawn.jpeg');
}
.theme-swatch span {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}

body.theme-night .theme-swatch span {
    color: #E5E7EB;
}

/* ============================================================
   Mobile: плотнее пікер
   ============================================================ */
@media (max-width: 600px) {
    .theme-picker {
        grid-template-columns: repeat(3, 1fr);
    }
    .theme-preview {
        width: 56px;
        height: 56px;
    }
}
