/* Energy Public Page - Big Screen Optimized */
/* Dark theme with gradients and animations */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    --accent-green: #00ff88;
    --accent-green-glow: rgba(0, 255, 136, 0.4);
    --accent-orange: #ff8c00;
    --accent-orange-glow: rgba(255, 140, 0, 0.4);
    --accent-red: #ff3366;
    --accent-red-glow: rgba(255, 51, 102, 0.4);
    --accent-blue: #00d4ff;
    --accent-blue-glow: rgba(0, 212, 255, 0.3);
    --border-color: rgba(255, 255, 255, 0.1);
    --gradient-dark: linear-gradient(135deg, #0a0a0f 0%, #12121a 50%, #1a1a25 100%);
    /* Timeline segment colors for JS gradient access */
    --color-on: #00ff88;
    --color-probable: #ff8c00;
    --color-definite: #ff3366;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gradient-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Animated background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-animation::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 80%, var(--accent-blue-glow) 0%, transparent 30%),
                radial-gradient(circle at 80% 20%, var(--accent-green-glow) 0%, transparent 25%),
                radial-gradient(circle at 50% 50%, rgba(138, 43, 226, 0.1) 0%, transparent 40%);
    animation: bg-shift 20s ease-in-out infinite;
}

.bg-animation::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle at 100% 0%, var(--accent-green-glow) 0%, transparent 50%);
    transition: background 1s ease;
}

.bg-animation.status-on::after {
    background: radial-gradient(circle at 100% 0%, rgba(0, 255, 136, 0.3) 0%, transparent 50%);
}

.bg-animation.status-probable::after {
    background: radial-gradient(circle at 100% 0%, rgba(255, 140, 0, 0.3) 0%, transparent 50%);
}

.bg-animation.status-definite::after {
    background: radial-gradient(circle at 100% 0%, rgba(255, 50, 70, 0.4) 0%, transparent 50%);
}

@keyframes bg-shift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, -2%) rotate(1deg); }
    66% { transform: translate(-1%, 1%) rotate(-1deg); }
}

/* Config Bar */
.config-bar {
    position: relative;
    z-index: 10;
    padding: 16px 40px;
    background: rgba(26, 26, 37, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.config-bar-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.logo-link .logo {
    height: 24px;
    width: auto;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.logo-link:hover .logo {
    opacity: 1;
}

.config-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

.config-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.config-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.config-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 40px 12px 16px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0b0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    min-width: 200px;
}

.config-select:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px var(--accent-blue-glow);
}

.config-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 30px var(--accent-blue-glow);
}

.config-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px;
}

.btn-apply {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #0099cc 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    color: var(--bg-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-blue-glow);
}

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

.btn-apply.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
	margin-top: -20px;
    padding: 40px;
    position: relative;
    z-index: 1;
}

/* Widget Container */
.widget-container {
    width: 100%;
    max-width: 1400px;
    padding: 40px 60px;
    background: rgba(26, 26, 37, 0.6);
    backdrop-filter: blur(30px);
    border-radius: 32px;
    border: 1px solid var(--border-color);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    transition: all 0.5s ease;
}

/* Status Header */
.status-header {
    text-align: center;
    margin-bottom: 50px;
}

.status-icon-large {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
    transition: all 0.5s ease;
}

.status-icon-large.status-on {
    color: var(--accent-green);
    filter: drop-shadow(0 0 30px var(--accent-green-glow));
    animation: icon-pulse-large 2s ease-in-out infinite;
}

.status-icon-large.status-probable {
    color: var(--accent-orange);
    filter: drop-shadow(0 0 30px var(--accent-orange-glow));
    animation: icon-warning 2s ease-in-out infinite;
}

.status-icon-large.status-definite {
    color: var(--accent-red);
    filter: drop-shadow(0 0 30px var(--accent-red-glow));
    animation: icon-alert 3s ease-in-out infinite;
}

@keyframes icon-pulse-large {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.9; }
}

@keyframes icon-warning {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.05) rotate(-5deg); }
    75% { transform: scale(1.05) rotate(5deg); }
}

@keyframes icon-alert {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.status-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 12px;
    transition: color 0.5s ease;
}

.status-title.status-on {
    color: var(--accent-green);
    text-shadow: 0 0 40px var(--accent-green-glow);
}

.status-title.status-probable {
    color: var(--accent-orange);
    text-shadow: 0 0 40px var(--accent-orange-glow);
}

