/* Reset og basis */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Helvetica, Arial, sans-serif;
    background: #eaeaea;
    color: #002652;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==================== HEADER MED NAVIGASJON ==================== */
.pf-header {
    background-color: #002652;
    height: 50px;
    width: 100%;
}

.pf-header-container {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
}

.pf-logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.pf-header img {
    height: 30px;
    width: auto;
}

/* ============================================
   TAB-BAR UNDER HEADER
   ============================================ */
.pf-tabs {
    background: #e8ecf0;
    padding: 10px 0;
    border-bottom: 1px solid #d0d5dc;
}

.pf-tabs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 6px;
}

.pf-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    color: #002652;
    background: transparent;
    transition: all 0.2s;
}

.pf-tab:hover {
    background: rgba(0, 38, 82, 0.08);
}

.pf-tab.active {
    background: #002652;
    color: white;
}

.pf-tab .tab-icon {
    font-size: 15px;
}

@media (max-width: 768px) {
    .pf-header-container {
        padding: 0 12px;
        gap: 10px;
    }

    .pf-header img {
        height: 24px;
    }

    .pf-tabs-container {
        padding: 0 12px;
        gap: 4px;
    }

    .pf-tab {
        padding: 8px 10px;
        font-size: 12px;
        gap: 4px;
    }
}

/* ==================== SESAMY LOGIN I HEADER ==================== */
.pf-nav-login {
    display: flex;
    align-items: center;
    margin-left: auto;
    height: 100%;
}

.pf-nav-login sesamy-login {
    --sesamy-font-family: Helvetica, Arial, sans-serif;
    --sesamy-font-size: 14px;
    --sesamy-color: rgba(255, 255, 255, 0.7);
    --sesamy-color-hover: white;
}

/* Når brukeren er innlogget - profil-ikon styling */
.pf-nav-login sesamy-login::part(button) {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.pf-nav-login sesamy-login::part(button):hover {
    color: white;
}

.btn-calendar,
.calendar-banner {
    display: none;
}

/* Vises når bruker har tilgang */
body.sesamy-access .btn-calendar {
    display: block;
}

body.sesamy-access .calendar-banner {
    display: flex;
}

@media (max-width: 768px) {
    .pf-nav-login {
        padding: 0 10px;
        margin-left: 4px;
    }
    
    .pf-nav-login sesamy-login {
        --sesamy-font-size: 13px;
    }
}

/* ==================== CONTAINER ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Uke-navigasjon */
.week-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 20px;
    border-radius: 2px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.week-nav-arrow {
    color: #002652;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 2px;
    transition: background 0.2s;
}

.week-nav-arrow:hover {
    background: #f0f0f0;
}

.week-nav-arrow .arrow-text {
    display: inline;
}

.week-info {
    text-align: center;
}

.week-number {
    font-size: 20px;
    font-weight: 600;
    color: #002652;
    display: block;
}

.week-dates {
    font-size: 13px;
    color: #666;
}

/* Mobil: Kompakt uke-nav */
@media (max-width: 768px) {
    .week-nav {
        background: #002652;
        padding: 10px 15px;
        margin-bottom: 0;
        border-radius: 0;
        box-shadow: none;
    }
    
    .week-nav-arrow {
        color: white;
        padding: 8px;
        font-size: 18px;
    }
    
    .week-nav-arrow:hover {
        background: rgba(255,255,255,0.1);
    }
    
    .week-nav-arrow .arrow-text {
        display: none;
    }
    
    .week-number {
        color: white;
        font-size: 16px;
        display: inline;
    }
    
    .week-dates {
        color: rgba(255,255,255,0.8);
        font-size: 12px;
        display: block;
        margin-top: 2px;
    }
}

/* Dag-velger */
.day-selector {
    display: flex;
    gap: 6px;
    margin-bottom: 15px;
    background: #002652;
    padding: 8px;
    border-radius: 2px;
}

.day-tab {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    text-decoration: none;
    color: rgba(255,255,255,0.8);
    transition: all 0.2s;
    position: relative;
}

.day-tab:hover {
    background: rgba(255,255,255,0.2);
}

.day-tab.active {
    background: white;
    color: #002652;
}

.day-tab.today::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: #e74c3c;
    border-radius: 50%;
}

.day-tab.active.today::after {
    background: #e74c3c;
}

.day-tab:not(.has-events) {
    opacity: 0.5;
}

.day-tab.active:not(.has-events) {
    opacity: 0.8;
}

/* Skjul dag-velger på desktop i grid-modus */
.day-selector.hide-on-desktop {
    display: none;
}

@media (max-width: 768px) {
    .day-selector.hide-on-desktop {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 50;
    }
}

