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

:root {
    --primary-blue: #2563eb;
    --dark-blue: #1e40af;
    --light-blue: #3b82f6;
    --sky-blue: #0891b2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --success-green: #16a34a;
    --warning-yellow: #eab308;
    --danger-red: #dc2626;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 35%, #0891b2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ============================================
   SNOW ANIMATION
   ============================================ */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10%;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.5em;
    opacity: 0.8;
    animation: fall linear infinite;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    user-select: none;
}

@keyframes fall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(105vh) rotate(360deg);
        opacity: 0;
    }
}

/* Snowflake positioning */
.snowflake:nth-child(1) { left: 5%; animation-duration: 11s; animation-delay: 0s; }
.snowflake:nth-child(2) { left: 10%; animation-duration: 13s; animation-delay: 2s; font-size: 1.2em; }
.snowflake:nth-child(3) { left: 15%; animation-duration: 9s; animation-delay: 4s; }
.snowflake:nth-child(4) { left: 20%; animation-duration: 15s; animation-delay: 0s; font-size: 1.8em; }
.snowflake:nth-child(5) { left: 25%; animation-duration: 12s; animation-delay: 3s; }
.snowflake:nth-child(6) { left: 30%; animation-duration: 10s; animation-delay: 1s; font-size: 1.4em; }
.snowflake:nth-child(7) { left: 35%; animation-duration: 14s; animation-delay: 5s; }
.snowflake:nth-child(8) { left: 40%; animation-duration: 11s; animation-delay: 2s; font-size: 1.6em; }
.snowflake:nth-child(9) { left: 45%; animation-duration: 13s; animation-delay: 0s; }
.snowflake:nth-child(10) { left: 50%; animation-duration: 10s; animation-delay: 4s; }
.snowflake:nth-child(11) { left: 55%; animation-duration: 12s; animation-delay: 1s; font-size: 1.3em; }
.snowflake:nth-child(12) { left: 60%; animation-duration: 14s; animation-delay: 3s; }
.snowflake:nth-child(13) { left: 65%; animation-duration: 11s; animation-delay: 5s; font-size: 1.5em; }
.snowflake:nth-child(14) { left: 70%; animation-duration: 9s; animation-delay: 2s; }
.snowflake:nth-child(15) { left: 75%; animation-duration: 13s; animation-delay: 0s; font-size: 1.7em; }
.snowflake:nth-child(16) { left: 80%; animation-duration: 12s; animation-delay: 4s; }
.snowflake:nth-child(17) { left: 85%; animation-duration: 10s; animation-delay: 1s; font-size: 1.4em; }
.snowflake:nth-child(18) { left: 90%; animation-duration: 14s; animation-delay: 3s; }
.snowflake:nth-child(19) { left: 95%; animation-duration: 11s; animation-delay: 5s; }
.snowflake:nth-child(20) { left: 8%; animation-duration: 13s; animation-delay: 2s; font-size: 1.6em; }
.snowflake:nth-child(21) { left: 18%; animation-duration: 12s; animation-delay: 1s; }
.snowflake:nth-child(22) { left: 28%; animation-duration: 10s; animation-delay: 4s; font-size: 1.3em; }
.snowflake:nth-child(23) { left: 38%; animation-duration: 14s; animation-delay: 0s; }
.snowflake:nth-child(24) { left: 48%; animation-duration: 11s; animation-delay: 3s; font-size: 1.5em; }
.snowflake:nth-child(25) { left: 58%; animation-duration: 13s; animation-delay: 2s; }
.snowflake:nth-child(26) { left: 68%; animation-duration: 9s; animation-delay: 5s; font-size: 1.2em; }
.snowflake:nth-child(27) { left: 78%; animation-duration: 12s; animation-delay: 1s; }
.snowflake:nth-child(28) { left: 88%; animation-duration: 10s; animation-delay: 4s; font-size: 1.6em; }
.snowflake:nth-child(29) { left: 93%; animation-duration: 14s; animation-delay: 0s; }
.snowflake:nth-child(30) { left: 3%; animation-duration: 11s; animation-delay: 3s; font-size: 1.4em; }

/* ============================================
   SCREEN MANAGEMENT
   ============================================ */
.screen {
    position: relative;
    z-index: 10;
    padding: 2rem;
    min-height: 100vh;
    transition: opacity 0.3s ease;
}

.screen.hidden {
    display: none;
}

/* Desktop/Browser: 75% of screen width */
.container {
    max-width: 75vw;
    margin: 0 auto;
}

/* Input page container stays centered and smaller */
#inputScreen .container {
    max-width: 800px;
}

/* Results page uses 75% of screen on desktop */
.results-container {
    max-width: 75vw !important;
    margin: 0 auto;
}

