/* === Allgemein === */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f0e8;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === Header === */
header {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    height: 80px;
    width: auto;
    border-radius: 8px;
    background: white;
    padding: 4px;
}

.header-text h1 {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
}

.header-text p {
    font-size: 1rem;
    opacity: 0.9;
}

/* === Main === */
main {
    flex: 1;
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
    width: 100%;
}

/* === Kalender === */
.calendar-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-nav button {
    background: #8B4513;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s;
}

.calendar-nav button:hover {
    background: #A0522D;
}

.calendar-nav h2 {
    font-size: 1.4rem;
    color: #8B4513;
    cursor: pointer;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    transition: background 0.2s;
    user-select: none;
    position: relative;
}

.calendar-nav h2:hover {
    background: rgba(139, 69, 19, 0.1);
}

.calendar-nav h2::after {
    content: ' ▾';
    font-size: 0.8rem;
    opacity: 0.6;
}

/* === Monats-Picker === */
.month-picker-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 900;
}

.month-picker {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    padding: 1rem;
    z-index: 1000;
    width: 280px;
}

.month-picker-year-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.month-picker-year-nav button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #8B4513;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: background 0.15s;
}

.month-picker-year-nav button:hover {
    background: rgba(139, 69, 19, 0.1);
}

.month-picker-year-nav span {
    font-weight: 700;
    font-size: 1.1rem;
    color: #8B4513;
}

.month-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.month-picker-grid button {
    padding: 0.5rem;
    border: 1px solid #e0d6c8;
    border-radius: 6px;
    background: #faf8f5;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
    color: #333;
}

.month-picker-grid button:hover {
    background: #8B4513;
    color: white;
    border-color: #8B4513;
}

.month-picker-grid button.active {
    background: #8B4513;
    color: white;
    border-color: #8B4513;
    font-weight: 700;
}

.month-picker-grid button.current-month {
    border-color: #8B4513;
    font-weight: 600;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #faf8f5;
    border-radius: 8px;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
}

.legend-icon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    line-height: 1;
    flex-shrink: 0;
}

.legend-icon.available {
    background: #fff;
    border: 2px solid #2e7d32;
    color: #2e7d32;
}

.legend-icon.pending {
    background: #fff3e0;
    border: 2px dashed #e65100;
    color: #e65100;
    font-weight: 900;
}

.legend-icon.booked {
    background: repeating-linear-gradient(
        45deg,
        #d32f2f,
        #d32f2f 3px,
        #ffcdd2 3px,
        #ffcdd2 6px
    );
    color: white;
    text-shadow: 0 0 2px rgba(0,0,0,0.5);
}

.legend-icon.blocked {
    background: #9e9e9e;
    color: white;
    font-size: 0.6rem;
    letter-spacing: -1px;
}

.legend-icon.holiday-bund {
    background: #1565C0;
}

.legend-icon.holiday-thueringen {
    background: #e65100;
}

.calendar {
    width: 100%;
    border-collapse: collapse;
}

.calendar th {
    background: #8B4513;
    color: white;
    padding: 0.7rem;
    text-align: center;
    font-weight: 600;
}

.calendar td {
    border: 1px solid #e0d6c8;
    padding: 0.3rem;
    text-align: center;
    height: 72px;
    max-height: 72px;
    vertical-align: top;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
    overflow: hidden;
}

.calendar td:hover:not(.empty):not(.past):not(.booked-confirmed):not(.booked-pending):not(.blocked) {
    background: #e8f5e9;
}

.calendar td.empty {
    background: #faf8f5;
    cursor: default;
}

.calendar td.past {
    background: #f5f5f5;
    color: #bbb;
    cursor: default;
}

.calendar td.today {
    border: 2px solid #8B4513;
    font-weight: bold;
}

.calendar td.booked-confirmed {
    background: repeating-linear-gradient(
        45deg,
        #ffcdd2,
        #ffcdd2 4px,
        #ef9a9a 4px,
        #ef9a9a 8px
    );
    cursor: not-allowed;
    color: #b71c1c;
}

.calendar td.booked-confirmed .day-number {
    background: rgba(255,255,255,0.85);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    line-height: 24px;
    margin: 0 auto;
    display: block;
}

.calendar td.booked-pending {
    background: #fff3e0;
    border: 2px dashed #e65100;
    cursor: not-allowed;
    color: #e65100;
}

