:root {
    /* Core Colors */
    --yale-blue: #1A347E;
    --aero: #1DBBE6;
    --silver: #B1B2AD;
    --sage: #C0C6A4;
    --ucla-blue: #3075B6;

    /* Functional Variables */
    --primary-bg: var(--yale-blue);
    --secondary-bg: var(--ucla-blue);
    --accent-color: var(--aero);
    --text-primary: var(--silver);
    --text-secondary: var(--sage);
    --grid-bg: rgba(192, 198, 164, 0.1);
    --card-border: rgba(29, 187, 230, 0.2);
    --compass-grid: rgba(177, 178, 173, 0.2);
    --compass-fill: rgba(29, 187, 230, 0.3);
    --compass-stroke: var(--aero);
    --warning-color: #ff6b6b;
    --modal-bg: rgba(26, 52, 126, 0.95);
    --modal-content-bg: rgba(48, 117, 182, 0.95);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--primary-bg), var(--secondary-bg));
    color: var(--text-primary);
    min-height: 100vh;
    padding: 2rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: calc(100vh - 4rem);
}

header {
    text-align: center;
    flex-shrink: 0;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.score-display {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.coordinates {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
    color: var(--text-secondary);
}

.weather-description {
    font-size: 1.2rem;
    color: var(--accent-color);
    text-transform: capitalize;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex: 1;
    min-height: 0;
}

.visualization-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    flex: 1;
    min-height: 0;
}

.compass-container {
    background: var(--grid-bg);
    border-radius: 1rem;
    padding: 1rem;
    border: 1px solid var(--card-border);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#compass {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
}

#map {
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--card-border);
    height: 100%;
    width: 100%;
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--grid-bg);
    border-radius: 1rem;
    border: 1px solid var(--card-border);
    flex-shrink: 0;
}

.weather-item {
    background: rgba(26, 52, 126, 0.3);
    padding: 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid var(--card-border);
    transition: transform 0.2s ease;
}

.weather-item:hover {
    transform: translateY(-2px);
}

.has-warnings {
    color: var(--warning-color);
    cursor: pointer;
}

.has-warnings:hover {
    text-decoration: underline;
}

.weather-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.weather-modal-content {
    background: var(--modal-content-bg);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--card-border);
}

.weather-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.warnings-list {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.warning-item {
    padding: 1.5rem;
    background: rgba(26, 52, 126, 0.3);
    border-radius: 0.75rem;
    border: 1px solid var(--card-border);
}

.warning-item h3 {
    color: var(--warning-color);
    margin-bottom: 0.5rem;
}

.warning-sender {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.warning-time {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.warning-description {
    white-space: pre-line;
    line-height: 1.5;
}

.weather-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

@media (max-width: 1024px) {
    body {
        padding: 1rem;
    }

    .container {
        height: auto;
        min-height: calc(100vh - 2rem);
    }

    .visualization-section {
        grid-template-columns: 1fr;
        height: auto;
    }

    .compass-container {
        aspect-ratio: 1;
    }

    #map {
        height: 400px;
    }

    .weather-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1rem;
    }
}

@media (max-width: 640px) {
    .weather-grid {
        grid-template-columns: 1fr;
    }

    .weather-item {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .score-display {
        font-size: 2rem;
    }

    .weather-modal {
        padding: 1rem;
    }

    .weather-modal-content {
        padding: 1rem;
    }
}