/* ============================================================
   Konferenzraum-Buchungssystem – Stylesheet
   Weißer Hintergrund, klares Layout, responsive
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --bg: #ffffff;
    --bg-soft: #f7f8fa;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5em 0; }

/* ---------- Layout ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-header, .admin-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 0;
    margin-bottom: 1.5rem;
}
.admin-header { background: #f9fafb; }

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.logo { font-weight: 700; font-size: 1.2rem; color: var(--text); }
.logo:hover { text-decoration: none; }

nav a, .admin-nav a {
    margin-left: 1.2rem;
    color: var(--text);
    font-weight: 500;
}
.admin-nav a.logout { color: var(--danger); }

.site-footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

main { min-height: 60vh; }

/* ---------- Hero ---------- */
.hero { padding: 1rem 0 2rem; }
.hero h1 { font-size: 2.2rem; margin: 0 0 0.5rem; }
.hero p  { color: var(--text-muted); max-width: 700px; }

.page-head {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}
.btn:hover { background: var(--bg-soft); text-decoration: none; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--text); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.back-link { color: var(--text-muted); }

/* ---------- Cards ---------- */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }

/* ---------- Räume Grid ---------- */
.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}
.room-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow);
}
.room-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.room-card-link { display: block; color: inherit; text-decoration: none; }
.room-card-link:hover { text-decoration: none; }
.room-card-img {
    background: var(--bg-soft);
    aspect-ratio: 16 / 10;
    overflow: hidden;
}
.room-card-img img { width: 100%; height: 100%; object-fit: cover; }
.room-card-img .placeholder {
    display: flex; align-items: center; justify-content: center;
    height: 100%; color: var(--text-muted); font-size: 0.9rem;
}
.room-card-body { padding: 1rem 1.2rem 1.3rem; }
.room-card-body h2 { margin: 0 0 0.3rem; font-size: 1.2rem; }
.room-desc { color: var(--text-muted); font-size: 0.9rem; min-height: 2.7em; }

/* ---------- Galerie ---------- */
.gallery { margin: 1.5rem 0; }
.gallery-main {
    background: var(--bg-soft);
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    max-height: 480px;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs {
    display: flex; gap: 0.5rem; margin-top: 0.5rem;
    overflow-x: auto; padding-bottom: 0.5rem;
}
.thumb {
    flex-shrink: 0;
    width: 96px; height: 64px;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    padding: 0;
    cursor: pointer;
    background: none;
}
.thumb:hover, .thumb:focus { border-color: var(--primary); outline: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Foto-Grid (Admin) ---------- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.8rem;
    margin: 1rem 0;
}
.photo-item {
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-soft);
}
.photo-item img { aspect-ratio: 4 / 3; object-fit: cover; }
.photo-item form { padding: 0.4rem; text-align: center; background: #fff; border-top: 1px solid var(--border); }

/* ---------- Formulare ---------- */
form label {
    display: block;
    margin-bottom: 0.9rem;
    font-weight: 500;
    color: var(--text);
}
form label.checkbox {
    display: flex;
    align-items: center;
    font-weight: normal;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
form input[type=text], form input[type=email], form input[type=tel],
form input[type=password], form input[type=number],
form input[type=date], form input[type=datetime-local], form input[type=time],
form input[type=file], form select, form textarea {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    font: inherit;
    color: var(--text);
}
form input:focus, form select:focus, form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
form textarea { resize: vertical; }

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0 1rem;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0 1rem;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0 1rem;
}

fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    margin: 1rem 0;
}
fieldset legend {
    padding: 0 0.5rem;
    font-weight: 600;
}
.services .checkbox { margin-bottom: 0.4rem; }
.recurring-block { background: #fefce8; }

.booking-form .price-preview {
    background: var(--bg-soft);
    padding: 0.9rem 1.1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 1.05rem;
}

.filter-form button[type=submit] { margin-right: 0.5rem; }

/* ---------- Tabellen ---------- */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin: 1rem 0;
}
.table th, .table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.table th { background: var(--bg-soft); font-weight: 600; font-size: 0.9rem; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfc; }

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge-pending   { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.warn { color: var(--warning); }

/* ---------- Stat-Karten ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.2rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-num {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}
.stat-card span:last-child {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.3rem;
    display: block;
}

/* ---------- Flash-Meldungen ---------- */
.flash {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border: 1px solid;
}
.flash-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.flash-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.flash-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* ---------- Hilfsklassen ---------- */
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.empty {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-soft);
    border-radius: 10px;
}

/* ---------- Install/Login-Box ---------- */
.install-body {
    background: var(--bg-soft);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.install-box {
    background: #fff;
    max-width: 480px;
    width: 100%;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
}
.install-box h1 { margin-top: 0; }

/* ---------- FullCalendar Anpassungen ---------- */
#calendar {
    background: #fff;
    border-radius: 8px;
}
.fc { font-size: 0.9rem; }
.fc .fc-button-primary {
    background: #fff !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}
.fc .fc-button-primary:hover { background: var(--bg-soft) !important; }
.fc .fc-button-primary.fc-button-active {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}
.fc-event { cursor: default; }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .header-row { flex-direction: column; align-items: flex-start; }
    nav, .admin-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; }
    nav a, .admin-nav a { margin-left: 0; }
    .hero h1 { font-size: 1.6rem; }
    .table { font-size: 0.85rem; }
    .table th, .table td { padding: 0.5rem 0.6rem; }
}
