/* PaddockWeather V2 - F1 TV Official Design */

/* CSS Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #0d1117;
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.4;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* F1 Header */
.f1-header {
    background: #1a1a1a;
    border-bottom: 2px solid #e10600;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.f1-badge {
    background: #e10600;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 2px;
    color: #ffffff;
}

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.units-settings-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #333;
    color: #ffffff;
    padding: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.units-settings-btn:hover {
    background: rgba(0, 255, 136, 0.1);
    border-color: #00ff88;
    color: #00ff88;
    transform: translateY(-2px);
}

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

/* Main Content */
.main-content {
    padding: 2rem 0;
}

/* View Containers */
.view-container {
    transition: opacity 0.3s ease;
}

.view-container.hidden {
    display: none;
}

.view-container.active {
    display: block;
}

/* Hero Dashboard */
.hero-dashboard {
    background: #1a1a1a;
    border-radius: 8px;
    border: 2px solid #333;
    padding: 2rem;
    margin-bottom: 2rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.title-section h2 {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.title-section p {
    color: #888;
    font-size: 1rem;
}

/* Status Indicators */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #0d1117;
    padding: 0.8rem 1.2rem;
    border-radius: 6px;
    border: 2px solid #333;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.live {
    background: #8B5CF6;
}

.status-dot.weekend {
    background: #00ff88;
}

.status-dot.off-season {
    background: #00ff88;
}

.status-text {
    font-weight: bold;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Session Title Bar */
.session-title-bar {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #333;
}

.session-title-bar h1 {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 0.5rem;
    letter-spacing: 3px;
}

.session-title-bar p {
    color: #888;
    font-size: 1.1rem;
}

/* Timezone Display in Session Title */
.session-title-bar .timezone-display {
    color: #666;
    font-size: 0.75rem;
    margin-top: 1.2rem;
    text-align: center;
    opacity: 0.7;
    font-weight: normal;
    letter-spacing: 0.5px;
}

/* Live View Weather Grid (3x3) */
.weather-grid.live-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.weather-metric {
    background: #0d1117;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.weather-metric:hover {
    border-color: #00ff88;
    transform: translateY(-2px);
}

.metric-value {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 2.2rem;
    font-weight: bold;
    color: #00ff88;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.weather-metric.session-timer {
    border-color: #333;
    background: #1a1a1a;
}

.weather-metric.session-timer .metric-value {
    color: #ffffff;
    font-size: 2.5rem;
}

.metric-label {
    font-size: 0.85rem;
    font-weight: bold;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Weekend Sessions Grid */
.sessions-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.sessions-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.session-item {
    background: #0d1117;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 1.2rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 1rem;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.session-item:hover {
    border-color: #00ff88;
    background: #1a1a1a;
}

.session-item.completed {
    opacity: 0.6;
    cursor: default;
}

.session-item.completed:hover {
    border-color: #333;
    background: #0d1117;
}

.session-item.next {
    border-color: #00ff88;
}

.session-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #ffffff;
}

.session-time {
    font-family: 'Consolas', 'Monaco', monospace;
    color: #888;
    font-weight: bold;
}

.session-temp {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: #00ff88;
}

.session-rain {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: #00ff88;
}

/* Weekend Timing Display */
.timing-display.weekend-timing {
    background: #0d1117;
    border: 2px solid #00ff88;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    min-width: 250px;
}

.countdown-time {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 2.5rem;
    font-weight: bold;
    color: #00ff88;
    margin-bottom: 0.5rem;
}

.countdown-label {
    font-size: 0.9rem;
    font-weight: bold;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Off-Season Countdown Grid */
.countdown-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.countdown-item {
    background: #0d1117;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    min-width: 120px;
}

.countdown-number {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 3rem;
    font-weight: bold;
    color: #00ff88;
    margin-bottom: 0.5rem;
}

.countdown-label {
    font-size: 0.9rem;
    font-weight: bold;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Race Dates */
.race-dates {
    display: flex;
    justify-content: center;
}

.race-date-item {
    background: #00ff88;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    text-align: center;
}

.date-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: #0d1117;
    margin-bottom: 0.5rem;
}

.date-label {
    font-size: 1rem;
    font-weight: bold;
    color: #0d1117;
    letter-spacing: 1px;
}

/* Sessions Preview */
.sessions-preview {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #333;
}

.sessions-preview h3 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 2rem;
    letter-spacing: 2px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.preview-grid .session-item {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 0.5rem;
}

/* Info Cards Row */
.info-cards-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
    margin-bottom: 2rem;
    width: 100%;
}

.info-card {
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 8px;
    overflow: hidden;
    min-width: 0; /* Prevent grid overflow */
}

.card-header {
    background: #0d1117;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: space-between;
}

.card-header i {
    color: #00ff88;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.card-header span {
    font-weight: bold;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    flex-grow: 1;
}

.card-content {
    padding: 1.5rem;
}

/* Next Session Clickable Item */
.next-session-item.clickable {
    cursor: pointer;
    padding: 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
}

.next-session-item.clickable:hover {
    background: rgba(0, 255, 136, 0.1);
    border-color: #00ff88;
    transform: translateY(-2px);
}

.click-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #666;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.next-session-item.clickable:hover .click-indicator {
    opacity: 1;
    color: #00ff88;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Timer Animation */
.timer-display {
    animation: timer-glow 2s ease-in-out infinite alternate;
}

@keyframes timer-glow {
    from {
        text-shadow: 0 0 5px #ffffff;
    }
    to {
        text-shadow: 0 0 20px #ffffff, 0 0 30px #ffffff;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .sessions-container {
        flex-direction: column;
        gap: 2rem;
    }
    
    .timing-display.weekend-timing {
        min-width: auto;
        width: 100%;
    }
    
    /* Session detail info cards - 3 to 2 columns on tablets */
    .info-cards-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    
    .logo {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .logo h1 {
        font-size: 1.4rem;
        letter-spacing: 1px;
    }
    
    .units-settings-btn {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
    
    .hero-dashboard {
        padding: 1.5rem;
    }
    
    .session-title-bar h1 {
        font-size: 2rem;
        letter-spacing: 2px;
    }
    
    /* Live Grid: 3x3 -> 2x5 on mobile */
    .weather-grid.live-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Make timer full width on mobile */
    .weather-metric.session-timer {
        grid-column: 1 / -1;
    }
    
    .countdown-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .countdown-item {
        padding: 1.5rem;
        min-width: auto;
    }
    
    .countdown-number {
        font-size: 2.5rem;
    }
    
    .session-item {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 0.8rem;
    }
    
    .info-cards-row {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        flex-direction: column;
        text-align: center;
    }
    
    /* Session Detail Mobile Styles */
    .forecast-table {
        font-size: 0.85rem;
    }
    
    .forecast-table th,
    .forecast-table td {
        padding: 0.5rem 0.3rem;
    }
    
    .nav-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .weather-metric {
        padding: 1rem;
    }
    
    .metric-value {
        font-size: 1.8rem;
    }
    
    .weather-metric.session-timer .metric-value {
        font-size: 2rem;
    }
    
    .countdown-number {
        font-size: 2rem;
    }
    
    .logo h1 {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
    
    .units-settings-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
}

/* Focus States for Accessibility */
.session-item:focus {
    outline: 2px solid #00ff88;
    outline-offset: 2px;
}

/* Session Detail Page Styles */
.nav-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: #00ff88;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid #00ff88;
}

.nav-button:hover {
    background: rgba(0, 255, 136, 0.1);
    border-color: #00ff88;
    transform: translateY(-2px);
    color: #00ff88;
}

.navigation-item {
    text-align: center;
}

/* Hourly Forecast Section */
.hourly-forecast-section {
    margin-top: 2rem;
}

.forecast-table-container {
    overflow-x: auto;
    border-radius: 8px;
    background: #0d1117;
    border: 2px solid #333;
}

.forecast-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Consolas', 'Monaco', monospace;
}

.forecast-table th {
    background: #1a1a1a;
    color: #ffffff;
    padding: 1rem;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    border-bottom: 2px solid #333;
}

.forecast-table td {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #333;
    color: #ffffff;
    font-size: 0.95rem;
}

.forecast-table tr:hover {
    background: #1a1a1a;
}

.forecast-table tr:last-child td {
    border-bottom: none;
}

/* Session time highlighting in forecast table */
.forecast-table tr.session-time {
    border: 2px solid #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

.forecast-table tr.session-time:hover {
    background: rgba(0, 255, 136, 0.2);
}

/* Track Condition Items */
.track-condition-item {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.track-condition-item div {
    font-size: 1rem;
    color: #ffffff;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .hero-dashboard {
        border-color: #ffffff;
    }
    
    .weather-metric {
        border-color: #ffffff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .weather-metric,
    .session-item,
    .status-dot {
        transition: none;
    }
    
    .status-dot {
        animation: none;
    }
    
    .timer-display {
        animation: none;
    }
}

/* ========================================
   Calendar Page Styles
   ======================================== */

/* Breadcrumb Navigation */
.breadcrumb-nav {
    margin-bottom: 1.5rem;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    list-style: none;
    background: transparent;
    font-family: 'Titillium Web', sans-serif;
    font-size: 14px;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '>';
    padding: 0 0.75rem;
    color: #666;
}

.breadcrumb-item a {
    color: #888;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: #00ff88;
}

.breadcrumb-item.active {
    color: #ffffff;
    font-weight: 500;
}

/* Hero Dashboard Optimization for Calendar */
.calendar-page .hero-dashboard {
    margin-bottom: 2rem;
}

.calendar-page .session-title-bar {
    text-align: center;
    padding: 2rem 0 1rem;
}

.calendar-page .session-title-bar h1 {
    font-family: 'Titillium Web', sans-serif;
    font-size: 3rem;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: linear-gradient(to right, #ffffff, #e10600);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.calendar-page .session-title-bar p {
    font-family: 'Titillium Web', sans-serif;
    font-size: 1.1rem;
    color: #888;
    margin: 0;
}

/* Layout Toggle Styles */
.layout-toggle {
    display: flex;
    gap: 0.5rem;
}

.layout-btn {
    padding: 0.6rem 1.2rem;
    background: transparent;
    color: #888;
    border: 2px solid #333;
    border-radius: 6px;
    font-family: 'Titillium Web', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.layout-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border-color: #666;
}

.layout-btn.active {
    background: #e10600;
    color: #ffffff;
    border-color: #e10600;
}

.layout-btn.active:hover {
    background: #c20500;
    border-color: #c20500;
}

/* Filter Button Styles */
.filter-btn {
    padding: 0.6rem 1.2rem;
    background: transparent;
    color: #888;
    border: 2px solid #333;
    border-radius: 6px;
    font-family: 'Titillium Web', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #1a1a1a;
    color: #00ff88;
    border-color: #00ff88;
}

.filter-btn.active[data-filter="year"] {
    background: #e10600;
    color: #ffffff;
    border-color: #e10600;
}

.filter-btn.active[data-filter="format"] {
    background: #00ff88;
    color: #0d1117;
    border-color: #00ff88;
}

/* Layout Styles */
.races-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.races-table {
    transition: all 0.3s ease;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
}

.races-table table {
    min-width: 800px;
}

/* Sortable Header Styles */
.sortable-header:hover {
    background: #333 !important;
}

.sortable-header.sort-asc .sort-indicator {
    opacity: 1;
    color: #00ff88;
}

.sortable-header.sort-asc .sort-indicator:after {
    content: ' ▲';
}

.sortable-header.sort-desc .sort-indicator {
    opacity: 1;
    color: #00ff88;
}

.sortable-header.sort-desc .sort-indicator:after {
    content: ' ▼';
}

/* Search Field Focus */
#calendar-search:focus {
    outline: none;
    border-color: #00ff88;
}

/* Clear Search Button */
#clear-search:hover {
    color: #ffffff !important;
}

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Calendar Responsive Design */
@media (max-width: 1200px) {
    .races-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (max-width: 768px) {
    /* Hero adjustments for tablet */
    .calendar-page .session-title-bar h1 {
        font-size: 2.5rem;
    }
    
    .calendar-page .session-title-bar p {
        font-size: 1rem;
    }
    
    /* Layout toggle centered on tablet */
    .layout-toggle {
        justify-content: center;
    }
    .filter-options {
        justify-content: center;
        width: 100%;
    }
    
    .filter-group {
        justify-content: center;
    }
    
    .search-container {
        width: 100% !important;
        min-width: unset !important;
    }
    
    .races-grid {
        grid-template-columns: 1fr;
    }
    
    /* Hide less important columns on mobile for table layout */
    .races-table th:nth-child(4),
    .races-table td:nth-child(4) {
        display: none;
    }
}

@media (max-width: 600px) {
    /* Hero adjustments for mobile */
    .calendar-page .session-title-bar {
        padding: 1.5rem 0 0.75rem;
    }
    
    .calendar-page .session-title-bar h1 {
        font-size: 2rem;
    }
    
    .calendar-page .session-title-bar p {
        font-size: 0.95rem;
        padding: 0 1rem;
    }
    
    /* Layout toggle adjustments for mobile */
    .layout-toggle {
        margin-bottom: 0.5rem;
        width: 100%;
        justify-content: center;
    }
    
    .layout-btn {
        font-size: 11px;
        padding: 0.5rem 0.8rem;
        flex: 1;
        max-width: 150px;
    }
    
    .filter-btn {
        font-size: 10px;
        padding: 0.5rem 0.8rem;
    }
    
    /* Further responsive adjustments for table */
    .races-table th:nth-child(3),
    .races-table td:nth-child(3) {
        display: none;
    }
    
    .races-table table {
        min-width: 500px;
    }
}

@media (max-width: 480px) {
    /* Breadcrumb adjustments for small mobile */
    .breadcrumb {
        font-size: 12px;
    }
    
    .breadcrumb-item + .breadcrumb-item::before {
        padding: 0 0.5rem;
    }
    
    /* Hero adjustments for small mobile */
    .calendar-page .hero-dashboard {
        margin-bottom: 1.5rem;
    }
    
    .calendar-page .session-title-bar h1 {
        font-size: 1.75rem;
        letter-spacing: 0;
    }
    
    .calendar-page .session-title-bar p {
        font-size: 0.9rem;
    }
    
    /* Filter options adjustments */
    .filter-options {
        width: 100%;
    }
    
    .races-table th:nth-child(5),
    .races-table td:nth-child(5) {
        display: none;
    }
    
    .races-table table {
        min-width: 400px;
    }
}