/* ========== Grundlayout & Farben ========== */

:root {
    --bg-body: #f5f7fb;
    --bg-card: #ffffff;
    --primary: #2563eb;
    --primary-soft: #e0edff;
    --primary-soft2: #eff4ff;
    --accent: #16a34a;
    --danger: #dc2626;
    --warning: #f97316;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-soft: #e5e7eb;
    --radius-sm: 0.375rem;
    --radius-lg: 0.9rem;
    --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #e0edff 0, #f5f7fb 40%, #f5f7fb 100%);
    color: var(--text-main);
}

.container {
    max-width: 1120px;
    margin: 2rem auto;
    padding: 1.5rem 2rem 2rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

h1 {
    font-size: 1.9rem;
    margin: 0 0 1.2rem;
    color: var(--text-main);
    letter-spacing: 0.01em;
}

h2 {
    font-size: 1.3rem;
    margin: 1.5rem 0 0.8rem;
    color: var(--text-main);
}

h3 {
    font-size: 1.1rem;
    margin: 1.2rem 0 0.6rem;
    color: var(--text-main);
}

p {
    margin: 0 0 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ========== Admin-Navigation ========== */

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.3rem;
}

.admin-nav a {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: var(--primary-soft2);
    color: var(--text-main);
    font-size: 0.88rem;
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.admin-nav a:hover {
    background: var(--primary-soft);
    border-color: #bfdbfe;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.18);
}

.admin-nav a.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* ========== Formulare ========== */

.form-row {
    margin-bottom: 0.75rem;
}

.form-row label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: var(--text-main);
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-main);
    background: #f9fafb;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

textarea {
    resize: vertical;
    min-height: 70px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
    background: #ffffff;
}

.form-row input[type="checkbox"] {
    width: auto;
    margin-right: 0.3rem;
}

/* Buttons */

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 0.5rem 1.4rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.btn-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

/* Hinweise & Meldungen */

.note {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Meldungsboxen */

.error,
.success {
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    margin: 0.6rem 0 0.8rem;
    font-size: 0.85rem;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ========== Tabellen ========== */

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    margin-top: 0.75rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.table th,
.table td {
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid var(--border-soft);
}

.table tr:last-child td {
    border-bottom: none;
}

.table th {
    background: #eef2ff;
    color: #111827;
    text-align: left;
    font-weight: 600;
    font-size: 0.88rem;
}

.table tr:nth-child(even) td {
    background: #f9fafb;
}

/* ========== Öffentlicher Kalender / Buchung ========== */

.booking-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.booking-header h1 {
    margin-bottom: 0.4rem;
}

.booking-header p {
    margin-top: 0;
}

.booking-logo {
    max-width: 120px; /* ungefähr halbe Größe */
    height: auto;
    margin-bottom: 0.35rem;
}

.booking-club-name {
    font-weight: 600;
    margin-bottom: 0.7rem;
    color: var(--text-main);
    font-size: 1rem;
}

.calendar-wrapper {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.2rem;
}

.calendar-days {
    flex: 1 1 260px;
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid var(--border-soft);
    padding: 0.6rem;
    border-radius: var(--radius-lg);
    background: #f9fafb;
}

.calendar-column-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
    color: var(--text-main);
}

.day-btn {
    display: block;
    width: 100%;
    text-align: left;
    margin-bottom: 0.25rem;
    padding: 0.4rem 0.6rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-main);
    border: 1px solid var(--primary-soft);
    background: var(--primary-soft2);
    transition: background 0.12s ease, border-color 0.12s ease,
        box-shadow 0.12s ease, color 0.12s ease;
}

.day-btn:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.day-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
}

#slots-container {
    flex: 2 1 320px;
    border: 1px solid var(--border-soft);
    padding: 0.9rem;
    border-radius: var(--radius-lg);
    min-height: 150px;
    background: #f9fafb;
}

.slots-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.3rem;
}

.slot-btn {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.35);
    transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.05s ease;
}

.slot-btn:hover {
    background: #15803d;
    box-shadow: 0 5px 14px rgba(22, 163, 74, 0.45);
    transform: translateY(-1px);
}

.slot-btn:active {
    transform: translateY(0);
}

/* ========== Modal (Frontend + Admin) ========== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #ffffff;
    max-width: 480px;
    width: 100%;
    padding: 1.2rem 1.4rem 1.4rem;
    border-radius: var(--radius-lg);
    position: relative;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.35);
}

.modal-close {
    position: absolute;
    right: 0.75rem;
    top: 0.65rem;
    border: none;
    background: transparent;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-close:hover {
    color: var(--text-main);
}

body.modal-open {
    overflow: hidden;
}

/* ========== Responsive ========== */

@media (max-width: 768px) {
    .container {
        margin: 1rem;
        padding: 1.2rem 1rem 1.4rem;
    }

    .calendar-wrapper {
        flex-direction: column;
    }

    .admin-nav {
        gap: 0.3rem;
    }

    .admin-nav a {
        font-size: 0.82rem;
        padding-inline: 0.7rem;
    }
}
