* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #2d1b4e 100%);
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    padding: 15px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 15px;
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 1.8em;
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    margin-bottom: 10px;
}

.location-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.location-selector label {
    font-size: 1.2em;
    color: #88ffaa;
}

.location-selector select {
    padding: 10px 15px;
    font-size: 1em;
    background: rgba(0, 0, 0, 0.4);
    color: #e0e0e0;
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s;
    min-width: 200px;
}

.location-selector select:hover {
    border-color: rgba(0, 255, 136, 0.6);
}

.location-selector select:focus {
    outline: none;
    border-color: #00ff88;
}

.location-coords {
    font-size: 0.9em;
    color: #88ffaa;
    opacity: 0.8;
}

/* Aurora Alert Box */
.aurora-alert {
    margin-top: 15px;
    padding: 12px 15px;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 204, 102, 0.15) 100%);
    border: 2px solid #00ff88;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: pulseAlert 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.aurora-alert.hidden {
    display: none;
}

.alert-icon {
    font-size: 2em;
    animation: bounce 1s ease-in-out infinite;
}

.alert-content {
    flex: 1;
}

.alert-content strong {
    display: block;
    color: #00ff88;
    font-size: 1.1em;
    margin-bottom: 3px;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.alert-content p {
    margin: 0;
    color: #e0e0e0;
    font-size: 0.9em;
}

@keyframes pulseAlert {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
        border-color: #00ff88;
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 255, 136, 0.8);
        border-color: #00ffaa;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

section {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

h2 {
    color: #00ff88;
    margin-bottom: 10px;
    font-size: 1.4em;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

h3 {
    color: #88ffaa;
    margin-bottom: 8px;
    font-size: 1.1em;
}

#current-data {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.data-grid-left {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.aurora-map-card {
    min-height: 100%;
}

.data-grid-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.aurora-map-large {
    display: flex;
    min-height: 450px;
}

.data-grid-right {
    display: flex;
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.data-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
    border: 2px solid rgba(0, 255, 136, 0.2);
    transition: transform 0.3s, border-color 0.3s;
}

.data-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 255, 136, 0.5);
}

.data-card h3 {
    font-size: 1em;
    margin-bottom: 10px;
    color: #88ffaa;
}

.data-value {
    font-size: 1.8em;
    font-weight: bold;
    margin: 5px 0;
}

.data-label {
    font-size: 0.9em;
    color: #aaa;
}

.probability-display {
    text-align: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    margin-top: 10px;
}

.probability-value {
    font-size: 2.5em;
    font-weight: bold;
    margin: 10px 0;
}

