/* ============================================
   SNOW FORECAST - Styles
   A fun, snowy theme for weather forecasts
   ============================================ */

:root {
    --snow-white: #ffffff;
    --ice-blue: #e8f4fc;
    --frost-blue: #b8d4e8;
    --sky-blue: #4a90b8;
    --deep-blue: #1a3a52;
    --night-blue: #0d1b2a;
    --accent-blue: #5cb8e8;
    --snow-shadow: rgba(0, 0, 0, 0.1);
    --glow: rgba(92, 184, 232, 0.3);
}

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

body {
    font-family: 'Fredoka', sans-serif;
    background: linear-gradient(180deg, var(--night-blue) 0%, var(--deep-blue) 50%, var(--sky-blue) 100%);
    min-height: 100vh;
    color: var(--snow-white);
    overflow-x: hidden;
}

#snow-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

#accumulation-canvas {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.container {
    position: relative;
    z-index: 5;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
}

.snowflake {
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

.snowflake:last-child {
    animation-delay: 1.5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(10deg); }
}

.subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    font-weight: 400;
}

/* ============================================
   SEARCH SECTION
   ============================================ */

.search-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 0.75rem;
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#zip-input {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.25rem;
    padding: 0.75rem 2.75rem 0.75rem 1.25rem;
    border: none;
    border-radius: 30px;
    background: var(--snow-white);
    color: var(--deep-blue);
    width: 180px;
    outline: none;
    transition: box-shadow 0.3s ease;
}

#zip-input::placeholder {
    color: var(--frost-blue);
}

#zip-input:focus {
    box-shadow: 0 0 0 3px var(--accent-blue);
}

.search-btn {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--accent-blue), var(--sky-blue));
    color: var(--snow-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(92, 184, 232, 0.4);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(92, 184, 232, 0.5);
}

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

.geo-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--frost-blue);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.geo-btn:hover {
    color: var(--deep-blue);
    background: var(--ice-blue);
}

.geo-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.geo-btn .geo-icon {
    width: 18px;
    height: 18px;
}

.geo-btn .geo-icon.spinning {
    animation: spin 1s linear infinite;
}