.calendar td.booked-pending .day-number {
    font-weight: 700;
}

.calendar td.blocked {
    background: #e0e0e0;
    cursor: not-allowed;
    color: #757575;
}

.calendar td.blocked .day-number {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
}

.calendar td .day-number {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.1;
}

.calendar td .holiday-badge {
    font-size: 0.58rem;
    padding: 1px 3px;
    border-radius: 3px;
    color: white;
    display: block;
    margin-top: 1px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    position: relative;
    z-index: 2;
}

.holiday-badge.bund {
    background: #1565C0;
}

.holiday-badge.thueringen {
    background: #e65100;
}

/* === Modal === */\n.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 650px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.close-btn:hover { color: #333; }

.modal-content h2 {
    color: #8B4513;
    margin-bottom: 1.5rem;
}

fieldset {
    border: 1px solid #e0d6c8;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

fieldset legend {
    font-weight: 600;
    color: #8B4513;
    padding: 0 0.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 180px;
    margin-bottom: 0.8rem;
}

.form-group.half {
    flex: 0.5;
    min-width: 80px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #8B4513;
    outline: none;
    box-shadow: 0 0 0 2px rgba(139,69,19,0.15);
}

.checkbox-group {
    min-width: 100%;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: #8B4513;
    flex-shrink: 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.btn-primary {
    background: #8B4513;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover { background: #A0522D; }

.btn-secondary {
    background: #eee;
    color: #333;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover { background: #ddd; }

/* === Toast === */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    z-index: 2000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.toast.success { background: #4CAF50; }
.toast.error { background: #e53935; }

/* === Footer === */
footer {
    background: #8B4513;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: auto;
}

/* === Datumsbereich-Auswahl === */
.selection-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1rem;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}

.price-info {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.8rem;
}

.modal-price {
    font-size: 1.1rem;
    color: #2e7d32;
    font-weight: 600;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #e8f5e9;
    border-radius: 6px;
    text-align: center;
}

.calendar td.range-start {
    background: #8B4513 !important;
    color: white !important;
    border-radius: 8px 0 0 8px;
}

.calendar td.range-end {
    background: #8B4513 !important;
    color: white !important;
    border-radius: 0 8px 8px 0;
}

.calendar td.range-start.range-end {
    border-radius: 8px;
}

.calendar td.in-range {
    background: #d7ccc8 !important;
}

.calendar td.range-start .day-number,
.calendar td.range-end .day-number {
    color: white;
}

.calendar td.range-start .holiday-badge,
.calendar td.range-end .holiday-badge {
    color: white;
    opacity: 0.9;
}

/* === Responsive === */
@media (max-width: 600px) {
    .header-content { flex-direction: column; text-align: center; }
    .logo { height: 60px; }
    .header-text h1 { font-size: 1.3rem; }
    .calendar td { height: 55px; padding: 0.3rem; }
    .calendar td .day-number { font-size: 0.85rem; }
    .calendar td .holiday-badge { font-size: 0.55rem; }
    .form-row { flex-direction: column; }
    .form-group { min-width: 100%; }
    .calendar-legend { font-size: 0.75rem; gap: 0.5rem; }
}

/* === Admin === */
.admin-container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.admin-table th {
    background: #8B4513;
    color: white;
    padding: 0.7rem;
    text-align: left;
    font-size: 0.85rem;
}

.admin-table td {
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid #eee;
    font-size: 0.85rem;
    vertical-align: top;
}

.admin-table tr:hover { background: #faf8f5; }

.status-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.status-badge.anfrage { background: #FF9800; }
.status-badge.bestaetigt { background: #4CAF50; }
.status-badge.abgelehnt { background: #e53935; }

.admin-actions {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.admin-actions button,
.admin-actions input[type="submit"] {
    padding: 3px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    color: white;
}

.btn-confirm { background: #4CAF50; }
.btn-reject { background: #e53935; }
.btn-delete { background: #333; }
.btn-unblock { background: #FF9800; }

.admin-form {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.admin-form h3 {
    margin-bottom: 1rem;
    color: #8B4513;
}

.admin-form input {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-right: 0.5rem;
}

.admin-nav {
    margin-bottom: 1rem;
}

.admin-nav a {
    color: white;
    text-decoration: none;
    background: #A0522D;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.admin-nav a:hover {
    background: #8B4513;
}

.info-ja { color: #4CAF50; font-weight: 600; }
.info-nein { color: #999; }
