/* Reset and base styles */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}

:root{
    --primary-color:#667eea;
    --secondary-color:#764ba2;
    --success-color:#2ecc71;
    --warning-color:#f39c12;
    --error-color:#e74c3c;
    --text-dark:#2c3e50;
    --text-light:#7f8c8d;
    --border-color:#e1e8ed;
    --bg-light:#f8f9fa;
    --shadow-light:0 2px 10px rgba(0,0,0,.1);
    --shadow-medium:0 5px 20px rgba(0,0,0,.15);
    --shadow-heavy:0 20px 40px rgba(0,0,0,.1);
    --border-radius:0.75rem;
    --transition:all 0.3s ease;
    --panel-z:1000;
}

/* Skip navigation for accessibility */
.skip-link{
    position:absolute;
    top:-40px;
    left:6px;
    background:var(--primary-color);
    color:white;
    padding:8px;
    text-decoration:none;
    border-radius:4px;
    z-index:1000;
    transition:top 0.3s;
}
.skip-link:focus{top:6px}

/* Reduced motion support */
@media (prefers-reduced-motion:reduce){
    *,*::before,*::after{
        animation-duration:0.01ms !important;
        animation-iteration-count:1 !important;
        transition-duration:0.01ms !important;
    }
    .snowflake{display:none !important}
}

body{
    font-family:'Inter',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
    background: linear-gradient(to bottom, #dbeafe, #93c5fd, #60a5fa);
    color: #111827;
    min-height:100vh;
    display:flex;
    flex-direction:column;
    align-items:center;
    padding:1.25rem;
    line-height:1.6;
    position:relative;
    overflow-x:hidden;
}

/* Header Section - Centered title in slim container */
.main-header {
    width: 100%;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.header-container {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 2rem;
    padding: 1rem 2rem;
    display: inline-block;
    box-shadow: var(--shadow-light);
}

.main-title {
    color: var(--text-dark);
    font-size: 2.5rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.02em;
}

/* Smart Snowflake Animation - Non-layout affecting */
#snowflake-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    will-change: auto;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: rgba(255, 255, 255, 0.8);
    animation: fall linear infinite;
    pointer-events: none;
    font-size: 16px;
    will-change: transform;
}

/* Light snowfall (20-40% chance) */
.snowflake.light {
    animation-duration: 8s;
    opacity: 0.6;
}

/* Medium snowfall (40-70% chance) */
.snowflake.medium {
    animation-duration: 6s;
    opacity: 0.8;
}

/* Heavy snowfall (70-100% chance) */
.snowflake.heavy {
    animation-duration: 4s;
    opacity: 1;
    animation-name: fall-with-wind;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

@keyframes fall-with-wind {
    0% {
        transform: translateY(-10px) translateX(0) rotate(0deg);
    }
    25% {
        transform: translateY(25vh) translateX(10px) rotate(90deg);
    }
    50% {
        transform: translateY(50vh) translateX(-5px) rotate(180deg);
    }
    75% {
        transform: translateY(75vh) translateX(15px) rotate(270deg);
    }
    100% {
        transform: translateY(100vh) translateX(0) rotate(360deg);
    }
}

/* Snow controls - Smaller and more compact */
.snow-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.snow-toggle-btn, .performance-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 1.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.snow-toggle-btn:hover, .performance-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.snow-toggle-btn.active, .performance-toggle.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Compact snow readiness meter */
.snow-readiness.compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.6rem 1rem;
    border-radius: 1rem;
    color: #111827;
    font-size: 0.75rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 160px;
}

.readiness-content {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.readiness-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.readiness-icon.bounce {
    animation: iconBounce 0.6s ease-in-out;
}

.readiness-text {
    font-weight: 600;
    font-size: 0.8rem;
}

/* Color-coded severity tiers */
.snow-readiness.severity-low {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
}

.snow-readiness.severity-low .readiness-text {
    color: #166534;
}

.snow-readiness.severity-medium {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.4);
}

.snow-readiness.severity-medium .readiness-text {
    color: #92400e;
}

.snow-readiness.severity-high {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

.snow-readiness.severity-high .readiness-text {
    color: #991b1b;
}

/* Compact progress bar */
.snow-progress-container.compact {
    width: 100%;
    position: relative;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0.3rem;
    height: 6px;
    overflow: hidden;
}

.snow-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #eab308, #ef4444);
    border-radius: 0.3rem;
    width: 0%;
    transition: width 0.8s ease-in-out;
    position: relative;
}

.snow-percentage {
    position: absolute;
    top: -1.3rem;
    right: 0;
    font-size: 0.65rem;
    font-weight: 600;
    color: #374151;
}

/* Icon bounce animation */
@keyframes iconBounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    80% {
        transform: translateY(-4px);
    }
}

