/* Hoved container */
.baneplan-kalender {
    max-width: 100%;
    overflow-x: auto;
    margin: 20px 0;
    transition: opacity 0.3s ease;
}

/* Header og navigasjon */
.baneplan-tittel {
    margin-bottom: 20px;
    font-size: 8rem;
    text-align: center;
    color: #ffffff;
}

.baneplan-navigasjon {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.baneplan-prev,
.baneplan-next {
    padding: 8px 16px;
    background: #005B38;
    text-decoration: none;
    border-radius: 4px;
    color: #FFF !important;
    transition: background-color 0.3s ease;
}

.baneplan-prev:hover,
.baneplan-next:hover {
    background: #00A766;
}

/* Periode og uke-velger */
.baneplan-periode-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.baneplan-periode {
    font-weight: bold;
    color: #ffffff;
    font-size: 2rem;
}

.baneplan-uke-velger {
    width: 300px;
    margin: 0 auto;
}

.baneplan-uke-velger select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #005B38;
    border-radius: 4px;
    background: #ffffff;
    color: #005B38;
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23005B38' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) center;
    padding-right: 35px;
    text-align: center;
}

.baneplan-uke-velger select:hover {
    border-color: #00A766;
}

.baneplan-uke-velger select:focus {
    outline: none;
    border-color: #00A766;
    box-shadow: 0 0 0 2px rgba(0, 167, 102, 0.2);
}

/* Dag container og tabell */
.baneplan-dag {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    padding: 0 40px;
    padding-bottom: 10px;
    width: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.baneplan-dag-innhold {
    position: relative;
    width: 100%;
}

.baneplan-dag h3 {
    margin: 15px 0;
    font-size: 2,5rem;
    font-weight: bold;
    color: #005B38;
    position: sticky;
    left: 0;
    background: white;
    padding: 10px 0;
    z-index: 3;
    text-align: center;
    text-transform: capitalize;
}

.baneplan-dag-tabell {
    width: 100%;
    min-width: 800px;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    table-layout: fixed;
}

/* Tabell styling */
.baneplan-dag-tabell th,
.baneplan-dag-tabell td {
    border: 1px solid #e0e0e0;
    padding: 12px 8px;
    text-align: center;
}

.baneplan-dag-tabell th {
    background: #f8f9fa;
    font-weight: 600;
    color: #005B38;
    border-bottom: 2px solid #005B38;
}

.tid-kolonne {
    width: 80px;
    background: #f8f9fa;
    font-weight: 600;
    border-right: 2px solid #005B38 !important;
}

.section-kolonne {
    min-width: 120px;
}

/* Booking celler */
.booking-celle {
    position: relative;
    padding: 8px !important;
    height: 40px;
    vertical-align: middle !important;
    background: #ffffff;
}

.booking-celle.reservert {
    background-color: #00A766 !important;
    color: white;
    padding: 8px !important;
    transition: background-color 0.2s ease;
}

.booking-celle.reservert:hover {
    background-color: #008f55 !important;
}

.booking {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.booking-lag {
    font-weight: 600;
    font-size: 0.95em;
}

.booking-tid {
    font-size: 0.85em;
    opacity: 0.9;
}

/* Scroll indikatorer */
.scroll-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 91, 56, 0.9);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    font-size: 18px;
    padding: 0;
    outline: none;
}

.scroll-indicator:hover {
    background: rgba(0, 91, 56, 1);
    transform: translateY(-50%) scale(1.1);
}

.scroll-indicator-left {
    left: 5px;
}

.scroll-indicator-right {
    right: 5px;
}

/* Scrollbar styling */
.baneplan-dag::-webkit-scrollbar {
    height: 8px;
}

.baneplan-dag::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.baneplan-dag::-webkit-scrollbar-thumb {
    background: #005B38;
    border-radius: 4px;
}

.baneplan-dag::-webkit-scrollbar-thumb:hover {
    background: #00A766;
}

/* Modal */
.baneplan-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.close {
    position: absolute;
    right: 10px;
    top: 5px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

/* Utility classes */
.loading {
    text-align: center;
    padding: 20px;
}

.error {
    color: #dc3545;
    text-align: center;
    padding: 10px;
}

.baneplan-dag-tabell td.booking-celle.reservert:hover {
filter: brightness(90%);
}

/* Responsive styling */
@media screen and (max-width: 768px) {
    .baneplan-tittel {
        font-size: 4rem;
        margin-bottom: 15px;
    }

    .baneplan-navigasjon {
        flex-direction: column;
        gap: 10px;
    }
    
    .baneplan-periode-wrapper {
        width: 100%;
        order: -1;
    }

    .baneplan-periode {
        font-size: 1rem;
    }

    .baneplan-uke-velger {
        width: 80%;
    }

    .baneplan-prev,
    .baneplan-next {
        width: 80%;
        text-align: center;
    }

    .baneplan-dag {
        padding: 0 20px;
        margin: 0 -15px 15px -15px;
        border-radius: 0;
    }

    .baneplan-dag h3 {
        font-size: 20px;
        padding: 8px 0;
    }

    .tid-kolonne {
        width: 50px;
    }

    .section-kolonne {
        min-width: 100px;
    }

    .baneplan-dag-tabell th,
    .baneplan-dag-tabell td {
        padding: 6px;
        font-size: 14px;
    }

    .booking-lag {
        font-size: 12px;
    }

    .booking-tid {
        font-size: 11px;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 15px;
    }

    .scroll-indicator {
        width: 25px;
        height: 25px;
        font-size: 16px;
    }
}

/* Print styling */
@media print {
    .baneplan-navigasjon,
    .scroll-indicator,
    .close {
        display: none !important;
    }

    .baneplan-dag {
        page-break-inside: avoid;
        overflow: visible;
    }

    .baneplan-dag-tabell {
        min-width: 100%;
    }

    .baneplan-kalender {
        font-size: 12px;
    }

    .baneplan-tittel {
        font-size: 24px;
    }

    .baneplan-dag h3 {
        font-size: 18px;
    }
}