.location-display {
    margin-top: 1rem;
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ============================================
   TIME TOGGLE
   ============================================ */

.time-toggle {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.time-btn {
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.6rem 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--snow-white);
    cursor: pointer;
    transition: all 0.3s ease;
}

.time-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.time-btn.active {
    background: var(--snow-white);
    color: var(--deep-blue);
    border-color: var(--snow-white);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.toggle-separator {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.5rem;
    margin: 0 0.5rem;
    align-self: center;
}

.unit-btn {
    font-family: 'Fredoka', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--snow-white);
    cursor: pointer;
    transition: all 0.3s ease;
}

.unit-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.unit-btn.active {
    background: var(--snow-white);
    color: var(--deep-blue);
    border-color: var(--snow-white);
}

/* ============================================
   AVERAGE SECTION (Center Stage)
   ============================================ */

.average-section {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.average-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(15px);
    border-radius: 30px;
    padding: 2.5rem 4rem;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.average-snow-stack {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 120px;
    margin-bottom: 1.5rem;
    gap: 4px;
}

.average-snow-stack .snow-pile {
    width: 40px;
    background: linear-gradient(180deg, var(--snow-white) 0%, var(--ice-blue) 100%);
    border-radius: 20px 20px 8px 8px;
    box-shadow: 0 4px 15px var(--snow-shadow);
    transition: height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.average-snow-stack .snow-pile:nth-child(1) {
    height: 60px;
    animation: pile-bounce 2s ease-in-out infinite;
}

.average-snow-stack .snow-pile:nth-child(2) {
    height: 90px;
    animation: pile-bounce 2s ease-in-out infinite 0.2s;
}

.average-snow-stack .snow-pile:nth-child(3) {
    height: 60px;
    animation: pile-bounce 2s ease-in-out infinite 0.4s;
}

@keyframes pile-bounce {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.05); }
}

.average-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.average-label {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
}

.average-value {
    font-size: 4rem;
    font-weight: 700;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    line-height: 1;
}

.average-sublabel {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Severity Badge */
.severity-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0.5rem 0;
    animation: badgePop 0.4s ease-out;
}

@keyframes badgePop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.severity-badge.dusting {
    background: rgba(200, 200, 220, 0.3);
    color: #e0e8ff;
    border: 1px solid rgba(200, 200, 220, 0.4);
}

.severity-badge.coating {
    background: rgba(150, 200, 255, 0.3);
    color: #d0e8ff;
    border: 1px solid rgba(150, 200, 255, 0.4);
}

.severity-badge.accumulating {
    background: rgba(100, 180, 255, 0.3);
    color: #b0d8ff;
    border: 1px solid rgba(100, 180, 255, 0.5);
}

.severity-badge.significant {
    background: rgba(255, 200, 100, 0.3);
    color: #ffe0a0;
    border: 1px solid rgba(255, 200, 100, 0.5);
}

.severity-badge.major {
    background: rgba(255, 150, 100, 0.3);
    color: #ffc8a0;
    border: 1px solid rgba(255, 150, 100, 0.5);
}

.severity-badge.historic {
    background: rgba(255, 100, 100, 0.35);
    color: #ffb0b0;
    border: 1px solid rgba(255, 100, 100, 0.6);
    animation: badgePop 0.4s ease-out, historicGlow 1.5s ease-in-out infinite alternate;
}

@keyframes historicGlow {
    from { box-shadow: 0 0 10px rgba(255, 100, 100, 0.3); }
    to { box-shadow: 0 0 20px rgba(255, 100, 100, 0.6); }
}

/* Confidence Indicator */
.confidence-indicator {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.confidence-bar {
    width: 150px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease, background 0.6s ease;
}

.confidence-fill.high {
    background: linear-gradient(90deg, #4ade80, #22c55e);
    width: 100%;
}

.confidence-fill.medium {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    width: 66%;
}

.confidence-fill.low {
    background: linear-gradient(90deg, #f87171, #ef4444);
    width: 33%;
}

.confidence-label {
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.9;
}

.confidence-label.high { color: #4ade80; }
.confidence-label.medium { color: #fbbf24; }
.confidence-label.low { color: #f87171; }

.confidence-sublabel {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* ============================================
   LOADING STATE
   ============================================ */

.loading {
    text-align: center;
    padding: 3rem;
}

.loading-snowflake {
    font-size: 4rem;
    animation: spin 2s linear infinite;
}

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

.loading p {
    margin-top: 1rem;
    font-size: 1.25rem;
    opacity: 0.9;
}

/* ============================================
   ERROR STATE
   ============================================ */

.error {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 100, 100, 0.2);
    border-radius: 20px;
    border: 1px solid rgba(255, 100, 100, 0.3);
}

/* ============================================
   NO SNOW STATE
   ============================================ */

.no-snow {
    text-align: center;
    padding: 3rem;
}

.no-snow-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.no-snow p {
    font-size: 1.25rem;
}

.no-snow-sub {
    opacity: 0.7;
    font-size: 1rem !important;
    margin-top: 0.5rem;
}

/* ============================================
   MODEL RESULTS
   ============================================ */

.models-section {
    margin-top: 2rem;
    position: relative;
    z-index: 10;
}

.models-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.models-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.model-card {
    position: relative;
    background: rgba(13, 27, 42, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1rem 0.75rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.model-card:hover {
    transform: translateY(-3px);
    background: rgba(13, 27, 42, 0.95);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.model-name {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    margin-bottom: 0.75rem;
}

.model-snow-stack {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 60px;
    margin-bottom: 0.75rem;
}

.model-snow-stack .snow-pile {
    width: 40px;
    background: linear-gradient(180deg, var(--snow-white) 0%, var(--frost-blue) 100%);
    border-radius: 12px 12px 4px 4px;
    box-shadow: 0 3px 10px var(--snow-shadow);
    transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.model-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.model-value.zero {
    opacity: 0.5;
}

.model-update {
    font-size: 0.65rem;
    opacity: 0.6;
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.model-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(13, 27, 42, 0.95);
    color: var(--snow-white);
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.model-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(13, 27, 42, 0.95);
}

.model-card:hover .model-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   SHARE SECTION
   ============================================ */

.share-section {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    position: relative;
    z-index: 10;
}

.share-btn {
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    background: rgba(13, 27, 42, 0.85);
    color: var(--snow-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.share-btn:hover {
    background: rgba(13, 27, 42, 0.95);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Share Modal */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.share-modal-content {
    background: linear-gradient(135deg, var(--deep-blue), var(--night-blue));
    border-radius: 24px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.share-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--snow-white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.share-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.share-modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.share-location {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 1.5rem;
}

.share-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.share-option {
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--snow-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.share-option:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.share-icon {
    font-size: 1.25rem;
}

.share-copied {
    color: #4ade80;
    font-weight: 500;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease;
}

/* ============================================
   DISCLAIMER
   ============================================ */

.disclaimer {
    text-align: center;
    margin-top: 3rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
}

.disclaimer p {
    font-size: 0.8rem;
    opacity: 0.7;
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
    position: relative;
    z-index: 10;
    font-size: 0.9rem;
}

.footer a {
    color: var(--accent-blue);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    .models-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }

    .search-box {
        flex-direction: column;
        border-radius: 25px;
        width: 100%;
        max-width: 300px;
    }

    #zip-input {
        width: 100%;
        text-align: center;
    }

    .search-btn {
        justify-content: center;
    }

    .average-card {
        padding: 2rem;
    }

    .average-value {
        font-size: 3rem;
    }

    .time-toggle {
        flex-wrap: wrap;
    }

    .models-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem 0.75rem;
    }

    .models-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .model-card {
        padding: 1rem;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.model-card {
    animation: fadeInUp 0.5s ease-out backwards;
}

.model-card:nth-child(1) { animation-delay: 0.1s; }
.model-card:nth-child(2) { animation-delay: 0.15s; }
.model-card:nth-child(3) { animation-delay: 0.2s; }
.model-card:nth-child(4) { animation-delay: 0.25s; }
.model-card:nth-child(5) { animation-delay: 0.3s; }
.model-card:nth-child(6) { animation-delay: 0.35s; }
