/* ATUS v5.0 - Responsive Styles */

/* ===== LARGE SCREENS ===== */
@media (min-width: 1200px) {
    .container {
        padding: 0 40px;
    }
    
    .calendar-table {
        font-size: 15px;
    }
    
    .time-slot {
        min-height: 60px;
        padding: 10px 6px;
        font-size: 13px;
    }
    
    .modal-content {
        margin: 3% auto;
    }
}

/* ===== TABLET LANDSCAPE ===== */
@media (max-width: 1024px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .user-actions {
        justify-content: center;
    }
    
    .calendar-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .view-controls,
    .date-navigation,
    .additional-controls {
        justify-content: center;
    }
    
    .legend {
        gap: 15px;
    }
    
    .calendar-table {
        font-size: 13px;
    }
    
    .time-slot {
        min-height: 45px;
        padding: 6px 4px;
        font-size: 11px;
    }
    
    .modal-content {
        max-width: 90%;
        margin: 2% auto;
    }
    
    .admin-panel {
        width: 350px;
    }
}

/* ===== TABLET PORTRAIT ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .main-content {
        padding: 15px 0;
    }
    
    .header {
        padding: 12px 0;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .user-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .calendar-controls {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .current-period {
        font-size: 1rem;
        min-width: 150px;
        margin: 0 10px;
    }
    
    .legend {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .legend-item {
        font-size: 13px;
    }
    
    .legend-color {
        width: 16px;
        height: 16px;
    }
    
    /* Kalender horizontal scrollbar */
    .calendar-container {
        overflow-x: auto;
    }
    
    .calendar-table {
        min-width: 600px;
        font-size: 12px;
    }
    
    .calendar-table th {
        padding: 10px 6px;
        font-size: 12px;
    }
    
    .calendar-table .time-cell {
        padding: 8px 4px;
        width: 60px;
        font-size: 11px;
    }
    
    .time-slot {
        min-height: 40px;
        padding: 4px 2px;
        font-size: 10px;
    }
    
    .reservation-info {
        font-size: 9px;
    }
    
    .reservation-category {
        font-size: 8px;
    }
    
    /* Modal Anpassungen */
    .modal-content {
        width: 95%;
        margin: 2% auto;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Reservierungen Stats */
    .reservations-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-item {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    /* Admin Panel */
    .admin-panel {
        width: 100%;
        right: -100%;
    }
    
    .admin-panel-content {
        padding: 15px;
    }
    
    .admin-section {
        padding: 15px;
        margin-bottom: 20px;
    }
}

/* ===== MOBILE LANDSCAPE ===== */
@media (max-width: 640px) and (orientation: landscape) {
    .header {
        padding: 8px 0;
    }
    
    .logo h1 {
        font-size: 1.3rem;
    }
    
    .user-info {
        flex-direction: row;
        gap: 8px;
    }
    
    .user-actions {
        flex-direction: row;
        gap: 6px;
    }
    
    .btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .main-content {
        padding: 10px 0;
    }
    
    .calendar-controls {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .legend {
        margin-bottom: 10px;
    }
    
    .calendar-table {
        font-size: 11px;
    }
    
    .time-slot {
        min-height: 35px;
        font-size: 9px;
    }
    
    .modal-content {
        max-height: 90vh;
    }
}

/* ===== MOBILE PORTRAIT ===== */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .header {
        padding: 10px 0;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
    
    .user-info {
        gap: 8px;
        font-size: 14px;
    }
    
    .user-actions {
        gap: 6px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .calendar-controls {
        padding: 12px;
        gap: 10px;
    }
    
    .view-controls .btn,
    .additional-controls .btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .current-period {
        font-size: 0.9rem;
        min-width: 120px;
        margin: 0 8px;
    }
    
    .legend {
        justify-content: space-around;
        gap: 8px;
    }
    
    .legend-item {
        font-size: 11px;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }
    
    .legend-color {
        width: 14px;
        height: 14px;
    }
    
    /* Kalender für sehr kleine Bildschirme */
    .calendar-table {
        min-width: 550px;
        font-size: 10px;
    }
    
    .calendar-table th {
        padding: 8px 4px;
        font-size: 10px;
    }
    
    .calendar-table .time-cell {
        width: 50px;
        padding: 6px 2px;
        font-size: 9px;
    }
    
    .calendar-table .date-header {
        min-width: 80px;
        padding: 8px 4px;
    }
    
    .time-slot {
        min-height: 35px;
        padding: 3px 1px;
        font-size: 8px;
    }
    
    .reservation-info {
        font-size: 8px;
        line-height: 1.1;
    }
    
    .reservation-category {
        font-size: 7px;
        margin-top: 1px;
    }
    
    /* Forms auf Mobile */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 10px 12px;
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }
    
    .form-group label {
        margin-bottom: 6px;
        font-size: 14px;
    }
    
    /* Reservierungen Liste Mobile */
    .reservations-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .stat-item {
        padding: 12px;
    }
    
    .stat-number {
        font-size: 1.3rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .reservation-item {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .reservation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .reservation-title {
        font-size: 1rem;
    }
    
    .reservation-details {
        grid-template-columns: 1fr;
        gap: 8px;
        font-size: 0.8rem;
    }
    
    .reservation-actions {
        margin-top: 12px;
        flex-direction: column;
    }
    
    .reservation-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Toast Notifications Mobile */
    .toast-container {
        top: 70px;
        left: 10px;
        right: 10px;
    }
    
    .toast {
        margin-bottom: 8px;
        max-width: none;
        font-size: 14px;
    }
}

/* ===== SEHR KLEINE BILDSCHIRME ===== */
@media (max-width: 360px) {
    .container {
        padding: 0 8px;
    }
    
    .logo h1 {
        font-size: 1.2rem;
    }
    
    .btn {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .calendar-controls {
        padding: 8px;
    }
    
    .current-period {
        font-size: 0.8rem;
        min-width: 100px;
        margin: 0 5px;
    }
    
    .calendar-table {
        min-width: 500px;
        font-size: 9px;
    }
    
    .calendar-table .time-cell {
        width: 45px;
        padding: 4px 1px;
        font-size: 8px;
    }
    
    .calendar-table .date-header {
        min-width: 70px;
        padding: 6px 2px;
        font-size: 9px;
    }
    
    .time-slot {
        min-height: 30px;
        padding: 2px 1px;
        font-size: 7px;
    }
    
    .legend {
        gap: 6px;
    }
    
    .legend-item {
        font-size: 10px;
    }
    
    .legend-color {
        width: 12px;
        height: 12px;
    }
    
    .modal-content {
        width: 98%;
        margin: 1% auto;
    }
    
    .modal-header {
        padding: 12px 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        padding: 12px 15px;
    }
}

/* ===== HOVER STATES FÜR TOUCH DEVICES DEAKTIVIEREN ===== */
@media (hover: none) and (pointer: coarse) {
    .time-slot:hover {
        transform: none;
        box-shadow: none;
    }
    
    .btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    .reservation-item:hover {
        transform: none;
        box-shadow: none;
        border-color: #e1e8ed;
    }
    
    .modal-close:hover {
        background: none;
        color: #7f8c8d;
    }
}

/* ===== FOCUS STYLES FÜR ACCESSIBILITY ===== */
@media (prefers-reduced-motion: no-preference) {
    .btn:focus,
    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
        animation: focusPulse 0.3s ease;
    }
    
    @keyframes focusPulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.02); }
        100% { transform: scale(1); }
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .time-slot.available {
        background: #00ff00;
        color: #000000;
        border: 2px solid #000000;
    }
    
    .time-slot.reserved {
        background: #ffff00;
        color: #000000;
        border: 2px solid #000000;
    }
    
    .time-slot.user-reservation {
        background: #ff0000;
        color: #ffffff;
        border: 2px solid #000000;
    }
    
    .time-slot.my-reservation {
        background: #0000ff;
        color: #ffffff;
        border: 2px solid #000000;
    }
    
    .time-slot.past {
        background: #808080;
        color: #ffffff;
        border: 2px solid #000000;
    }
}

/* ===== DARK MODE (falls gewünscht) ===== */
@media (prefers-color-scheme: dark) {
    /* Kann später implementiert werden */
}

/* ===== LANDSCAPE ORIENTATION SPEZIFISCH ===== */
@media (orientation: landscape) and (max-height: 500px) {
    .header {
        padding: 5px 0;
    }
    
    .main-content {
        padding: 8px 0;
    }
    
    .calendar-controls {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .legend {
        margin-bottom: 8px;
    }
    
    .time-slot {
        min-height: 28px;
    }
    
    .modal-content {
        max-height: 85vh;
        margin: 1% auto;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .header,
    .footer,
    .calendar-controls,
    .legend,
    .modal,
    .admin-panel,
    .toast-container,
    .loading-spinner {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
    }
    
    .calendar-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .calendar-table {
        font-size: 12px;
    }
    
    .time-slot {
        border: 1px solid #ccc;
        background: white !important;
        color: black !important;
    }
    
    .time-slot.reserved::after {
        content: " [Reserviert]";
    }
    
    .time-slot.my-reservation::after {
        content: " [Meine Reservierung]";
    }
}