/**
 * Event Schedule Plugin Styles
 * 
 * Main stylesheet for the event schedule display
 * 
 * @since 1.0.0
 */

/* Event Schedule Plugin Styles */

.event-schedule-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 20px 0 64px;
}

/* Schedule Filters */
.schedule-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.filter-group select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    min-width: 200px;
    transition: border-color 0.2s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-left:auto;
}

.filter-apply {
    background: #000;
    color: white;
    border: 1px solid #000;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.filter-apply:hover {
    background: #fff;
    color: #000;
}

.filter-apply:focus {
    outline: none;
    background: #fff;
    color: #000;
}

/* Schedule Legend */
.schedule-legend {
    margin-bottom: 20px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.legend-label {
    color: #333;
}

/* Dynamic Timeline Debug Area */
.dynamic-timeline-debug {
    background: #f8f9fa;
    border: 2px solid #007cba;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.dynamic-timeline-debug h3 {
    margin: 0 0 15px 0;
    color: #007cba;
    font-size: 18px;
    font-weight: 600;
}

.debug-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.debug-section {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.debug-section h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.debug-section p {
    margin: 5px 0;
    font-size: 14px;
    color: #555;
}

.debug-section strong {
    color: #333;
    font-weight: 600;
}

.debug-details {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.debug-details h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.debug-details p {
    margin: 5px 0;
    font-size: 14px;
    color: #555;
}

.debug-details strong {
    color: #333;
    font-weight: 600;
}

/* Schedule Grid Wrapper */
.schedule-grid-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto; /* Always enable vertical scroll */
    border-radius: 8px;
    scroll-behavior: smooth; /* Smooth scrolling */
    max-height: 80vh; /* Add max-height to enable vertical scroll in all viewports */
}

/* Schedule Grid */
.schedule-grid {
    display: grid;
    gap: 1px;
    background: #e9ecef;
    border-radius: 8px;
    position: relative;
    /* Grid template columns and min-width will be set dynamically by JavaScript */
    /* No overflow properties - wrapper handles all scrolling */
}

/* Custom scrollbar styling for better UX */
.schedule-grid::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

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

.schedule-grid::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.schedule-grid::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Firefox scrollbar styling */
.schedule-grid {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* Timeline Column */
.timeline-column {
    background: white;
    position: sticky;
    left: 0;
    z-index: 30; /* Increased from 10 to prevent overlay issues */
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e9ecef; /* Add right border to separate from venue columns */
}

.timeline-header {
    background: #000000;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 40; /* Increased from 20 to prevent overlay issues */
    flex-shrink: 0;
}

.timeline-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.time-slots {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.time-slot {
    padding: 5px 10px 10px;
    text-align: center;
    border-bottom: 2px solid #f1f3f4;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    height: 100px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    box-sizing: border-box;
    flex-shrink: 0;
}

.time-slot:last-child {
    border-bottom: none;
}

/* Venue Columns */
.venue-column {
    background: white;
    display: flex;
    flex-direction: column;
}

.venue-header {
    background: #000000;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 150;
    flex-shrink: 0;
}

.venue-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
    line-height: 1.3;
}

.events-container {
    position: relative;
    flex: 1;
    min-height: 600px;
}

.no-events {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Ensure proper grid layout */
.schedule-grid > * {
    min-height: 100%;
}

/* Event Blocks */
.event-block {
    position: absolute;
    left: 5px;
    right: 5px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-style: inset;
    border-radius: 6px;
    padding: 12px;
    /*margin: 2px 0;*/
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    box-sizing: border-box;
}

.event-block:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    border-color: rgba(0, 0, 0, 0.2);
    height: fit-content;
    max-height: unset !important;
}

.event-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.event-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
}

.event-title a {
    color: inherit;
    text-decoration: none;
    display: block;
    width: 100%;
    height: 100%;
    color: black !important;
}

.event-block:hover .event-title a {
    color:black !important;
    text-decoration: underline;
}

.event-time {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.event-track {
    font-size: 12px;
    color: #000;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-excerpt {
    font-size: 13px;
    color: #555;
    line-height: 1.4;
    margin-top: auto;
}

/* Track-specific colors - Updated to 3STN brand colors */
.event-block.track-design-strategy {
    background: #b488f7; /* GRAU (darker) */
    color: #333;
}

.event-block.track-design-industry {
    background: #F5F5F5; /* GRAU (light) */
}

.event-block.track-design-tech {
    background: #F4EFFE; /* LILA 30% variant */
}

.event-block.track-design-policy-society {
    background: #D4B8F9; /* LILA (solid equivalent of #b488f799) */
    color: #333;
}

.event-block.track-design-learning {
    background: #FFBAF0; /* PINK */
}

.event-block.track-design-for-planet {
    background: #E1FDF3; /* TÜRKIS variant - slightly different green */
}

/* Loading and Error States */
.schedule-loading,
.schedule-error {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    color: #dc3545;
    font-weight: 600;
}

/* No Venues Message */
.no-venues {
    grid-column: 2 / -1;
    padding: 40px 20px;
    text-align: center;
    color: #666;
    background: white;
}

/* Responsive Design */
@media (min-width: 1253px) {
    /* Above 1252px: Keep original behavior - no special column expansion needed */
}

@media (max-width: 1252px) {
    .schedule-grid-wrapper {
        overflow-x: auto; /* Enable horizontal scroll when viewport is too narrow */
    }
    
    /* Grid keeps its fixed width, wrapper handles overflow */
    
    /* Ensure timeline column stays visible during horizontal scroll */
    .timeline-column {
        position: sticky;
        left: 0;
        z-index: 200;
    }
}

@media (max-width: 1400px) {
    /* Remove old conflicting rules - wrapper now handles this */
}

@media (max-width: 768px) {
    .schedule-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group select {
        min-width: auto;
    }
    
    /* Grid template columns will be set dynamically by JavaScript */
    
    .timeline-header h3,
    .venue-header h3 {
        font-size: 14px;
    }
    
    .event-title {
        font-size: 14px;
    }
    
    .event-time,
    .event-track {
        font-size: 12px;
    }
    
    .event-excerpt {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    /* Grid template columns will be set dynamically by JavaScript */
    
    .time-slot {
        padding: 10px 5px;
        font-size: 12px;
        height: 100px; /* Maintain 100px height on mobile */
    }
    
    .event-block {
        padding: 8px;
    }
    
    .event-title {
        font-size: 13px;
    }
}
