/**
 * Forecast Calendar Styles - Simplified
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #2a2a2a;
    color: #e0e0e0;
    width: 100vw;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    overflow: hidden;
}

main {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(42, 42, 42, 0.25);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(2px);
}

.splash-screen.hidden {
    display: none;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.splash-coins {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.splash-coin-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.splash-logo {
    width: 96px;
    height: 96px;
    cursor: pointer;
}

.splash-logo-1 {
    animation: coinSpin 5s linear;
}

.splash-logo-2 {
    animation: coinSpin 5s linear 0.5s;
}

.splash-link {
    color: #60a5fa;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
}

.splash-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}

@keyframes coinSpin {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(1800deg);
    }
}

h1 {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    padding: 10px;
    color: #60a5fa;
}

h1 a {
    color: #22d3ee;
    text-decoration: none;
}

h1 a:hover {
    color: #67e8f9;
    text-decoration: underline;
}

h1 .glow {
    color: #60a5fa;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(96, 165, 250, 0.3), 0 0 10px rgba(96, 165, 250, 0.2);
    }
    50% {
        text-shadow: 0 0 10px rgba(96, 165, 250, 0.5), 0 0 15px rgba(96, 165, 250, 0.3), 0 0 20px rgba(96, 165, 250, 0.2);
    }
}

.hidden {
    display: none !important;
}

#forecastEventBadge {
    display: block;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    top: 45px;
    white-space: nowrap;
    z-index: 10;
}

#forecastEventBadge.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-50%) rotate(-5deg); }
    20%, 40%, 60%, 80% { transform: translateX(-50%) rotate(5deg); }
}

#calendarBook {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    max-width: 100vw;
    height: calc(100% - 40px);
    opacity: 0;
    transition: opacity 0.2s ease-in;
    overflow: hidden;
}

#calendarBook.loaded {
    opacity: 1;
}

.stf__block {
    margin: 0 auto !important;
    max-width: 100vw !important;
    overflow: hidden !important;
}

.page {
    background: #2a2a2a;
    border: none;
    box-sizing: border-box;
    overflow: hidden;
    padding: 0 !important;
}

.page-content {
    width: 100%;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.page-content h2 {
    text-align: center;
    font-size: 1.6vh;
    margin: 0 0 0.5vh 0;
    padding: 0;
    color: #e0e0e0;
    flex-shrink: 0;
    line-height: 1.0;
}

.forecast-table {
    width: 100%;
    height: 95%;
    table-layout: auto;
    border-collapse: collapse;
    font-size: 2.0vh;
}

.forecast-table thead th {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2vh;
    text-align: center;
    font-size: 1.8vh;
    font-weight: 600;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    line-height: 1;
    height: 2.2vh;
    max-height: 2.2vh;
}

.forecast-table tbody td {
    padding: 0;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 1.8vh;
    white-space: nowrap;
    line-height: 1.0;
    height: 2.0vh !important;
    max-height: 2.0vh !important;
}

.forecast-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.forecast-table tbody tr.current-hour {
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.4), inset 0 0 4px rgba(74, 222, 128, 0.2);
    background: rgba(74, 222, 128, 0.12);
    position: relative;
    z-index: 9999;
}

.fuel-green {
    color: #4ade80 !important;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.6);
    font-weight: 600 !important;
}

.fuel-blue {
    color: #60a5fa !important;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.6);
    font-weight: 600 !important;
}

.fuel-orange {
    color: #fbbf24 !important;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
    font-weight: 600 !important;
}

.fuel-red {
    color: #ef4444 !important;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
    font-weight: 600 !important;
}

.co2-green {
    color: #4ade80 !important;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.6);
    font-weight: 600 !important;
}

.co2-blue {
    color: #60a5fa !important;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.6);
    font-weight: 600 !important;
}

.co2-orange {
    color: #fbbf24 !important;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
    font-weight: 600 !important;
}

.co2-red {
    color: #ef4444 !important;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
    font-weight: 600 !important;
}

.co2-negative {
    color: #ef4444 !important;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
    font-weight: 600 !important;
}

@media (max-width: 600px) {
    body {
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
    }

    h1 {
        font-size: 16px;
        padding: 5px;
    }

    #calendarBook {
        top: 35px;
        left: 0;
        right: 0;
        width: 100%;
        height: calc(100vh - 35px);
        height: calc(var(--vh, 1vh) * 100 - 35px);
        transform: none;
    }

    #forecastEventBadge {
        top: 22px;
        padding: 2px;
        font-size: 12px;
    }

    .page-content {
        padding: 0 !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .page-content h2 {
        margin: 0 !important;
        padding: 2px !important;
        font-size: 1.84vh !important;
        flex-shrink: 0 !important;
        line-height: 1.2 !important;
    }

    .forecast-table {
        width: 100% !important;
        height: 100% !important;
        font-size: 1.8vh !important;
        table-layout: auto !important;
    }

    .forecast-table thead th {
        padding: 0.2vh !important;
        font-size: 1.8vh !important;
        white-space: nowrap;
        width: auto !important;
        height: 2.2vh !important;
        max-height: 2.2vh !important;
        line-height: 1 !important;
    }

    .forecast-table tbody td {
        padding: 0.3vh !important;
        font-size: 1.8vh !important;
        white-space: nowrap;
        width: auto !important;
    }
}

/* iOS-specific scaling */
html.ios .page-content {
    transform: scale(0.95);
    transform-origin: top center;
}