.probability-label {
    font-size: 1.1em;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.description {
    font-size: 1.1em;
    margin-top: 15px;
    color: #ccc;
}

.time-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.time-controls label {
    font-size: 1.1em;
    color: #88ffaa;
}

.time-controls select {
    padding: 10px 15px;
    font-size: 1em;
    background: rgba(0, 0, 0, 0.4);
    color: #e0e0e0;
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s;
}

.time-controls select:hover {
    border-color: rgba(0, 255, 136, 0.6);
}

.btn-primary {
    padding: 10px 20px;
    font-size: 1em;
    background: linear-gradient(135deg, #00ff88 0%, #00cc66 100%);
    color: #0a0e27;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.forecast-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
    border-left: 4px solid;
    transition: transform 0.3s;
}

.forecast-card:hover {
    transform: translateY(-3px);
}

.forecast-time {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #00ff88;
}

.forecast-probability {
    font-size: 1.5em;
    font-weight: bold;
    margin: 5px 0;
}

.forecast-visibility {
    font-size: 1.2em;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.forecast-factors {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.factor {
    text-align: center;
}

.factor-label {
    font-size: 0.8em;
    color: #aaa;
}

.factor-value {
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 5px;
}

.optimal-grid {
    display: grid;
    gap: 15px;
}

.optimal-card {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 204, 102, 0.05) 100%);
    padding: 10px 12px;
    border-radius: 8px;
    border: 2px solid rgba(0, 255, 136, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s, border-color 0.3s;
}

.optimal-card:hover {
    transform: translateX(5px);
    border-color: rgba(0, 255, 136, 0.6);
}

.optimal-time-info h4 {
    color: #00ff88;
    font-size: 1.3em;
    margin-bottom: 8px;
}

.optimal-probability {
    font-size: 1.8em;
    font-weight: bold;
}

.info-content {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    line-height: 1.8;
}

.info-content p {
    margin-bottom: 15px;
}

.info-content strong {
    color: #00ff88;
}

.loading {
    text-align: center;
    padding: 20px;
    font-size: 1em;
    color: #88ffaa;
}

.error {
    text-align: center;
    padding: 20px;
    font-size: 1em;
    color: #ff6666;
}

.info-message {
    text-align: center;
    padding: 20px;
    font-size: 0.95em;
    color: #88ffaa;
    background: rgba(0, 255, 136, 0.05);
    border-radius: 8px;
}

/* Short-term forecast styling */
.short-term {
    border-width: 4px;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

/* Legend Styles */
.legend {
    margin-top: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 136, 0.15);
}

.legend h4 {
    color: #00ff88;
    margin-bottom: 6px;
    font-size: 0.85em;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

.legend-item {
    background: rgba(0, 0, 0, 0.15);
    padding: 6px;
    border-radius: 4px;
}

.legend-item strong {
    display: block;
    color: #88ffaa;
    margin-bottom: 4px;
    font-size: 0.8em;
}

.legend-range {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.legend-range span {
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.7em;
    display: inline-block;
}

.range-bad {
    background: rgba(255, 102, 102, 0.2);
    color: #ff6666;
    border-left: 3px solid #ff6666;
}

.range-moderate {
    background: rgba(255, 170, 0, 0.2);
    color: #ffaa00;
    border-left: 3px solid #ffaa00;
}

.range-good {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border-left: 3px solid #00ff88;
}

/* KP Chart Styles */
.kp-chart-section {
    margin: 15px 0;
}

.chart-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
}

.chart-section h3 {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    color: #00ffaa;
    text-align: center;
}

.kp-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 150px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 10px 10px 50px 10px;
    position: relative;
}

.kp-bar-wrapper {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    flex: 1;
    max-width: 80px;
    height: 100%;
    position: relative;
    justify-content: flex-start;
}

.kp-bar {
    width: 100%;
    min-height: 5%;
    border-radius: 4px 4px 0 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 5px;
    transition: all 0.3s;
    position: relative;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    margin-top: auto;
}

.kp-bar:hover {
    opacity: 0.8;
    transform: scaleY(1.05);
}

.kp-value {
    color: #000;
    font-weight: bold;
    font-size: 0.85em;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.5);
}

.kp-label {
    position: absolute;
    bottom: -45px;
    font-size: 0.7em;
    color: #aaa;
    text-align: center;
    line-height: 1.2;
    width: 100%;
}

/* BZ Chart with x-axis in middle */
.bz-chart {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 200px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 10px 10px 50px 10px;
    position: relative;
}

.bz-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 80px;
    height: 100%;
    position: relative;
    justify-content: center;
    z-index: 2;
}

.bz-bar {
    width: 100%;
    min-height: 5%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.bz-bar.negative {
    border-radius: 0 0 4px 4px;
    align-items: flex-start;
    padding-top: 5px;
}

.bz-bar.positive {
    border-radius: 4px 4px 0 0;
    align-items: flex-end;
    padding-bottom: 5px;
    align-self: flex-end;
}

.bz-bar:hover {
    opacity: 0.8;
    transform: scaleY(1.05);
}

/* Aurora Map Card */
.aurora-map-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    padding: 10px;
}

.aurora-map-card h3 {
    margin: 0 0 10px 0;
}

.aurora-map-preview {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 170, 0.3);
    object-fit: contain;
}

.aurora-map-card .data-label {
    margin-top: 10px;
}

.aurora-map-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 255, 170, 0.8);
}

.aurora-map-card:hover .aurora-map-preview {
    border-color: rgba(0, 255, 170, 0.8);
}

#current-data {
    display: grid;
    grid-template-columns: 1fr 520px;
    gap: 20px;
    align-items: start;
}

.left-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.right-content {
    display: flex;
    height: 100%;
}

.aurora-probability-large {
    width: 100%;
}

.aurora-probability-large .data-card {
    padding: 20px;
    text-align: center;
}

.data-value-large {
    font-size: 4em;
    font-weight: bold;
    margin: 10px 0;
    text-shadow: 0 0 20px currentColor;
}

.data-description-large {
    font-size: 1.6em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.data-boxes-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.legend-inline {
    margin-top: 5px;
}

.legend-compact {
    margin-top: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 136, 0.15);
}