.status-title.status-definite {
    color: var(--accent-red);
    text-shadow: 0 0 40px var(--accent-red-glow);
}

.status-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
}

/* Countdown */
.countdown-container {
    text-align: center;
    margin-bottom: 30px;
}

.countdown-value {
    font-size: 120px;
    font-weight: 800;
    font-family: 'Orbitron', 'Inter', monospace;
    letter-spacing: 3px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 16px;
    display: inline-flex;
    align-items: baseline;
}

.time-only {
	margin-left: 0;
}

.countdown-colon {
    margin: 0 12px;
}

.countdown-value.pulse {
    animation: countdown-pulse 1s ease-in-out;
}

@keyframes countdown-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.countdown-seconds {
    letter-spacing: 3px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.3;
    min-width: 270px;
    display: inline-block;
    text-align: left;
}

.countdown-seconds .countdown-colon {
    margin: 0 12px;
}

.countdown-label {
    font-size: 24px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Timeline */
.timeline-wrapper {
    margin-bottom: 40px;
}

.timeline-main-container {
    position: relative;
    padding-top: 45px;
}

.timeline-main {
    position: relative;
    height: 80px;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3),
                inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

.timeline-segment-large {
    flex: 1;
    height: 100%;
    position: relative;
    transition: all 0.5s ease;
    border-right: 1px solid rgba(0, 0, 0, 0.2);
}

.timeline-segment-large:last-child {
    border-right: none;
}

.timeline-segment-large.status-on {
    background: linear-gradient(180deg, var(--accent-green) 0%, #00cc6a 100%);
    box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.3);
}

.timeline-segment-large.status-probable {
    background: linear-gradient(180deg, var(--accent-orange) 0%, #cc7000 100%);
    box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.2);
    animation: segment-pulse-orange 2s ease-in-out infinite;
}

.timeline-segment-large.status-definite {
    background: linear-gradient(180deg, var(--accent-red) 0%, #cc0033 100%);
    box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.2);
    animation: segment-pulse-red 3s ease-in-out infinite;
}

@keyframes segment-pulse-orange {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes segment-pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Partial fill outage overlay (static, no animation) */
.outage-overlay {
    border-radius: 0;
}

.outage-overlay.status-probable {
    background: linear-gradient(180deg, var(--accent-orange) 0%, #cc7000 100%);
    box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.2);
}

.outage-overlay.status-definite {
    background: linear-gradient(180deg, var(--accent-red) 0%, #cc0033 100%);
    box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.2);
}

/* Current time marker */
.time-marker-large {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--text-primary);
    transform: translateX(-50%);
    z-index: 20;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    transition: left 1s linear;
}

.time-marker-label-large {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-size: 18px;
    font-weight: 700;
    color: var(--bg-primary);
    background: var(--text-primary);
    padding: 6px 14px;
    border-radius: 6px;
    z-index: 21;
    transition: left 1s linear;
    white-space: nowrap;
}

/* Triangle pointing down from label to timeline */
.time-marker-label-large::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--text-primary);
}

/* Timeline labels */
.timeline-labels-large {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    position: relative;
}

.timeline-label-large {
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 500;
    position: absolute;
    transform: translateX(-50%);
}

/* Legend */
.legend-large {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 30px;
}

.legend-item-large {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    color: var(--text-secondary);
}

.legend-color-large {
    width: 32px;
    height: 20px;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.legend-color-large.on {
    background: linear-gradient(180deg, var(--accent-green) 0%, #00cc6a 100%);
}

.legend-color-large.probable {
    background: linear-gradient(180deg, var(--accent-orange) 0%, #cc7000 100%);
}

.legend-color-large.definite {
    background: linear-gradient(180deg, var(--accent-red) 0%, #cc0033 100%);
}

/* Footer Info */
.footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 16px;
}

.region-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.region-info svg {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.update-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 30px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 20px;
}

.share-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
}

.share-btn svg {
    width: 20px;
    height: 20px;
}

.schedule-status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.schedule-status-badge.active {
    background: rgba(0, 255, 136, 0.2);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
}

.schedule-status-badge.waiting {
    background: rgba(255, 140, 0, 0.2);
    color: var(--accent-orange);
    border: 1px solid var(--accent-orange);
}

.schedule-status-badge.emergency {
    background: rgba(255, 51, 102, 0.2);
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
}

/* Loading State */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 32px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 18px;
}

/* Error State */
.error-container {
    text-align: center;
    padding: 60px;
}

.error-icon {
    width: 80px;
    height: 80px;
    color: var(--accent-red);
    margin-bottom: 24px;
}

.error-message {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.error-hint {
    font-size: 16px;
    color: var(--text-muted);
}

/* State Change Animation */
.widget-container.state-changed {
    animation: state-flash 0.5s ease;
}

@keyframes state-flash {
    0% { box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5); }
    50% { box-shadow: 0 30px 80px var(--accent-blue-glow), 0 0 100px var(--accent-blue-glow); }
    100% { box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5); }
}

