* {
    box-sizing: border-box;
}

.container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

h1, h2 {
    color: #1e3a8a;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.day-tabs {
    display: flex;
    background: transparent;
    border-bottom: none;
    margin-bottom: 25px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0;
    gap: 10px;
}

/* Skrij scrollbar */
.day-tabs::-webkit-scrollbar {
    display: none;
}
.day-tabs {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.day-tab {
    padding: 10px 20px;
    cursor: pointer;
    border: 2px solid transparent; 
    border-radius: 9999px; /* Pill shape */
    flex: 0 0 auto;
    text-align: center;
    text-decoration: none;
    color: #4b5563;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 90px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    font-weight: 500;
}

.day-tab:hover {
    background: #f8fafc;
    color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.day-tab.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
    border-color: transparent;
}

@media (max-width: 768px) {
    .day-tab {
        padding: 10px 12px;
        min-width: 75px;
        font-size: 0.9em;
    }
}

.courts-container {
    display: flex;
    gap: 30px;
}

@media (max-width: 768px) {
    .courts-container {
        flex-direction: row; /* Igrišča so spet drugo ob drugem */
        overflow-x: auto; /* Omogoči drsenje levo-desno med igrišči */
        scroll-snap-type: x mandatory;
        gap: 15px;
        padding-bottom: 20px;
        -webkit-overflow-scrolling: touch;
    }
    
    .court-column {
        flex: 0 0 85%; /* Vsako igrišče zavzame 85% širine zaslona */
        scroll-snap-align: center;
    }

    /* Skrij scrollbar za čistejši izgled */
    .courts-container::-webkit-scrollbar {
        display: none;
    }
    .courts-container {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

.court-column {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.court-column:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.court-header {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: 700;
    font-size: 1.15em;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.time-grid {
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-auto-rows: 60px; /* Force consistent row heights so both courts align */
    gap: 1px;
    background: #e2e8f0;
}

.time-label {
    background: #f8fafc;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 0.9em;
    border-bottom: 1px solid #e2e8f0;
}

.slot {
    background: rgba(16, 185, 129, 0.15); /* Soft green */
    color: #065f46;
    padding: 4px 10px;
    margin: 2px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    transition: all 0.2s ease;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.slot.occupied {
    background: rgba(239, 68, 68, 0.15); /* Soft red */
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.3);
    cursor: default;
}

.slot.blocked {
    background: rgba(100, 116, 139, 0.15); /* Soft gray */
    color: #334155;
    border-color: rgba(100, 116, 139, 0.3);
    cursor: not-allowed;
}

.slot:hover:not(.occupied):not(.blocked) {
    background: #10b981; /* Solid green on hover */
    color: white;
    transform: scale(1.02);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

/* Modal Animations */
@keyframes modalFadeIn {
    from { opacity: 0; backdrop-filter: blur(0px); }
    to { opacity: 1; backdrop-filter: blur(8px); }
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-backdrop {
    animation: modalFadeIn 0.3s ease-out forwards;
    backdrop-filter: blur(8px);
    background: rgba(0,0,0,0.4) !important;
}

.modal-content {
    animation: modalSlideUp 0.3s ease-out forwards;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Dark Mode Styles */
html.dark-mode body {
    background: #111827;
    color: #e5e7eb;
}

html.dark-mode h1, html.dark-mode h2 {
    color: #93c5fd;
}

html.dark-mode header {
    background: rgba(17, 24, 39, 0.9);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

html.dark-mode .day-tab {
    background: #1f2937;
    color: #9ca3af;
    box-shadow: none;
    border-color: #374151;
}

html.dark-mode .day-tab:hover {
    background: #374151;
    color: #e5e7eb;
}

html.dark-mode .day-tab.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border-color: transparent;
}

html.dark-mode .court-column {
    background: #1f2937;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

html.dark-mode .court-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
}

html.dark-mode .time-grid {
    background: #374151;
}

html.dark-mode .time-label {
    background: #111827;
    color: #9ca3af;
    border-color: #374151;
}

html.dark-mode .slot {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.2);
}

html.dark-mode .slot.occupied {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

html.dark-mode .slot.blocked {
    background: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
    border-color: rgba(156, 163, 175, 0.2);
}

html.dark-mode .modal-content {
    background: #1f2937 !important;
    color: #e5e7eb;
}

html.dark-mode .modal-content select, html.dark-mode .modal-content input {
    background: #374151;
    color: white;
    border: 1px solid #4b5563;
}