/* Sternwarte Uitikon – Gruppenführungen (groupbooking)
   Visual refresh in the style of the main website (same colours and fonts),
   kept as a separate, lighter app layout. Only CSS – no markup required. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700&display=swap");

:root {
    --bg: #f5f7fa;
    --panel: #ffffff;
    --ink: #1d2733;
    --navy: #0e1b2c;
    --muted: #5c6878;
    --line: #e2e7ee;
    --field-line: #cfd6df;
    --accent: #0f8a80;
    --accent-dark: #0b6b63;
    --accent-soft: #e3f3f1;
    --sky: #7cc8e8;
    --sky-soft: #e8f5fb;
    --danger: #d64545;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(14, 27, 44, 0.06), 0 6px 20px rgba(14, 27, 44, 0.06);
    --shadow-lg: 0 10px 40px rgba(14, 27, 44, 0.16);
    --font-head: "Outfit", "Inter", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* thin brand line at the very top */
body::before {
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--sky) 100%);
}

body.modal-open {
    overflow: hidden;
}

a {
    color: var(--accent);
    font-weight: 500;
}

a:hover {
    color: var(--accent-dark);
}

.site-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 64px;
}

/* ---------- Top bar ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 36px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.topbar > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.brand {
    display: grid;
    grid-template-columns: 40px auto;
    column-gap: 12px;
    align-items: center;
}

.brand::before {
    content: "\2605";
    grid-row: 1 / span 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
}

.brand strong {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--navy);
    line-height: 1.2;
}

.brand span {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.3;
}

/* ---------- Typography ---------- */
h1,
h2,
h3 {
    margin: 0;
    line-height: 1.15;
    font-family: var(--font-head);
    font-weight: 600;
    color: var(--navy);
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(1.9rem, 3.6vw, 2.8rem);
    max-width: 820px;
}

h2 {
    font-size: 1.45rem;
}

.intro {
    max-width: 740px;
    color: var(--muted);
    font-size: 1.08rem;
    margin: 12px 0 28px;
}

/* ---------- Panels ---------- */
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}

/* ---------- Forms ---------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field.full {
    grid-column: 1 / -1;
}

label {
    color: var(--navy);
    font-weight: 600;
    font-size: 0.92rem;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--field-line);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    font: inherit;
    color: var(--ink);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    cursor: pointer;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235c6878' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 13px center;
}

input:disabled,
select:disabled,
textarea:disabled {
    background-color: var(--bg);
    color: var(--muted);
}

textarea {
    min-height: 140px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15, 138, 128, 0.15);
    outline: none;
}

.checkbox-row {
    align-items: center;
    flex-direction: row;
    gap: 10px;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.price-box {
    align-items: center;
    background: linear-gradient(135deg, var(--navy) 0%, #16273d 100%);
    border-radius: var(--radius);
    color: #fff;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 24px 0;
    padding: 20px 24px;
}

.price-box strong {
    font-family: var(--font-head);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--sky);
}

.actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* ---------- Buttons ---------- */
button,
.button {
    appearance: none;
    background: var(--accent);
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 22px;
    text-decoration: none;
    font: inherit;
    font-weight: 600;
    transition: background 0.15s ease, border-color 0.15s ease;
}

button:hover,
.button:hover {
    background: var(--accent-dark);
    color: #fff;
}

button:disabled {
    background: #a9cfcb;
    cursor: not-allowed;
}

.button.secondary {
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
    min-height: 40px;
    padding: 8px 18px;
}

.button.secondary:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-dark);
}

.button.danger {
    background: var(--danger);
}

.button.danger:hover {
    background: #b93636;
}

.table-icon-button {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    display: inline-flex;
    font-size: 0.92rem;
    height: 34px;
    justify-content: center;
    width: 34px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.table-icon-button + .table-icon-button {
    margin-left: 4px;
}

.table-icon-button:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-dark);
}

.actions-column,
.actions-cell {
    width: 96px;
    white-space: nowrap;
}

.reservation-link {
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: 0;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    min-height: 0;
    padding: 0;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}

