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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 0.5s ease;
}

/* Dynamic background colors based on temperature */
body.extreme-cold { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); }
body.very-cold { background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%); }
body.cold { background: linear-gradient(135deg, #3498db 0%, #5dade2 100%); }
body.comfortable { background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%); }
body.warm { background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%); }
body.hot { background: linear-gradient(135deg, #e67e22 0%, #d35400 100%); }
body.very-hot { background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%); }
body.extreme-heat { background: linear-gradient(135deg, #8e44ad 0%, #c0392b 100%); }

.container {
    max-width: 800px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.loading-indicator.hidden {
    display: none;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ecf0f1;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.temp-source {
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 20px;
    display: inline-block;
    font-size: 0.85rem;
    color: #2c3e50;
}

.temp-source.hidden {
    display: none;
}

/* Temperature Display */
.temperature-display {
    margin: 30px 0;
    display: flex;
    justify-content: center;
}

.temp-box {
    background: white;
    border: 3px solid #ecf0f1;
    border-radius: 16px;
    padding: 30px 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 280px;
    transition: all 0.3s ease;
}

.temp-value {
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    transition: color 0.3s ease;
}

.temp-value.fahrenheit {
    color: #e74c3c;
}

.temp-value.celsius {
    color: #3498db;
}

.temp-divider {
    height: 2px;
    background: linear-gradient(to right, #e74c3c, #3498db);
    margin: 0 20px;
}

/* Wheel Container */
.wheel-container {
    position: relative;
    height: 300px;
    overflow: hidden;
    margin: 40px 0;
    border-radius: 16px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.9), rgba(255,255,255,0.5));
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.wheel-container:active {
    cursor: grabbing;
}

.pointer {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: #2c3e50;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    pointer-events: none;
}

.wheel-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.interaction-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(44, 62, 80, 0.8);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    pointer-events: none;
    animation: fadeInOut 3s ease-in-out;
    z-index: 10;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 1; }
}

.hint-text {
    display: inline-block;
}

/* Zoom Control */
.zoom-control {
    margin: 30px 0;
    padding: 20px;
    background: rgba(236, 240, 241, 0.5);
    border-radius: 12px;
}

.zoom-label {
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

#zoomSlider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #d3d3d3;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 10px 0;
}

#zoomSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

#zoomSlider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.zoom-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-top: 5px;
}

/* Input Section */
.input-section {
    display: flex;
    gap: 20px;
    margin: 30px 0;
}

.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.input-group input {
    padding: 12px 16px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: white;
}

.input-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.input-group input::placeholder {
    color: #bdc3c7;
}

/* Facts Panel */
.facts-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 16px;
    margin: 30px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.facts-panel h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.fact-text {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.95;
}

/* Footer */
.footer {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 25px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .temp-box {
        padding: 20px 30px;
        min-width: 220px;
    }

    .temp-value {
        font-size: 2.2rem;
    }

    .wheel-container {
        height: 250px;
    }

    .input-section {
        flex-direction: column;
        gap: 15px;
    }

    .zoom-control {
        padding: 15px;
    }
}

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

    .header h1 {
        font-size: 1.6rem;
    }

    .temp-box {
        padding: 15px 25px;
    }

    .temp-value {
        font-size: 1.8rem;
    }

    .wheel-container {
        height: 200px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
