/* --- CSS Variables & Theme --- */
:root {
    /* Warm/Light colors palette */
    --primary: #f26b5b; /* Warm coral */
    --primary-hover: #e05a4a;
    --secondary: #fce7d2; /* Soft warm background */
    --accent: #ffb067; /* Warm orange */
    
    --text-main: #3d3b3c;
    --text-muted: #6b6766;
    --text-light: #ffffff;
    
    --bg-main: #fffdfb;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-input: #ffffff;
    
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px rgba(242, 107, 91, 0.1);
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --border-radius: 16px;
    --font-family: 'Outfit', sans-serif;
}

/* --- Resets & Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--primary);
}

/* Typography */
h1, h2, h3 {
    line-height: 1.2;
    font-weight: 700;
}

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.highlight {
    color: var(--primary);
}

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

/* --- Layout & Container --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-narrow {
    max-width: 800px;
}

/* --- Header / Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 253, 251, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    color: var(--primary);
}

nav a {
    margin-left: 2rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
}

nav a:hover {
    color: var(--primary);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    padding: 8rem 0 4rem 0;
    background: radial-gradient(circle at top right, var(--secondary), transparent 60%);
    display: flex;
    align-items: center;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 450px;
    grid-template-areas:
        "title calc"
        "desc calc";
    align-items: center;
    gap: 1rem 4rem;
}

.hero-title {
    grid-area: title;
    align-self: end;
}
.hero-description {
    grid-area: desc;
    align-self: start;
}

.badge {
    display: inline-block;
    background: rgba(242, 107, 91, 0.1);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-title h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.hero-description p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.feature-list {
    list-style: none;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-weight: 500;
    color: var(--text-main);
}

.feature-list i {
    color: var(--primary);
    font-size: 1.25rem;
}

/* --- Glass Calculator Card --- */
.hero-calculator {
    grid-area: calc;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
}

.glass-card h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: center;
}

/* --- Forms --- */
form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

/* Radio buttons for Gender */
.radio-group {
    display: flex;
    gap: 1rem;
}

.radio-label {
    flex: 1;
    cursor: pointer;
}

.radio-label input {
    display: none;
}

.radio-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 2px solid #e1dfdf;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
    color: var(--text-muted);
    background: var(--bg-input);
}

.radio-label input:checked + .radio-box {
    border-color: var(--primary);
    background: rgba(242, 107, 91, 0.05);
    color: var(--primary);
}

/* Number Inputs */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

input[type="number"] {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1dfdf;
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-input);
    transition: var(--transition);
    color: var(--text-main);
    outline: none;
    font-weight: 500;
}

input[type="number"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(242, 107, 91, 0.15);
}

input[type="number"]::placeholder {
    color: #b0adaa;
}

.unit {
    position: absolute;
    right: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--bg-input);
    padding-left: 0.5rem;
}

/* Button */
.btn-primary {
    background: var(--primary);
    color: var(--text-light);
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    box-shadow: 0 4px 15px rgba(242, 107, 91, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(242, 107, 91, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Result Display */
.result-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 12px;
    background: rgba(242, 107, 91, 0.05);
    border: 1px dashed var(--primary);
    text-align: center;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.result-container.hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    visibility: hidden;
    height: 0;
    padding: 0;
    margin: 0;
    border: none;
}

.result-label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.result-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
    line-height: 1;
}

.result-unit {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
}

.interpretation {
    margin-top: 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem;
    border-radius: 6px;
    background: rgba(255,255,255,0.8);
}

.interp-normal { color: #2e7d32; }
.interp-mild { color: #f57f17; }
.interp-severe { color: #d32f2f; }

/* --- FAQ Section --- */
.faq-section {
    padding: 5rem 0;
    background-color: var(--bg-main);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.accordion {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.accordion-item {
    border: 1px solid #e1dfdf;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
    transition: var(--transition);
}

.accordion-item:hover {
    border-color: var(--accent);
}

.accordion-header {
    width: 100%;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
}

.accordion-header i {
    color: var(--primary);
    transition: transform 0.3s ease;
}

.accordion-item.active .accordion-header i {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
    padding: 0 1.5rem;
    background: #faf9f8;
}

.accordion-item.active .accordion-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
    max-height: 500px; /* arbitrary max height for transition */
}

.accordion-item h3 {
    margin: 0;
    padding: 0;
    font-weight: normal;
}

/* --- Related Topics Section --- */
.topics-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.topic-card {
    text-align: center;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(33.333% - 1.34rem);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(242, 107, 91, 0.15);
}

.topic-card .icon-wrapper {
    background: rgba(242, 107, 91, 0.1);
    color: var(--primary);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.topic-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.topic-card h3 a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.3s ease;
}

.topic-card h3 a:hover {
    color: var(--primary);
}

.topic-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* --- Footer --- */
footer {
    background: #2b292a;
    color: #ffffff;
    padding: 3rem 0;
    text-align: center;
}

.footer-content p {
    color: #b0adaa;
    font-size: 0.9rem;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "calc"
            "desc";
        padding-top: 4rem;
        gap: 2.5rem;
    }
    .topics-grid {
        gap: 1.5rem;
    }
    .topic-card {
        width: calc(50% - 0.75rem);
    }
    .hero-title, .hero-description {
        text-align: center;
    }
    .feature-list {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1.5rem;
    }
    .hero-calculator {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }
    .hero-title h1 {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    .topics-grid {
        flex-direction: column;
    }
    .topic-card {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .hero-title h1 {
        font-size: 2.2rem;
    }
    .glass-card {
        padding: 1.5rem;
    }
    .form-row {
        flex-direction: column;
    }
    .navbar nav {
        display: none; /* simple hidden nav for extreme mobile, or replace with hamburger */
    }
}
