/* ===== RESET & BASE ===== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

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

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #1a1a2e 50%, #16213e 100%);
    color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(2px 2px at 40% 70%, rgba(255, 255, 255, 0.05), transparent),
        radial-gradient(2px 2px at 60% 20%, rgba(255, 255, 255, 0.08), transparent),
        radial-gradient(2px 2px at 80% 50%, rgba(255, 255, 255, 0.06), transparent),
        radial-gradient(2px 2px at 10% 80%, rgba(255, 255, 255, 0.07), transparent),
        radial-gradient(2px 2px at 90% 10%, rgba(255, 255, 255, 0.04), transparent);
    pointer-events: none;
    z-index: 0;
}

/* ===== CONTAINER ===== */
.container {
    text-align: center;
    position: relative;
    z-index: 1;
}

h1 {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== THERMOMETER DISPLAY ===== */
.thermometer-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px 40px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.thermometer-body {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Graduation scale on the left */
.scale {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 340px;
    margin-right: 8px;
    padding: 10px 0;
}

.scale-mark {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72em;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    position: relative;
}

.scale-mark.major {
    font-size: 0.85em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.scale-mark span {
    min-width: 32px;
    text-align: right;
}

.scale-mark::after {
    content: '';
    width: 8px;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.scale-mark.major::after {
    width: 14px;
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
}

/* Glass tube */
.tube {
    position: relative;
    width: 36px;
    height: 340px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px 18px 0 0;
    overflow: hidden;
}

/* Glass shine effect */
.tube::before {
    content: '';
    position: absolute;
    top: 0;
    left: 4px;
    width: 8px;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.02));
    border-radius: 10px;
    z-index: 2;
}

/* Mercury fill */
.mercury {
    position: absolute;
    bottom: 0;
    left: 3px;
    right: 3px;
    height: 60%;
    border-radius: 14px 14px 0 0;
    background: linear-gradient(180deg, #f44336, #ff6f61);
    transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.8s ease;
    box-shadow: 0 0 20px rgba(244, 67, 54, 0.4);
}

/* Mercury glow pulse */
.mercury::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    filter: blur(3px);
}

/* Bulb at bottom */
.bulb {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f44336, #d32f2f);
    border: 2px solid rgba(255, 255, 255, 0.15);
    margin-top: -4px;
    position: relative;
    box-shadow: 0 0 30px rgba(244, 67, 54, 0.5),
        inset 0 -4px 10px rgba(0, 0, 0, 0.2);
    transition: background 0.8s ease, box-shadow 0.8s ease;
}

/* Bulb shine */
.bulb::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 10px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    filter: blur(2px);
}

/* ===== DIGITAL READOUT ===== */
.digital-readout {
    margin-top: 24px;
    font-size: 3.2em;
    font-weight: 700;
    letter-spacing: 2px;
    transition: color 0.5s ease;
}

.digital-readout .unit {
    font-size: 0.5em;
    font-weight: 300;
    opacity: 0.7;
    margin-left: 4px;
}

/* Temperature state colors */
.temp-freezing .mercury {
    background: linear-gradient(180deg, #29b6f6, #0288d1) !important;
    box-shadow: 0 0 20px rgba(41, 182, 246, 0.4) !important;
}

.temp-freezing .bulb {
    background: linear-gradient(135deg, #29b6f6, #0277bd) !important;
    box-shadow: 0 0 30px rgba(41, 182, 246, 0.5), inset 0 -4px 10px rgba(0, 0, 0, 0.2) !important;
}

.temp-freezing .digital-readout {
    color: #29b6f6;
}

.temp-cold .mercury {
    background: linear-gradient(180deg, #4dd0e1, #00acc1) !important;
    box-shadow: 0 0 20px rgba(77, 208, 225, 0.4) !important;
}

.temp-cold .bulb {
    background: linear-gradient(135deg, #4dd0e1, #0097a7) !important;
    box-shadow: 0 0 30px rgba(77, 208, 225, 0.5), inset 0 -4px 10px rgba(0, 0, 0, 0.2) !important;
}

.temp-cold .digital-readout {
    color: #4dd0e1;
}

.temp-cool .mercury {
    background: linear-gradient(180deg, #66bb6a, #43a047) !important;
    box-shadow: 0 0 20px rgba(102, 187, 106, 0.4) !important;
}

.temp-cool .bulb {
    background: linear-gradient(135deg, #66bb6a, #388e3c) !important;
    box-shadow: 0 0 30px rgba(102, 187, 106, 0.5), inset 0 -4px 10px rgba(0, 0, 0, 0.2) !important;
}

.temp-cool .digital-readout {
    color: #66bb6a;
}

.temp-warm .mercury {
    background: linear-gradient(180deg, #ffa726, #f57c00) !important;
    box-shadow: 0 0 20px rgba(255, 167, 38, 0.4) !important;
}

.temp-warm .bulb {
    background: linear-gradient(135deg, #ffa726, #ef6c00) !important;
    box-shadow: 0 0 30px rgba(255, 167, 38, 0.5), inset 0 -4px 10px rgba(0, 0, 0, 0.2) !important;
}

.temp-warm .digital-readout {
    color: #ffa726;
}

.temp-hot .mercury {
    background: linear-gradient(180deg, #ef5350, #c62828) !important;
    box-shadow: 0 0 20px rgba(239, 83, 80, 0.5) !important;
}

.temp-hot .bulb {
    background: linear-gradient(135deg, #ef5350, #b71c1c) !important;
    box-shadow: 0 0 30px rgba(239, 83, 80, 0.6), inset 0 -4px 10px rgba(0, 0, 0, 0.2) !important;
}

.temp-hot .digital-readout {
    color: #ef5350;
}

/* ===== CONTROL PAGE ===== */
.control-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px 36px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 340px;
    max-width: 90vw;
}

.current-temp-display {
    font-size: 4em;
    font-weight: 700;
    margin: 20px 0;
    transition: color 0.4s ease;
}

.current-temp-display .unit {
    font-size: 0.4em;
    font-weight: 300;
    opacity: 0.6;
}

/* Slider */
.slider-container {
    margin: 30px 0;
    padding: 0 10px;
}

.slider-container label {
    display: block;
    font-size: 0.85em;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #29b6f6, #66bb6a, #ffa726, #ef5350);
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(255, 255, 255, 0.1);
    cursor: grab;
    transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    cursor: grab;
    border: none;
}

/* Preset buttons */
.presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 24px;
}

.preset-btn {
    padding: 14px 0;
    font-family: 'Outfit', sans-serif;
    font-size: 1em;
    font-weight: 600;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    color: #fff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    letter-spacing: 1px;
}

.preset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.preset-btn:active {
    transform: scale(0.96);
}

.preset-btn.freezing {
    background: linear-gradient(135deg, #29b6f6, #0277bd);
}

.preset-btn.zero {
    background: linear-gradient(135deg, #4dd0e1, #00838f);
}

.preset-btn.mild {
    background: linear-gradient(135deg, #66bb6a, #2e7d32);
}

.preset-btn.warm {
    background: linear-gradient(135deg, #ffa726, #e65100);
}

.preset-btn.hot {
    background: linear-gradient(135deg, #ef5350, #b71c1c);
}

/* Status indicator */
.status {
    margin-top: 20px;
    font-size: 0.75em;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 1px;
}

.status .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4caf50;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}