/* Custom Fonts & Roots */
:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --accent: #06b6d4;

    /* Category Colors */
    --underweight: #38bdf8;
    --normal: #4ade80;
    --overweight: #facc15;
    --obese: #f87171;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 1rem;
}

/* Base Styles */
.back-home-link {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
    z-index: 10;
}

.back-home-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Ambient Background Blobs */
.blob-bg {
    position: absolute;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.5;
    animation: float 10s ease-in-out infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--primary), transparent 70%);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent), transparent 70%);
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 50%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.4), transparent 70%);
    animation-delay: -2s;
}

@keyframes float {
    0% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(20px) scale(1.05);
    }
}

/* App Container Glassmorphism */
.app-container {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    margin-top: 3rem;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 2rem;
}

.app-header .logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 16px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    color: white;
    margin-bottom: 1rem;
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
}

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

.highlight {
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* Panels */
.calculator-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: all 0.4s ease;
}

.result-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    animation: slideUp 0.5s ease;
}

.hidden {
    display: none !important;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Inputs Groups */
.input-group {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.label-row label {
    font-weight: 500;
    color: var(--text-secondary);
}

.value-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.value-display small {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Gender Buttons */
.gender-selector {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
}

.gender-btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.gender-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.gender-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

/* Custom Slider */
.custom-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    transition: background 0.3s;
}

.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    border: 4px solid var(--primary);
    transition: transform 0.1s;
}

.custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* Buttons */
.primary-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.4);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(139, 92, 246, 0.5);
}

.secondary-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

/* Gauge UI */
.gauge-container {
    width: 200px;
    height: 120px;
    position: relative;
    margin: 0 auto;
}

.gauge-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.gauge-bg {
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
    stroke-linecap: round;
}

.gauge-fill {
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out, stroke 0.5s ease;
}

.bmi-score {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.category {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.5s ease;
}

.ideal-weight {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem 2rem;
    border-radius: 16px;
    width: 100%;
}

.ideal-weight p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.ideal-weight h3 {
    font-size: 1.5rem;
    color: var(--accent);
}

/* Footer SEO text */
.seo-footer {
    margin-top: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.seo-footer p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
}