/* ============================================
   INPUT SCREEN STYLES
   ============================================ */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
    color: white;
    animation: fadeInDown 0.8s ease;
}

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

.header-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
    }
    50% { 
        transform: scale(1.1);
        filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.8));
    }
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.header p {
    color: #bfdbfe;
    font-size: 1.2rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.card {
    background: white;
    border-radius: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
    padding: 3rem;
    animation: fadeInUp 0.8s ease;
    backdrop-filter: blur(10px);
}

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

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    color: var(--gray-800);
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.input-wrapper {
    display: flex;
    gap: 0.75rem;
}

input[type="text"] {
    flex: 1;
    padding: 1.25rem 1.5rem;
    border: 2px solid var(--gray-300);
    border-radius: 1rem;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: var(--gray-50);
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: white;
}

input[type="text"]::placeholder {
    color: #9ca3af;
}

button {
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: white;
    border: none;
    border-radius: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

button:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--light-blue) 0%, var(--primary-blue) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.5);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-icon {
    font-size: 1.2rem;
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

.error {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: #fef2f2;
    border-left: 4px solid var(--danger-red);
    border-radius: 0.75rem;
    color: #991b1b;
    display: none;
    align-items: center;
    gap: 0.75rem;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.error.show {
    display: flex;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-top: 2.5rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border-radius: 1rem;
    font-size: 0.95rem;
    color: var(--gray-700);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
}

.feature:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-blue);
}

.feature-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.feature-content {
    flex: 1;
}

.feature-title {
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.feature-desc {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.info-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 1rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    border: 1px solid #bfdbfe;
}

.info-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.info-text {
    color: #1e40af;
    line-height: 1.6;
    font-size: 0.95rem;
}

.footer {
    text-align: center;
    margin-top: 2.5rem;
    color: #bfdbfe;
    font-size: 0.95rem;
}

.footer-icons {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5rem;
}

/* ============================================
   RESULTS SCREEN STYLES
   ============================================ */
.results-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
}

.back-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 1rem 1.75rem;
    margin-bottom: 2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.back-arrow {
    font-size: 1.5rem;
}

.results-card {
    background: white;
    border-radius: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    animation: fadeInUp 0.8s ease;
}

/* Percentage Display */
.percentage-display {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 50%, #e0f2fe 100%);
    position: relative;
    overflow: hidden;
}

.percentage-display::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

.location-name {
    font-size: 1.75rem;
    color: var(--dark-blue);
    font-weight: 700;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 1;
}

.percentage-circle {
    position: relative;
    display: inline-block;
    margin-bottom: 2.5rem;
    z-index: 1;
}

.progress-ring {
    transform: rotate(-90deg);
    filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.3));
}

.progress-ring-bg {
    opacity: 0.3;
}

.progress-ring-fill {
    stroke-dasharray: 628.32;
    stroke-dashoffset: 628.32;
    transition: stroke-dashoffset 2s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.5s ease;
    stroke-linecap: round;
}

.percentage-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 900;
    display: flex;
    align-items: baseline;
}

.percentage-number {
    font-size: 4.5rem;
    color: var(--dark-blue);
}

.percentage-symbol {
    font-size: 3rem;
    color: var(--light-blue);
    margin-left: 0.25rem;
}

.snow-day-verdict {
    font-size: 2.75rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.snow-day-verdict.yes {
    color: var(--primary-blue);
    animation: bounce 1s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.snow-day-verdict.no {
    color: var(--gray-600);
}

.confidence-badge {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: white;
    border-radius: 3rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.confidence-badge.very-high,
.confidence-badge.high {
    color: var(--success-green);
    border: 3px solid var(--success-green);
}

.confidence-badge.medium {
    color: var(--warning-yellow);
    border: 3px solid var(--warning-yellow);
}

.confidence-badge.low,
.confidence-badge.very-low {
    color: var(--danger-red);
    border: 3px solid var(--danger-red);
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
}

.quick-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2rem 1.5rem;
    border-right: 1px solid var(--gray-200);
    transition: background 0.3s ease;
}

.quick-stat:hover {
    background: var(--gray-50);
}

.quick-stat:last-child {
    border-right: none;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Alerts Section */
.alerts-section {
    padding: 2.5rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 6px solid var(--warning-yellow);
    display: none;
}

.alerts-section.show {
    display: block;
}

.alert-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #92400e;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-item {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--warning-yellow);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alert-item:last-child {
    margin-bottom: 0;
}

.alert-type {
    font-weight: 700;
    color: #92400e;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.alert-description {
    color: #78350f;
    line-height: 1.6;
}

/* Conditions Section */
.conditions-section {
    padding: 3rem;
}

.conditions-section h2 {
    font-size: 2.25rem;
    color: var(--gray-800);
    margin-bottom: 2rem;
    font-weight: 800;
}

.condition-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.condition-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.75rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border-radius: 1.25rem;
    transition: all 0.3s ease;
    border: 2px solid var(--gray-200);
}

.condition-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-blue);
}

