/* styles.css - Externe Styles */

/* Calendar Grid - Standard (alle Tage gleichmäßig) */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

/* Adaptive Grid - Dynamische Spaltenbreiten basierend auf Nutzung */
.calendar-grid-adaptive {
    display: grid;
    /* grid-template-columns wird dynamisch per inline style gesetzt */
}

/* Visuelle Kennzeichnung für leere Tage */
.calendar-day-empty {
    opacity: 0.7;
    background-color: #fafafa !important;
}

.calendar-day-used {
    opacity: 1;
}

.calendar-header-empty {
    opacity: 0.6;
    font-size: 0.85em;
}

.calendar-header-used {
    opacity: 1;
    font-weight: 600;
}

/* Hall Colors werden jetzt dynamisch aus den Daten gesetzt */
/* Diese Klassen sind nur noch Fallback für Header-Bereiche */
.hall-color-1 { background-color: #dbeafe; color: #1e40af; }
.hall-color-2 { background-color: #d1fae5; color: #065f46; }
.hall-color-3 { background-color: #fed7aa; color: #c2410c; }
.hall-color-4 { background-color: #e9d5ff; color: #6b21a8; }
.hall-color-5 { background-color: #fecaca; color: #b91c1c; }
.hall-color-6 { background-color: #cffafe; color: #0e7490; }

/* Status Indicators */
.status-angefragt { border-left: 8px solid #ffff00; }
.status-bestätigt { border-left: 8px solid #00ff00; }
.status-gesperrt { border-left: 8px solid #ff0000; }

/* Reservation Cards */
.reservation-card {
    border-left: 8px solid;
    padding: 4px 8px;
    margin: 2px 0;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.reservation-card:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Match Cards */
.match-card {
    padding: 4px 8px;
    margin: 2px 0;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.match-card:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.match-status-geplant { border-left: 4px solid #3b82f6; }
.match-status-laufend { border-left: 4px solid #22c55e; }
.match-status-beendet { border-left: 4px solid #6b7280; }
.match-status-abgesagt { border-left: 4px solid #ef4444; }

/* Week View */
.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Adaptive Week Grid - Dynamische Spaltenbreiten */
.week-grid-adaptive {
    display: grid;
    /* grid-template-columns wird dynamisch per inline style gesetzt */
    gap: 8px;
    max-width: 1400px;
    margin: 0 auto;
}

.week-day-card {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}

/* Visuelle Kennzeichnung für leere Tage in der Wochenansicht */
.week-day-empty {
    opacity: 0.6;
    background-color: #fafafa !important;
    min-height: 150px;
}

.week-day-used {
    opacity: 1;
    min-height: 200px;
}

/* Animations */
.refresh-spin {
    animation: spin 1s linear;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Auto-refresh Indicator */
.refresh-indicator {
    transition: all 0.3s ease;
}

.refresh-indicator.active {
    background-color: #10b981;
    transform: scale(1.1);
}

/* Modal Animations */
.modal-enter {
    opacity: 0;
    transform: scale(0.95);
}

.modal-enter-active {
    opacity: 1;
    transform: scale(1);
    transition: opacity 150ms ease-out, transform 150ms ease-out;
}

.modal-exit {
    opacity: 1;
    transform: scale(1);
}

.modal-exit-active {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 150ms ease-in, transform 150ms ease-in;
}

/* Notification Animations */
.notification-enter {
    opacity: 0;
    transform: translateX(100%);
}

.notification-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 300ms ease-out, transform 300ms ease-out;
}

.notification-exit {
    opacity: 1;
    transform: translateX(0);
}

.notification-exit-active {
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 300ms ease-in, transform 300ms ease-in;
}

/* Responsive Design - Tablet */
@media (max-width: 1024px) {
    /* Wochenansicht: Adaptive Breiten bleiben erhalten, aber kleinerer Gap */
    .week-grid-adaptive {
        gap: 4px;
    }

    .week-day-empty {
        min-height: 120px;
    }

    .week-day-used {
        min-height: 180px;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
    .calendar-grid,
    .calendar-grid-adaptive {
        font-size: 0.75rem;
        gap: 1px;
    }

    /* Noch stärkere Kompression auf Mobile für leere Tage */
    .calendar-day-empty {
        opacity: 0.5;
        min-height: 60px !important;
        height: 60px !important;
    }

    .calendar-day-used {
        min-height: 80px !important;
        height: auto !important;
    }

    /* Kompaktere Headers auf Mobile */
    .calendar-header-empty {
        opacity: 0.5;
        font-size: 0.7em;
        padding: 0.25rem !important;
    }

    .calendar-header-used {
        font-size: 0.9em;
        padding: 0.5rem !important;
    }

    /* Wochenansicht: Auf Mobile zu Spalten-Layout wechseln */
    .week-grid,
    .week-grid-adaptive {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }

    .week-day-card {
        min-height: 200px;
        max-height: none;
    }

    /* Mobile: Kompaktere Darstellung für leere Tage in Wochenansicht */
    .week-day-empty {
        min-height: 100px;
        opacity: 0.5;
    }

    .week-day-used {
        min-height: 150px;
    }

    .reservation-card,
    .match-card {
        padding: 4px 6px;
        font-size: 0.7rem;
        margin: 1px 0;
    }

    /* Touch-optimierte Buttons */
    button {
        min-height: 44px;
        min-width: 44px;
    }
}

@media (max-width: 640px) {
    .hall-color-1,
    .hall-color-2,
    .hall-color-3,
    .hall-color-4,
    .hall-color-5,
    .hall-color-6 {
        font-size: 0.75rem;
    }

    /* Extra kleine Screens */
    .calendar-grid,
    .calendar-grid-adaptive {
        font-size: 0.65rem;
    }

    /* Noch kompaktere leere Tage auf sehr kleinen Screens */
    .calendar-day-empty {
        min-height: 50px !important;
        height: 50px !important;
        opacity: 0.4;
    }

    .calendar-day-used {
        min-height: 70px !important;
    }

    .reservation-card,
    .match-card {
        padding: 3px 4px;
        font-size: 0.65rem;
    }
}

/* Touch-optimierte Elemente */
.touch-manipulation {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Prevent text selection on buttons/cards */
.reservation-card,
.match-card,
button {
    -webkit-user-select: none;
    user-select: none;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .reservation-card {
        background-color: #374151;
        color: #f9fafb;
    }

    .match-card {
        background-color: #374151;
        color: #f9fafb;
    }
}