.day-name {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.day-num {
    font-size: 16px;
    font-weight: 600;
}

/* Visnings-toggle */
.view-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .view-toggle {
        margin: 10px;
        gap: 8px;
    }
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: white;
    border-radius: 2px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.toggle-btn:hover {
    background: #f5f5f5;
}

.toggle-btn.active {
    background: #002652;
    color: white;
}

.toggle-btn svg {
    opacity: 0.7;
}

.toggle-btn.active svg {
    opacity: 1;
}

/* Norwegian filter button */
.norwegian-filter-btn {
    font-size: 16px;
    padding: 8px 12px;
}

.norwegian-filter-btn.active {
    background: #ba0c2f;
}

/* Stream filter button */
.stream-filter-btn {
    font-size: 16px;
    padding: 8px 12px;
}

.stream-filter-btn.active {
    background: #1a73e8;
}

/* Filter notice banner */
.filter-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #ba0c2f 0%, #002652 100%);
    color: white;
    border-radius: 2px;
    margin-bottom: 16px;
    font-size: 14px;
}

.filter-notice-icon {
    font-size: 16px;
}

.filter-notice-text {
    flex: 1;
}

.filter-notice-clear {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 2px;
    font-size: 13px;
    transition: all 0.2s;
}

.filter-notice-clear:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

/* No events */
.no-events {
    background: white;
    padding: 60px 20px;
    text-align: center;
    border-radius: 2px;
    color: #666;
}

.no-events p {
    margin-bottom: 20px;
    font-size: 16px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #002652;
    color: white;
    text-decoration: none;
    border-radius: 2px;
    font-size: 14px;
    transition: background 0.2s;
}

.btn:hover {
    background: #003d7a;
}

/* ==================== GRID VISNING - Dag-sortert ==================== */
.days-grid {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.days-grid[data-columns="1"] .day-column { max-width: 300px; }
.days-grid[data-columns="2"] .day-column { max-width: 300px; }
.days-grid[data-columns="3"] .day-column { max-width: 280px; }
.days-grid[data-columns="4"] .day-column { max-width: 260px; }
.days-grid[data-columns="5"] .day-column { max-width: 240px; }
.days-grid[data-columns="6"] .day-column { max-width: 220px; }
.days-grid[data-columns="7"] .day-column { max-width: 200px; }

.day-column {
    flex: 1;
    background: white;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    min-height: 200px;
}

.day-column.is-today {
    box-shadow: 0 0 0 2px #e74c3c, 0 2px 8px rgba(0,0,0,0.15);
}

.day-column-header {
    background: #002652;
    color: white;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.day-column.is-today .day-column-header {
    background: linear-gradient(135deg, #002652 0%, #1a4a7a 100%);
}

.day-column-name {
    font-size: 13px;
    font-weight: 500;
}

.day-column-num {
    font-size: 22px;
    font-weight: 600;
}

.day-column-content {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.session-card {
    background: #f8f9fa;
    border-radius: 2px;
    padding: 10px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    position: relative;
    border-left: 3px solid #002652;
}

.session-card:hover {
    background: #eef1f4;
    transform: translateX(2px);
}

.session-card-badges {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 14px;
}

.session-card-badges .session-card-stream {
    text-decoration: none;
    margin: 0;
    display: block;
}

.session-card-badges .norwegian-badge {
    display: none;
}

/* Norsk flagg-gradient i hjørnet */
.session-card.has-norwegian {
    overflow: hidden;
}

.session-card.has-norwegian::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: -4px;
    width: 44px;
    height: 44px;
    background: url('img/flag.png') center/cover no-repeat;
    transform: rotate(-149deg);
    pointer-events: none;
    -webkit-mask-image: radial-gradient(circle at 30% 60%, rgba(0,0,0,0.8) 0%, transparent 55%);
    mask-image: radial-gradient(circle at 30% 60%, rgba(0,0,0,0.8) 0%, transparent 55%);
}

.session-card-time {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    margin-bottom: 4px;
}

.session-card-series {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.session-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #002652;
    margin: 4px 0;
    line-height: 1.2;
}

.session-card-event {
    font-size: 11px;
    color: #666;
}

.session-card-stream {
    display: inline-block;
    margin-top: 6px;
    font-size: 14px;
    text-decoration: none;
}

.session-card-stream:hover {
    transform: scale(1.1);
}

/* Avlyste sessions */
.session-card.cancelled {
    opacity: 0.6;
    border-left-color: #c0392b;
}

.session-card.cancelled .session-card-name,
.session-card.cancelled .session-card-series,
.session-card.cancelled .session-card-event {
    text-decoration: line-through;
    text-decoration-color: #c0392b;
    color: #c0392b;
}

.timeline-session.cancelled {
    opacity: 0.6;
}

.timeline-session.cancelled .session-name {
    text-decoration: line-through;
    text-decoration-color: #c0392b;
    color: #c0392b;
}

/* ==================== TIDSLINJE VISNING ==================== */
.timeline-view {
    background: white;
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.timeline-header {
    background: #002652;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-date {
    font-size: 18px;
    font-weight: 500;
}

.timeline-zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.zoom-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 18px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.zoom-btn:hover {
    background: rgba(255,255,255,0.3);
}

.zoom-level {
    font-size: 13px;
    min-width: 30px;
    text-align: center;
}

/* Scroll container */
.timeline-scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
}

/* Custom scrollbar */
.timeline-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.timeline-scroll-container::-webkit-scrollbar-track {
    background: #f0f2f5;
}

.timeline-scroll-container::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 4px;
}

.timeline-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

.timeline-content {
    min-width: 100%;
    position: relative;
}

/* Timeline scale */
.timeline-scale {
    display: flex;
    height: 35px;
    background: #f0f2f5;
    border-bottom: 1px solid #ddd;
    position: relative;
    margin-left: 140px; /* Samme som label-bredden */
}

.hour-marker {
    position: absolute;
    height: 100%;
    border-left: 1px solid #ddd;
    display: flex;
    align-items: center;
    padding-left: 8px;
    box-sizing: border-box;
}

.hour-label {
    font-size: 11px;
    color: #666;
    white-space: nowrap;
}

/* NÅ-markør som strekker seg gjennom alle rader */
.now-marker-full {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 100;
    pointer-events: none;
    margin-left: 140px;
}

.now-line-full {
    position: absolute;
    top: 35px;
    bottom: 0;
    width: 2px;
    background: #e74c3c;
}

.now-label {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    background: #e74c3c;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 2px;
    white-space: nowrap;
}

/* Event-rader */
.timeline-events {
    position: relative;
}

.timeline-event-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #eee;
    min-height: 44px;
}

.timeline-event-row:last-child {
    border-bottom: none;
}

.timeline-event-label {
    width: 140px;
    flex-shrink: 0;
    padding: 6px 10px;
    background: #002652;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: sticky;
    left: 0;
    z-index: 10;
}

.event-series-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    opacity: 0.7;
}