/* Responsive */
@media (max-width: 1200px) {
    .config-bar {
        padding: 16px 24px;
    }

    .widget-container {
        padding: 40px;
        border-radius: 24px;
    }

    .status-title {
        font-size: 36px;
    }

    .countdown-value {
        font-size: 80px;
    }

    .countdown-seconds {
        font-size: 40px;
        min-width: 175px;
    }

    .timeline-main {
        height: 60px;
    }
}

/* Hidden by default (desktop) */
.hamburger-btn,
.menu-close {
    display: none;
}

@media (max-width: 768px) {
    html, body {
        height: 100%;
        overflow: hidden;
    }

    .config-bar {
        padding: 10px 16px;
    }

    .config-bar-inner {
        flex-direction: row;
        justify-content: space-between;
    }

    .config-controls {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(10, 10, 15, 0.90);
        backdrop-filter: blur(20px);
        z-index: 100;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 40px 24px;
        gap: 20px;
    }

    .config-controls.open {
        display: flex;
		height: 100vh;
    }

    .config-group {
        width: 100%;
        max-width: 300px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .config-select {
        width: 100%;
        min-width: 100%;
    }

    .btn-apply {
        width: 100%;
        max-width: 300px;
        margin-top: 12px;
    }

    .menu-close {
        position: absolute;
        top: 16px;
        right: 16px;
    }

    .hamburger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        color: var(--text-secondary);
        cursor: pointer;
    }

    .hamburger-btn svg {
        width: 24px;
        height: 24px;
    }

    .main-content {
		justify-content: flex-start;
        padding: 16px;
        overflow-y: auto;
        height: calc(100vh - 64px);
		margin-top: 0;
    }

    .widget-container {
        padding: 20px;
        border-radius: 16px;
        overflow: visible;
    }

    .status-header {
        margin-bottom: 24px;
    }

    .status-icon-large {
        width: 50px;
        height: 50px;
        margin-bottom: 16px;
    }

    .status-title {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .status-subtitle {
        font-size: 16px;
    }

    .countdown-container {
        margin-bottom: 24px;
    }

    .countdown-value {
        font-size: 42px;
        letter-spacing: 2px;
    }

    .countdown-seconds {
        font-size: 21px;
        min-width: 65px;
    }

    .countdown-colon {
        margin: 0 6px;
    }

    .countdown-seconds .countdown-colon {
        margin: 0 3px;
    }

    .countdown-label {
        font-size: 14px;
    }

    .timeline-wrapper {
        margin-bottom: 24px;
    }

    .timeline-main-container {
        padding-top: 36px;
    }

    .timeline-main {
        height: 40px;
        border-radius: 10px;
    }

    .time-marker-label-large {
        font-size: 12px;
        padding: 4px 8px;
    }

    .timeline-labels-large {
        padding: 10px 0;
    }

    .timeline-label-large {
        font-size: 12px;
    }

    .legend-large {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin: 50px 0 40px 0;
    }

    .legend-item-large {
        font-size: 14px;
    }

    .legend-color-large {
        width: 24px;
        height: 14px;
    }

    .footer-info {
        flex-direction: column;
        align-items: center;
        gap: 16px;
        margin-top: 24px;
        padding-top: 20px;
        font-size: 14px;
    }

    .region-info {
    }

    .update-info {
        margin: 0;
    }

    .share-btn {
        margin-left: 0;
    }

    #schedule-status-container {
        width: 100%;
		text-align: center;
		margin: 16px 0;
    }

    .schedule-status-badge {
        font-size: 12px;
        padding: 6px 12px;
    }

    .menu-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        color: var(--text-secondary);
        cursor: pointer;
    }

    .menu-close svg {
        width: 24px;
        height: 24px;
    }
}