.condition-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.condition-details {
    flex: 1;
}

.condition-label {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.condition-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1.3;
}

.analysis-box {
    padding: 2rem;
    background: var(--gray-100);
    border-radius: 1.25rem;
    margin-bottom: 1.5rem;
    border: 2px solid var(--gray-200);
}

.analysis-box h3 {
    font-size: 1.5rem;
    color: var(--gray-800);
    margin-bottom: 1.25rem;
    font-weight: 800;
}

.analysis-box p {
    color: var(--gray-600);
    line-height: 1.8;
    font-size: 1.05rem;
}

.radar-analysis {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 6px solid var(--primary-blue);
    border: 2px solid #bfdbfe;
}

.radar-analysis h3 {
    color: var(--dark-blue);
}

.radar-analysis p {
    color: #1e40af;
}

.timing-analysis {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 6px solid #f59e0b;
    border: 2px solid #fbbf24;
}

.timing-analysis h3 {
    color: #92400e;
}

.timing-analysis p {
    color: #78350f;
}

.advisory-box {
    padding: 2rem;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left: 6px solid var(--danger-red);
    border-radius: 1.25rem;
    border: 2px solid #fca5a5;
}

.advisory-box h3 {
    font-size: 1.5rem;
    color: #991b1b;
    margin-bottom: 1.25rem;
    font-weight: 800;
}

.advisory-box p {
    color: #7f1d1d;
    line-height: 1.8;
    font-weight: 600;
    font-size: 1.05rem;
}

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

/* Tablets (768px - 1200px) */
@media (max-width: 1200px) {
    .results-container {
        max-width: 90vw !important;
    }
    
    .condition-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 992px) {
    .condition-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-stat {
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
    }
    
    .quick-stat:nth-child(odd) {
        border-right: 1px solid var(--gray-200);
    }
    
    .quick-stat:last-child {
        border-bottom: none;
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .screen {
        padding: 1rem;
    }
    
    /* Mobile containers are much smaller */
    .container {
        max-width: 100% !important;
        padding: 0;
    }
    
    .results-container {
        max-width: 100% !important;
    }
    
    #inputScreen .container {
        max-width: 100% !important;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header-icon {
        font-size: 3.5rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .card {
        padding: 2rem;
        border-radius: 1.5rem;
    }
    
    .input-wrapper {
        flex-direction: column;
    }
    
    button {
        width: 100%;
        justify-content: center;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .percentage-display {
        padding: 2.5rem 1.5rem;
    }
    
    .location-name {
        font-size: 1.25rem;
    }
    
    .percentage-circle svg {
        width: 180px;
        height: 180px;
    }
    
    .percentage-number {
        font-size: 3rem;
    }
    
    .percentage-symbol {
        font-size: 2rem;
    }
    
    .snow-day-verdict {
        font-size: 1.75rem;
    }
    
    .confidence-badge {
        font-size: 0.8rem;
        padding: 0.6rem 1.5rem;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
    }
    
    .quick-stat {
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
        padding: 1.5rem;
    }
    
    .quick-stat:nth-child(odd) {
        border-right: none;
    }
    
    .quick-stat:last-child {
        border-bottom: none;
    }
    
    .conditions-section {
        padding: 2rem;
    }
    
    .conditions-section h2 {
        font-size: 1.75rem;
    }
    
    .condition-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .condition-item {
        padding: 1.25rem;
    }
    
    .condition-icon {
        font-size: 2rem;
    }
    
    .condition-value {
        font-size: 1.2rem;
    }
    
    .analysis-box,
    .advisory-box {
        padding: 1.5rem;
    }
    
    .analysis-box h3,
    .advisory-box h3 {
        font-size: 1.25rem;
    }
    
    .analysis-box p,
    .advisory-box p {
        font-size: 0.95rem;
    }
    
    .alerts-section {
        padding: 1.5rem;
    }
    
    .alert-title {
        font-size: 1.25rem;
    }
}

/* Small phones (< 480px) */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1.75rem;
    }
    
    .header-icon {
        font-size: 3rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .percentage-circle svg {
        width: 160px;
        height: 160px;
    }
    
    .percentage-number {
        font-size: 2.5rem;
    }
    
    .percentage-symbol {
        font-size: 1.75rem;
    }
    
    .snow-day-verdict {
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
}