/* Timeline Styles for Congres Frans Core Plugin */

.timeline {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.timeline-grid {
    display: block;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.timeline-row {
    display: grid;
    grid-template-columns: 120px 1fr 1fr;
    height: 30px;
    border-bottom: 1px solid #e0e0e0;
}

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

.timeline-time-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    font-size: 0.85em;
    font-weight: 600;
    color: #495057;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    height: 30px;
    max-height: 30px;
}

.timeline-time-cell:first-child {
    background: #e9ecef;
    font-size: 1em;
    font-weight: 700;
    color: #212529;
}

/* Unified header cell styling for time/day headers */
.timeline-header-cell {
    background: #e9ecef !important;
    font-size: 1em !important;
    font-weight: 700 !important;
    color: #212529 !important;
    padding: 5px 8px !important;
}

.timeline-content-cell {
    padding: 8px 12px;
    display: flex;
    align-items: stretch;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    overflow: hidden;
}

.timeline-content-cell:last-child {
    border-right: none;
}

.timeline-content-cell.empty {
    background: #f8f9fa;
}

.timeline-content-cell.thursday {
    background: #ffffff;
}

.timeline-content-cell.friday {
    background: #f8f9fa;
}

.timeline-item {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 2px solid #ce1126;
    width: 100%;
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 3px 6px;
    min-height: 30px;
}

/* Ensure items fill the spanned grid cell height */
.timeline-content-cell > .timeline-item {
    height: 100%;
}

.timeline-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.timeline-item.timeline-card {
    border-left-color: #28a745;
}

.timeline-img-header {
    height: 120px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.timeline-img-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0,0,0,0.4), rgba(0,0,0,0.2));
}

.timeline-content {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    overflow: hidden;
    min-width: 0; /* allow flex child to shrink and avoid overflow */
}
.timeline-summary {
    list-style: none;
    cursor: pointer;
    position: relative;
    padding-left: 18px;
}
.timeline-summary::-webkit-details-marker { display: none; }
.timeline-hint { color: var(--wp--preset--color--primary-accent); font-size: 0.85em; }

/* Dropdown chevron */
.timeline-summary::after {
    content: "▾";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wp--preset--color--primary-accent);
    font-size: 0.95em;
    transition: transform 0.2s ease;
}
details[open] .timeline-summary::after {
    transform: translateY(-50%) rotate(180deg);
}

.timeline-details {
    margin-top: 8px;
    overflow: visible;
    flex: initial;
    min-height: auto;
}

.timeline-title {
    font-size: 0.9em;
    color: #333;
    margin: 0 0 2px 0;
    font-weight: 600;
    line-height: 1.2;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.timeline-round,
.timeline-room {
    font-size: 0.75em;
    color: #666;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-round {
    font-weight: 500;
    color: #002654;
}

.timeline-room a {
    color: #007cba;
    text-decoration: none;
}

.timeline-room a:hover {
    text-decoration: underline;
}

.timeline-room a:hover {
    text-decoration: underline;
}

.timeline-day-header {
    text-align: center;
    margin: 0 0 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Hide mobile Friday section on desktop */
.timeline-mobile-friday {
    display: none;
}
/* Hide mobile Thursday section on desktop */
.timeline-mobile-thursday {
    display: none;
}

.timeline-date {
    font-size: 1.8em;
    color: white;
    margin: 0;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .timeline {
        padding: 15px;
    }

    /* Hide desktop grid on mobile */
    .timeline-grid,
    .desktop-grid {
        display: none !important;
    }
    /* Show mobile day grids on mobile */
    .timeline-mobile-thursday,
    .timeline-mobile-friday {
        display: block;
    }

    .timeline-row {
        grid-template-columns: 80px 1fr;
    }
    
    .timeline-time-cell {
        padding: 10px 5px;
        font-size: 0.8em;
    }
    
    .timeline-content-cell {
        padding: 10px 15px;
    }
    
    .timeline-date {
        font-size: 1.5em;
    }
    
    .timeline-title {
        font-size: 1em;
    }
    
    .timeline-img-header {
        height: 100px;
    }
    
    /* Hide Friday column on mobile - target all Friday cells */
    .timeline-content-cell.friday {
        display: none !important;
    }
    
    /* Show mobile Friday section */
    .timeline-mobile-friday {
        display: block;
        margin-top: 30px;
    }
    /* Show mobile Thursday section */
    .timeline-mobile-thursday {
        display: block;
        margin-bottom: 20px;
    }
    
    .timeline-mobile-grid {
        display: block;
        border: 1px solid #e0e0e0;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        max-width: 100%;
    }
    
    .timeline-mobile-row {
        display: grid;
        grid-template-columns: 60px 1fr;
        height: 30px;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .timeline-mobile-row:last-child {
        border-bottom: none;
    }
    
    .timeline-mobile-time {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 5px 4px;
        font-size: 0.75em;
        font-weight: 600;
        color: #495057;
        border-right: 1px solid #e0e0e0;
        border-bottom: 1px solid #e0e0e0;
        border-top: 1px solid #e0e0e0;
        background: #f8f9fa;
        height: 30px;
        max-height: 30px;
    }
    
    .timeline-mobile-row:first-child .timeline-mobile-time,
    .timeline-mobile-row:first-child .timeline-mobile-content {
        background: #e9ecef;
        font-size: 1em;
        font-weight: 700;
        color: #212529;
    }
    
    .timeline-mobile-content {
        padding: 5px 8px;
        display: flex;
        align-items: stretch;
        border-bottom: 1px solid #e0e0e0;
        border-left: 1px solid #e0e0e0;
        border-top: 1px solid #e0e0e0;
    align-self: stretch;
    min-width: 0; /* avoid overflow in flex */
    }
    .timeline-mobile-content > .timeline-item {
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    .timeline-mobile-content.empty {
        background: #ffffff;
        border-bottom: 1px solid #e0e0e0;
        border-left: 1px solid #e0e0e0;
    }
    /* Allow text to wrap on small screens to prevent overflow */
    .timeline-title,
    .timeline-round,
    .timeline-room {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    .timeline-row {
        grid-template-columns: 60px 1fr;
    }
    
    .timeline-time-cell {
        padding: 8px 3px;
        font-size: 0.7em;
    }
    
    .timeline-content-cell {
        padding: 8px 10px;
    }
    
    .timeline-mobile-row {
        grid-template-columns: 50px 1fr;
    }
    
    .timeline-mobile-time {
        padding: 8px 3px;
        font-size: 0.7em;
    }
    
    .timeline-mobile-content {
        padding: 8px 10px;
    }
}

/* Notice Styles */
.notice {
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    border-left: 4px solid;
}

.notice-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.notice-info {
    background-color: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}