.legend-compact h4 {
    color: #00ff88;
    margin: 0 0 6px 0;
    font-size: 0.85em;
}

.legend-grid-compact {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.legend-item-compact {
    background: rgba(0, 0, 0, 0.15);
    padding: 6px;
    border-radius: 4px;
}

.legend-item-compact strong {
    display: block;
    color: #88ffaa;
    margin-bottom: 4px;
    font-size: 0.8em;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #00ffaa;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.modal-content h2 {
    color: #00ffaa;
    margin: 0;
    text-align: center;
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 10px;
    border: 2px solid rgba(0, 255, 170, 0.5);
    box-shadow: 0 0 20px rgba(0, 255, 170, 0.3);
}

.modal-description {
    color: #aaa;
    text-align: center;
    max-width: 600px;
    margin: 0;
}

/* Aurora Map Card */
.aurora-map-card {
    display: flex;
    flex-direction: column;
    padding: 8px !important;
    width: 100%;
    height: 100%;
}

.aurora-map-card h3 {
    margin: 0 0 8px 0;
    font-size: 1em;
}

.aurora-map-card .data-label {
    font-size: 0.75em;
    margin-top: 4px;
}

.aurora-map-preview {
    width: 100%;
    height: auto;
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 170, 0.3);
    flex: 1;
    object-fit: contain;
}

.aurora-map-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 255, 170, 0.8);
}

.aurora-map-card:hover .aurora-map-preview {
    border-color: rgba(0, 255, 170, 0.8);
}

footer {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 0.9em;
}

footer p {
    margin: 5px 0;
}

#last-update {
    color: #00ff88;
}

/* 27-Day Outlook Styles */
.section-description {
    color: #aaa;
    font-size: 0.95em;
    margin-bottom: 20px;
}

.outlook-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.outlook-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid;
    text-align: center;
    transition: transform 0.3s;
}

.outlook-card:hover {
    transform: translateY(-3px);
}

.outlook-date {
    font-weight: bold;
    font-size: 1.1em;
    color: #00ff88;
    margin-bottom: 8px;
}

.outlook-kp {
    font-size: 1.8em;
    font-weight: bold;
    margin: 10px 0;
}

.outlook-activity {
    font-size: 0.9em;
    color: #ccc;
    text-transform: capitalize;
    margin-bottom: 10px;
}

.outlook-details {
    display: flex;
    justify-content: space-around;
    font-size: 0.85em;
    color: #999;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* DSCOVR Status Styles */
.dscovr-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid rgba(0, 255, 136, 0.2);
}

.dscovr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.dscovr-header h3 {
    margin: 0;
    font-size: 1.3em;
    color: #88ffaa;
}

.dscovr-status-badge {
    font-weight: bold;
    font-size: 1em;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    letter-spacing: 1px;
}

.dscovr-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.dscovr-detail {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.dscovr-detail .label {
    color: #aaa;
    font-size: 0.9em;
}

.dscovr-detail .value {
    color: #00ff88;
    font-weight: bold;
}

.dscovr-description {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    font-size: 0.95em;
    line-height: 1.6;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .location-selector {
        flex-direction: column;
        gap: 5px;
    }

    .location-selector select {
        width: 100%;
        max-width: 300px;
    }

    .aurora-alert {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .alert-icon {
        font-size: 1.5em;
    }

    #current-data {
        grid-template-columns: 1fr;
    }
    
    .data-boxes-row {
        grid-template-columns: 1fr;
    }
    
    .right-content {
        width: 100%;
        min-height: 400px;
    }
    
    .data-grid-container {
        grid-template-columns: 1fr;
    }
    
    .aurora-map-large {
        min-height: 300px;
    }
    
    .aurora-map-card {
        min-height: 300px;
    }
    
    .data-grid {
        grid-template-columns: 1fr;
    }

    .forecast-grid {
        grid-template-columns: 1fr;
    }

    .time-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .time-controls select,
    .btn-primary {
        width: 100%;
    }

    .outlook-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .dscovr-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dscovr-info {
        grid-template-columns: 1fr;
    }

    .legend-grid {
        grid-template-columns: 1fr;
    }

    .kp-chart {
        height: 180px;
        padding: 10px 5px 45px 5px;
    }

    .kp-bar-wrapper {
        max-width: 40px;
    }

    .kp-value {
        font-size: 0.75em;
    }

    .kp-label {
        font-size: 0.6em;
        bottom: -40px;
    }
}