.event-name-label {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    margin-top: 2px;
}

.timeline-track {
    flex: 1;
    position: relative;
    height: 44px;
    background: #f8f9fa;
}

.timeline-session {
    position: absolute;
    top: 4px;
    height: 36px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 6px;
}

.timeline-session:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 5;
}

.timeline-session.past {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    opacity: 0.7;
}

.timeline-session.live {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
}

.timeline-session .session-name {
    font-size: 12px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.timeline-session .session-time {
    font-size: 10px;
    color: rgba(255,255,255,0.8);
}

/* Navigasjon mellom sider */
.page-nav {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.page-nav-link {
    flex: 1;
    padding: 12px 20px;
    text-align: center;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.page-nav-link:hover {
    background: #f5f5f5;
    color: #002652;
}

.page-nav-link.active {
    color: #002652;
    border-bottom-color: #002652;
    background: #f8f9fa;
}

@media (max-width: 768px) {
    .page-nav {
        margin: 0 0 0 0;
        border-radius: 0;
    }
    
    .page-nav-link {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.open {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 2px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    z-index: 1;
    line-height: 1;
    padding: 5px;
}

.modal-close:hover {
    color: white;
}

/* Modal header med arrangement-info */
.modal-header-content {
    background: linear-gradient(135deg, #002652 0%, #003d7a 100%);
    padding: 20px;
    color: white;
}

.modal-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.3;
}

.modal-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-meta-series {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-meta-separator {
    opacity: 0.5;
    margin: 0 2px;
}

.modal-meta-circuit {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Førere i modal */
.modal-drivers {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.modal-drivers h4 {
    font-size: 14px;
    color: #002652;
    margin-bottom: 15px;
}

.drivers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.driver-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px 15px;
    border-radius: 2px;
    text-decoration: none;
    color: #002652;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.driver-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.driver-card img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.driver-name {
    font-weight: 500;
    font-size: 14px;
}

/* Sessions i modal */
.modal-sessions {
    padding: 20px;
}

.modal-sessions h4 {
    font-size: 14px;
    color: #002652;
    margin-bottom: 15px;
}

.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.session-row {
    display: grid;
    grid-template-columns: 80px 100px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 2px;
    font-size: 13px;
}

.session-row .session-date {
    color: #666;
    font-size: 12px;
}

.session-row .session-time {
    color: #002652;
    font-weight: 500;
}

.session-row .session-name {
    color: #333;
}

.session-icons {
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.session-icons a {
    text-decoration: none;
}

/* Modal responsive */
@media (max-width: 768px) {
    .modal-header-content {
        padding: 16px;
    }
    
    .modal-title {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .modal-meta-series {
        font-size: 13px;
    }
    
    .modal-meta-circuit {
        font-size: 12px;
    }
    
    .modal-content {
        max-height: 85vh;
    }
    
    .session-row {
        grid-template-columns: 1fr 1fr;
        gap: 5px;
    }
    
    .session-row .session-date {
        grid-column: 1;
    }
    
    .session-row .session-time {
        grid-column: 2;
        text-align: right;
    }
    
    .session-row .session-name {
        grid-column: 1 / -1;
    }
    
    .session-icons {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

/* Legg dette til i slutten av din eksisterende helg/styles.css */

/* ==========================================
   KALENDER BANNER OG MODAL
   ========================================== */

/* Utility classes */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* Calendar banner for mobile */
.calendar-banner {
    display: none;
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 0;
    margin-bottom: 0;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.calendar-banner:active {
    transform: scale(0.98);
}

.calendar-banner-icon {
    font-size: 18px;
    margin-right: 10px;
}

.calendar-banner-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.calendar-banner-arrow {
    font-size: 16px;
    opacity: 0.8;
}

/* Calendar button in view toggle */
.calendar-btn {
    margin-left: auto;
    background: #0066cc;
    border: none;
    padding: 8px 12px;
    font-size: 14px;
}

.calendar-btn:hover {
    background: #0055aa;
}

/* Calendar Modal */
.calendar-modal {
    z-index: 1001;
}

.calendar-modal-content {
    max-width: 540px;
    border-radius: 12px;
}

.calendar-modal-header {
    background: #002652;
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.calendar-modal-header h2 {
    font-size: 17px;
    font-weight: 500;
    margin: 0;
}

.calendar-modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-intro {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.modal-notice {
    font-size: 13px;
    color: #92400e;
    background: #fef3c7;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Radio options */
.calendar-option {
    margin-bottom: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 14px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.radio-option:hover {
    background: #f0f1f3;
}

.radio-option:has(input:checked) {
    border-color: #0066cc;
    background: #f0f7ff;
}

.radio-option input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    accent-color: #0066cc;
}

.radio-option input[type="radio"]:checked + .radio-label {
    font-weight: 500;
    color: #002652;
}

.radio-label {
    font-size: 15px;
    color: #333;
}

/* Series selector */
.series-selector {
    margin-top: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.series-selector.hidden {
    display: none;
}

/* Category accordion */
.category-accordion {
    border-bottom: 1px solid #e5e7eb;
}

.category-accordion:last-child {
    border-bottom: none;
}

.category-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.2s;
}

.category-header:hover {
    background: #f0f1f3;
}

.category-name {
    font-weight: 500;
    color: #002652;
    font-size: 14px;
}

.category-count {
    font-size: 12px;
    color: #9ca3af;
    margin-left: auto;
    margin-right: 12px;
}

.accordion-arrow {
    font-size: 10px;
    color: #9ca3af;
    transition: transform 0.3s;
}

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: white;
}

.category-content.open {
    max-height: 500px;
}

.category-actions {
    padding: 10px 16px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    gap: 16px;
}

.btn-link {
    background: none;
    border: none;
    color: #0066cc;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Series checkboxes */
.series-checkbox {
    display: flex;
    align-items: center;
    padding: 11px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s;
}

.series-checkbox:last-child {
    border-bottom: none;
}

.series-checkbox:hover {
    background: #fafafa;
}

.series-checkbox input[type="checkbox"] {
    margin-right: 12px;
    width: 16px;
    height: 16px;
    accent-color: #0066cc;
}

.checkbox-label {
    font-size: 14px;
    color: #374151;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
}

.event-count {
    font-size: 12px;
    color: #9ca3af;
}

/* Subscribe section */
.subscribe-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.btn-subscribe {
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.btn-subscribe:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
}

.btn-subscribe:active {
    transform: translateY(0);
}

.btn-subscribe:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.subscribe-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 10px;
}

/* Mobile responsive for calendar */
@media (max-width: 768px) {
    .mobile-only {
        display: flex;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .calendar-modal-body {
        padding: 15px;
    }
    
    .radio-option {
        padding: 12px 14px;
    }
    
    .category-header {
        padding: 12px 14px;
    }
    
    .series-checkbox {
        padding: 10px 14px;
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1000px) {
    .days-grid {
        flex-wrap: wrap;
    }
    
    .days-grid .day-column {
        min-width: 180px;
        max-width: none !important;
        flex: 1 1 calc(33% - 10px);
    }
}

@media (max-width: 768px) {
    .pf-header-title {
        font-size: 1rem;
        position: static;
        transform: none;
        margin-left: auto;
    }
    
    .pf-header-container {
        justify-content: space-between;
    }
    
    .container {
        padding: 0;
    }
    
    .content {
        padding: 10px;
    }
    
    .grid-view {
        padding: 0;
    }
    
    .days-grid {
        gap: 0;
    }
    
    .days-grid .day-column {
        border-radius: 0;
        box-shadow: none;
        border-bottom: 1px solid #eee;
        flex: 1 1 100%;
        min-width: auto;
        min-height: auto;
    }
    
    .day-selector {
        gap: 4px;
        padding: 6px;
        border-radius: 0;
        margin-bottom: 0;
    }
    
    .day-tab {
        padding: 6px 4px;
        min-width: 0;
    }
    
    .day-name {
        font-size: 10px;
    }
    
    .day-num {
        font-size: 14px;
    }
    
    .day-column {
        min-height: auto;
    }
    
    .timeline-event-row {
        min-height: 36px;
    }
    
    .timeline-track {
        height: 36px;
    }
    
    .timeline-session {
        top: 3px;
        height: 30px;
        padding: 0 4px;
    }
    
    .timeline-session .session-name {
        font-size: 9px;
    }
    
    .timeline-session .session-time {
        font-size: 8px;
    }
    
    .timeline-event-label {
        width: 100px;
        padding: 4px 8px;
    }
    
    .timeline-scale {
        margin-left: 100px;
        height: 30px;
    }
    
    .now-marker-full {
        margin-left: 100px;
    }
    
    .now-line-full {
        top: 30px;
    }
    
    .event-series-label {
        font-size: 8px;
    }
    
    .event-name-label {
        font-size: 10px;
    }
    
    .timeline-header {
        flex-direction: column;
        gap: 10px;
        padding: 12px 15px;
    }
    
    .timeline-date {
        font-size: 16px;
    }
    
    .hour-label {
        font-size: 10px;
    }
    
    .modal-content {
        max-height: 85vh;
    }
    
    .session-row {
        grid-template-columns: 1fr 1fr;
        gap: 5px;
    }
    
    .session-row .session-date {
        grid-column: 1;
    }
    
    .session-row .session-time {
        grid-column: 2;
        text-align: right;
    }
    
    .session-row .session-name {
        grid-column: 1 / -1;
    }
    
    .session-icons {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (max-width: 500px) {
    .days-grid .day-column {
        flex: 1 1 100%;
    }
    
    .timeline-event-row {
        min-height: 32px;
    }
    
    .timeline-track {
        height: 32px;
    }
    
    .timeline-session {
        top: 2px;
        height: 28px;
        padding: 0 3px;
    }
    
    .timeline-session .session-name {
        font-size: 8px;
    }
    
    .timeline-session .session-time {
        display: none;
    }
    
    .timeline-event-label {
        width: 70px;
        padding: 3px 5px;
    }
    
    .timeline-scale {
        margin-left: 70px;
        height: 26px;
    }
    
    .now-marker-full {
        margin-left: 70px;
    }
    
    .now-line-full {
        top: 26px;
    }
    
    .event-series-label {
        font-size: 7px;
    }
    
    .event-name-label {
        font-size: 9px;
    }
    
    .hour-label {
        font-size: 9px;
    }
    
    .day-selector {
        gap: 2px;
        padding: 4px;
    }
    
    .day-tab {
        padding: 4px 2px;
    }
    
    .day-name {
        font-size: 8px;
    }
    
    .day-num {
        font-size: 12px;
    }
}

/* =====================================================
   CSS for sessions som krysser midnatt
   Legg til i din CSS-fil eller <style>-tag
   ===================================================== */

/* Session som fortsetter fra forrige dag (starter med ←) */
.timeline-session.is-continuation {
    border-left: 3px solid rgba(255,255,255,0.6);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Session som fortsetter til neste dag (ender med →) */
.timeline-session.is-truncated {
    border-right: 3px solid rgba(255,255,255,0.6);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Session som både er continuation OG truncated (midtdel av et langt løp) */
.timeline-session.is-continuation.is-truncated {
    border-left: 3px solid rgba(255,255,255,0.6);
    border-right: 3px solid rgba(255,255,255,0.6);
    border-radius: 0;
}