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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #e0f2fe;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.app-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.12);
    padding: 20px;
    width: 100%;
    max-width: 800px;
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #3b82f6;
}

h1 {
    font-size: 26px;
    color: #1e40af;
    font-weight: 700;
    letter-spacing: 0.5px;
}

nav.main-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    background: #dbeafe;
    padding: 12px;
    border-radius: 10px;
}

nav button {
    background: #1e40af;
    color: #fff;
    border: none;
    padding: 10px 20px;
    margin: 4px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

nav button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

nav button.active {
    background: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

main.content {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    min-height: 350px;
    border: 1px solid #e0e7ff;
}

.tool-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tool-section.active {
    display: block;
}

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

.tool-section h2 {
    color: #1e40af;
    font-size: 20px;
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 2px solid #bfdbfe;
}

.calc-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.input-group label {
    font-size: 14px;
    color: #1e40af;
    font-weight: 600;
}

.input-group input,
.input-group select {
    padding: 11px 12px;
    border: 2px solid #bfdbfe;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: all 0.2s ease;
    color: #1e3a8a;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.btn-group button,
section button {
    flex: 1;
    min-width: 100px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-group button:first-child,
section button.calculate-btn {
    background: #3b82f6;
    color: white;
}

.btn-group button:first-child:hover,
section button.calculate-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.35);
}

.btn-group button:last-child,
section button.clear-btn {
    background: #e0e7ff;
    color: #1e40af;
}

.btn-group button:last-child:hover,
section button.clear-btn:hover {
    background: #c7d2fe;
}

.result {
    margin-top: 15px;
    padding: 12px;
    background: #eff6ff;
    border-radius: 6px;
    font-size: 14px;
    min-height: 50px;
    border-left: 4px solid #3b82f6;
}

.result strong {
    color: #1e40af;
}

.result .unit {
    color: #3b82f6;
    font-weight: 400;
}

.hf-bar-container {
     margin-top: 14px;
     padding: 10px 0;
 }

 .hf-bar-track {
     width: 100%;
     height: 28px;
     border-radius: 14px;
     background: linear-gradient(to right, #3b82f6 0%, #3b82f6 33%, #fbbf24 33%, #fbbf24 66%, #ef4444 66%, #ef4444 100%);
     background-size: 200% 100%;
     position: relative;
     overflow: hidden;
     border: 1px solid #cbd5e1;
 }

 .hf-bar-fill {
     height: 100%;
     border-radius: 14px;
     width: 0%;
     transition: width 0.6s ease, background 0.6s ease;
     position: relative;
 }

 .hf-bar-fill.cool {
     background: #3b82f6 !important;
     box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
 }

 .hf-bar-fill.warm {
     background: #fbbf24 !important;
     box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
 }

 .hf-bar-fill.hot {
     background: #ef4444 !important;
     box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
 }

 .hf-bar-labels {
     display: flex;
     justify-content: space-between;
     font-size: 12px;
     color: #64748b;
     margin-top: 6px;
 }

 .hf-zone-badge {
     display: inline-block;
     padding: 4px 14px;
     border-radius: 20px;
     font-size: 13px;
     font-weight: 700;
     margin-top: 8px;
     text-transform: uppercase;
     letter-spacing: 0.5px;
 }

 .hf-zone-badge.cool { background: #dbeafe; color: #1e40af; }
 .hf-zone-badge.warm { background: #fef3c7; color: #92400e; }
 .hf-zone-badge.hot  { background: #fee2e2; color: #991b1b; }

 footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    color: #1e40af;
    font-size: 13px;
    font-weight: 500;
}

@media (max-width: 600px) {
    .app-container {
        padding: 12px;
    }

    h1 {
        font-size: 22px;
    }

    nav.main-nav {
        flex-direction: column;
    }

    nav.main-nav button {
        width: 100%;
        margin: 3px 0;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group button {
        width: 100%;
    }
}