.reservation-link:hover {
    background: transparent;
    color: var(--accent-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.reservation-link:focus {
    background: transparent;
    color: var(--accent-dark);
    outline: 2px solid rgba(15, 138, 128, 0.28);
    outline-offset: 3px;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.row-actions form {
    margin: 0;
}

/* ---------- Modal ---------- */
.modal[hidden] {
    display: none;
}

.modal {
    inset: 0;
    position: fixed;
    z-index: 50;
}

.modal-backdrop {
    background: rgba(14, 27, 44, 0.55);
    backdrop-filter: blur(3px);
    inset: 0;
    position: absolute;
}

.modal-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    left: 50%;
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 28px;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(760px, calc(100vw - 32px));
}

.modal-header {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.modal-close {
    background: var(--bg);
    border: 0;
    border-radius: 50%;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.35rem;
    height: 38px;
    min-height: 38px;
    padding: 0;
    width: 38px;
}

.modal-close:hover {
    background: var(--line);
    color: var(--ink);
}

.modal-detail-grid {
    margin-top: 0;
}

.preserve-lines {
    white-space: pre-wrap;
}

/* ---------- Messages ---------- */
.errors {
    background: #fdeeee;
    border: 1px solid #f2c4c4;
    border-radius: var(--radius-sm);
    color: #7f1d1d;
    margin: 0 0 20px;
    padding: 14px 18px;
}

.success {
    background: #e5f6ec;
    border: 1px solid #bfe3cc;
    border-radius: var(--radius-sm);
    color: #14532d;
    padding: 18px;
}

/* ---------- Admin ---------- */
.admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

.request-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}

.request-table th,
.request-table td {
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
    text-align: left;
    vertical-align: middle;
}

.request-table th {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.status-row {
    border-left: 7px solid var(--status-color, #94a3b8);
}

/* Request list (admin/index.php): rows as separate cards with space between them */
.request-table.request-list {
    border-collapse: separate;
    border-spacing: 0 10px;
    margin-top: -10px;
}

.request-table.request-list th {
    border-bottom: 0;
    padding: 6px 10px 0;
    white-space: nowrap;
}

.request-table.request-list td {
    background: #fff;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 16px 10px;
    white-space: nowrap;
}

.request-table.request-list td:first-child {
    border-left: 1px solid var(--line);
    border-radius: 10px 0 0 10px;
    box-shadow: inset 6px 0 0 var(--status-color, #94a3b8);
    padding-left: 18px;
}

.request-table.request-list td:last-child {
    border-right: 1px solid var(--line);
    border-radius: 0 10px 10px 0;
}

.request-table.request-list tbody tr:hover td {
    background: #fbfcfd;
    border-color: #d5dde7;
}

.request-table.request-list td select {
    padding-top: 8px;
    padding-bottom: 8px;
    min-width: 160px;
}

/* sort arrows in the table header */
.sort-head {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sort-arrows {
    display: inline-flex;
    flex-direction: column;
    line-height: 1;
}

.sort-arrows a {
    color: #b6c0cc;
    display: block;
    font-size: 0.7rem;
    padding: 0 2px;
    text-decoration: none;
}

.sort-arrows a:hover {
    color: var(--accent);
}

.sort-arrows a.active {
    color: var(--accent);
}

.status-pill {
    background: var(--status-color, #94a3b8);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 4px 12px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
}

.detail-item {
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.detail-item span {
    color: var(--muted);
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.edit-form {
    margin-top: 24px;
}

.small-note {
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 760px) {
    .site-shell {
        width: min(100% - 22px, 1120px);
        padding-top: 20px;
    }

    .topbar,
    .price-box,
    .actions {
        align-items: stretch;
        flex-direction: column;
    }

    .form-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .panel {
        padding: 18px;
    }

    .request-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* status pill inside the detail list (overrides .detail-item span) */
.detail-item .status-pill {
    display: inline-flex;
    color: #fff;
    font-size: 0.82rem;
    letter-spacing: 0;
    text-transform: none;
    margin: 2px 0 0;
}

.panel h1 {
    margin-bottom: 18px;
}

.panel h2 {
    margin: 8px 0 16px;
}

/* Confirmation modal (delete request) */
.confirm-panel {
    width: min(440px, calc(100vw - 32px));
    text-align: center;
    padding: 32px 28px 26px;
}

.confirm-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #fdeeee;
    color: var(--danger);
    display: grid;
    place-items: center;
    font-family: var(--font-head);
    font-size: 1.6rem;
    font-weight: 700;
}

.confirm-panel h2 {
    margin: 0 0 10px;
}

.confirm-panel p {
    color: var(--muted);
    margin: 0 0 24px;
}

.confirm-panel p strong {
    color: var(--ink);
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.confirm-actions .button {
    min-width: 150px;
}

/* ---------- Demonstratoren (admin/guides.php) ---------- */
.table-scroll {
    overflow-x: auto;
    margin: 0 -4px;
    padding: 0 4px;
}

.guide-table {
    min-width: 980px;
}

.guide-table th,
.guide-table td {
    padding: 8px 5px;
    border-bottom: 1px solid var(--line);
}

.guide-table td input[type="text"],
.guide-table td input[type="tel"],
.guide-table td input[type="email"] {
    padding: 8px 10px;
    font-size: 0.92rem;
    min-width: 0;
}

.guide-table tbody tr[data-guide-row]:hover td {
    background: #fbfcfd;
}

.guide-table .guide-active {
    width: 64px;
    text-align: center;
}

.guide-table .guide-remove {
    width: 48px;
    text-align: right;
}

.guide-empty td {
    color: var(--muted);
    text-align: center;
    padding: 24px 10px;
    font-style: italic;
}

.guide-empty[hidden] {
    display: none;
}

.add-guide {
    margin-top: 14px;
}

.danger-icon:hover {
    background: #fdeeee;
    border-color: var(--danger);
    color: var(--danger);
}

/* toggle switch used for "Aktiv" */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
    vertical-align: middle;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

.switch span {
    position: absolute;
    inset: 0;
    background: #cfd6df;
    border-radius: 999px;
    transition: background 0.15s ease;
}

.switch span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(14, 27, 44, 0.25);
    transition: transform 0.15s ease;
}

.switch input:checked + span {
    background: var(--accent);
}

.switch input:checked + span::after {
    transform: translateX(18px);
}

.switch input:focus-visible + span {
    box-shadow: 0 0 0 3px rgba(15, 138, 128, 0.25);
}

.guide-table {
    table-layout: fixed;
}

.guide-table th:nth-child(1) { width: 11%; }
.guide-table th:nth-child(2) { width: 12%; }
.guide-table th:nth-child(3),
.guide-table th:nth-child(4) { width: 13.5%; }
.guide-table th:nth-child(5) { width: 19%; }
.guide-table th:nth-child(6) { width: 17%; }
.guide-table th:nth-child(7) { width: 60px; }
.guide-table th:nth-child(8) { width: 48px; }

/* ---------- Calendar (flatpickr) in the site colours ---------- */
.flatpickr-calendar {
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--line);
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months {
    font-family: var(--font-head);
    font-weight: 600;
    color: var(--navy);
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    appearance: auto;
    -webkit-appearance: auto;
    background-image: none;
    padding: 0 4px;
    width: auto;
    border: 0;
}

.flatpickr-current-month input.cur-year {
    font-weight: 600;
    color: var(--navy);
    border: 0;
    box-shadow: none;
    padding: 0 0 0 4px;
}

.flatpickr-calendar input.numInput,
.flatpickr-time input {
    border: 0;
    box-shadow: none;
    padding: 0;
}

span.flatpickr-weekday {
    color: var(--muted);
    font-weight: 600;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.flatpickr-day.today {
    border-color: var(--sky);
}

.flatpickr-day.today:hover,
.flatpickr-day:hover {
    background: var(--accent-soft);
    border-color: var(--accent-soft);
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: var(--accent);
}

.flatpickr-input[readonly] {
    cursor: pointer;
    background-color: #fff;
}

.flatpickr-input[readonly]:disabled {
    cursor: not-allowed;
    background-color: var(--bg);
}

/* "Bitte warten" state of the submit button */
button[aria-busy="true"],
button[aria-busy="true"]:disabled {
    background: var(--accent-dark);
    cursor: progress;
}

.button-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: button-spin 0.8s linear infinite;
}

@keyframes button-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Request list on medium-width screens: a bit more compact so it fits the panel */
@media (max-width: 1240px) {
    .request-table.request-list td {
        padding: 14px 6px;
        font-size: 0.92rem;
    }

    .request-table.request-list th {
        padding: 6px 6px 0;
    }

    .request-table.request-list td:first-child {
        padding-left: 14px;
    }

    .request-table.request-list td select {
        min-width: 140px;
        padding-left: 10px;
        padding-right: 30px;
        background-position: right 10px center;
        font-size: 0.92rem;
    }

    .table-icon-button {
        width: 30px;
        height: 30px;
    }

    .actions-column,
    .actions-cell {
        width: 80px;
    }
}

@media (max-width: 1080px) {
    .request-table.request-list {
        display: block;
        overflow-x: auto;
    }
}

/* "Hilfe!" button (opens the manual) */
.button.help-button {
    gap: 8px;
    background: var(--sky-soft);
    border-color: #c9e6f4;
    color: var(--accent-dark);
}

.button.help-button:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-dark);
}