/* Main container with glassmorphism */
.container{
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 1rem;
    box-shadow:var(--shadow-heavy);
    padding:2rem;
    max-width:28rem;
    width:100%;
    text-align:center;
    position:relative;
    z-index:2;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.welcome-section {
    margin-bottom: 1.5rem;
}

.welcome-text {
    color: var(--text-light);
    font-size: 1rem;
    margin: 0;
}

/* Input section - Inline style */
.input-section{margin-bottom:1.5rem}

.input-group.inline {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.location-input{
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
    min-height: 2.5rem;
    font-family: inherit;
}

.location-input:focus{
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.location-input::placeholder{color: var(--text-light)}

/* Inline button styling */
.check-btn.inline{
    background: linear-gradient(45deg,var(--primary-color),var(--secondary-color));
    color: white;
    border: none;
    padding: 0.875rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: inherit;
}

.check-btn.inline:hover:not(:disabled){
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102,126,234,0.3);
}

.check-btn.inline:active{transform: translateY(0)}
.check-btn.inline:disabled{
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.check-btn.inline:focus{
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading animation */
.loading{
    display:none;
    margin:1.25rem 0;
}
.loading.show{display:block}

.spinner{
    width:2rem;
    height:2rem;
    border:3px solid #f3f3f3;
    border-top:3px solid var(--primary-color);
    border-radius:50%;
    animation:spin 1s linear infinite;
    margin:0 auto 0.5rem;
}

@keyframes spin{
    0%{transform:rotate(0deg)}
    100%{transform:rotate(360deg)}
}

/* Movable/Resizable Results Panel */
.results-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    z-index: var(--panel-z);
    display: none;
    overflow: hidden;
    resize: both;
    min-width: 300px;
    min-height: 200px;
}

.results-panel.show {
    display: block;
}

.results-panel.minimized .panel-content,
.results-panel.minimized .panel-actions {
    display: none;
}

.results-panel.maximized {
    top: 5%;
    left: 5%;
    transform: none;
    width: 90%;
    height: 90%;
    resize: none;
}

.panel-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.panel-title {
    font-weight: 600;
    font-size: 1rem;
}

.panel-controls {
    display: flex;
    gap: 0.5rem;
}

.panel-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.panel-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.panel-content {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.panel-actions {
    padding: 0 1.5rem 1.5rem;
    text-align: center;
}

.action-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--secondary-color);
}

/* Results content styling */
.snow-chance{
    font-size:1.125rem;
    font-weight:bold;
    margin-bottom:1rem;
    color: var(--text-dark);
}

.forecast-details{
    font-size:0.95rem;
    line-height:1.6;
    color: var(--text-dark);
    text-align: left;
}

.location-name{
    font-size:1.1rem;
    font-weight:600;
    margin-bottom:0.75rem;
    color: var(--primary-color);
}

.result-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.result-icon.bounce {
    animation: iconBounce 0.6s ease-in-out;
}

/* Panel dragging states */
.results-panel.dragging {
    transition: none;
    user-select: none;
}

/* Email signup section - Compact and minimal */
.email-signup.compact{
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin: 1.5rem auto;
    text-align: center;
    max-width: 28rem;
    width: 100%;
    position: relative;
    z-index: 2;
}

.email-signup.compact h3{
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.email-signup.compact p{
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.email-form.compact{
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.email-input{
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 0.4rem;
    font-size: 0.8rem;
    transition: var(--transition);
    min-height: 2.2rem;
}

.email-input:focus{
    border-color: var(--primary-color);
    outline: none;
}

.email-btn{
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-height: 2.2rem;
    white-space: nowrap;
}

.email-btn:hover{
    background: var(--secondary-color);
}

.privacy-notice{
    font-size: 0.7rem;
    color: var(--text-light);
}

/* Ad containers */
.ad-container {
    width: 100%;
    min-height: 90px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
    position: relative;
    z-index: 2;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.ad-container::after {
    content: 'Advertisement Space';
}

.ad-container.mobile {
    min-height: 50px;
    margin: 0.5rem 0;
}

@media (max-width: 768px) {
    .ad-container:not(.mobile) {
        display: none;
    }
}

@media (min-width: 769px) {
    .ad-container.mobile {
        display: none;
    }
}

/* Description section */
.description{
    max-width: 50rem;
    margin: 2rem auto;
    padding: 0 1.25rem;
    text-align: center;
    color: #374151;
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 1rem;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
}

.modal-body p:last-child {
    margin-bottom: 0;
}

/* Footer with 3-column layout */
footer{
    background: #000000;
    color: white;
    padding: 2rem 1.25rem 1rem;
    margin-top: 2.5rem;
    width: 100%;
    position: relative;
    z-index: 2;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

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

.footer-column a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-column a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.social-column {
    align-items: flex-start;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.social-btn.twitter:hover {
    background: #1DA1F2;
    border-color: #1DA1F2;
}

.social-btn.facebook:hover {
    background: #4267B2;
    border-color: #4267B2;
}

.social-btn.instagram:hover {
    background: linear-gradient(45deg, #E4405F, #C13584, #833AB4);
    border-color: #E4405F;
}

.copyright{
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Cookie consent banner */
.cookie-banner{
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(44,62,80,0.95);
    color: white;
    padding: 1rem;
    display: none;
    z-index: 1000;
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.5;
}

.cookie-banner.show{display: block}

.cookie-banner-content{
    max-width: 50rem;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-text{flex: 1; min-width: 15rem}

.cookie-buttons{
    display: flex;
    gap: 0.625rem;
}

.cookie-btn{
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: var(--transition);
}

.cookie-btn.accept{
    background: var(--success-color);
    color: white;
}

.cookie-btn.decline{
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.cookie-btn:hover{opacity: 0.9}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Performance mode styles */
.performance-mode .snowflake {
    display: none !important;
}

.performance-mode .results-panel,
.performance-mode .container {
    backdrop-filter: none;
    background: rgba(255, 255, 255, 0.9);
}

.performance-mode *,
.performance-mode *::before,
.performance-mode *::after {
    transition-duration: 0.1s !important;
    animation-duration: 0.1s !important;
}

/* Responsive design */
@media (max-width: 768px){
    .main-title {
        font-size: 2rem;
    }

    .header-container {
        padding: 0.75rem 1.5rem;
    }
    
    .container{
        padding: 1.5rem;
        margin: 0.5rem;
        max-width: none;
    }
    
    .input-group.inline {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .check-btn.inline {
        width: 100%;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    
    .email-form.compact {
        flex-direction: column;
    }
    
    .email-btn{
        width: 100%;
    }
    
    .cookie-banner-content{
        flex-direction: column;
        text-align: center;
    }

    .snow-controls {
        flex-direction: column;
        gap: 0.75rem;
    }

    .results-panel {
        width: 95%;
        max-width: none;
    }

    .results-panel.maximized {
        top: 2%;
        left: 2%;
        width: 96%;
        height: 96%;
    }
}

@media (max-width: 480px){
    .main-title {
        font-size: 1.75rem;
    }

    .container{
        padding: 1rem;
        margin: 0.25rem;
    }
    
    .description{
        font-size: 0.85rem;
        margin: 1.5rem auto;
    }

    .panel-content {
        padding: 1rem;
    }

    .footer-content {
        gap: 1rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high){
    :root{
        --border-color: #000;
        --text-light: #000;
    }
    
    .location-input:focus,
    .email-input:focus{
        border-color: #000;
        box-shadow: 0 0 0 3px rgba(0,0,0,0.3);
    }
}

/* Focus management for keyboard navigation */
.modal:focus-within .modal-close:focus,
.results-panel:focus-within .panel-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}