:root {
    --primary: #c53030; /* Deep Red */
    --primary-light: #feb2b2;
    --secondary: #2c7a7b; /* Teal */
    --accent: #ed8936;
    --bg-color: #f7fafc;
    --text-dark: #2d3748;
    --text-light: #718096;
    --card-bg: rgba(255, 255, 255, 0.85);
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --radius: 16px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-color);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, .logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Mesh Background */
.mesh-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #f7fafc;
    background-image: 
        radial-gradient(at 0% 0%, hsla(0, 100%, 93%, 1) 0px, transparent 50%),
        radial-gradient(at 50% 0%, hsla(180, 100%, 95%, 1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, hsla(0, 100%, 93%, 1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(180, 100%, 95%, 1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(0, 100%, 93%, 1) 0px, transparent 50%);
    opacity: 0.6;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    color: var(--text-dark);
    letter-spacing: -1px;
}

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

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    box-shadow: var(--shadow);
    border-radius: 12px;
    padding: 1rem;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: block;
}

.dropdown-menu a:hover {
    background: #fff5f5;
}

/* Container & Sections */
.container {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 2rem;
    position: relative;
}

.content-section {
    display: none;
    animation: fadeIn 0.8s ease forwards;
}

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

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

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

.section-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.section-header p {
    font-size: 1.2rem;
    color: var(--text-light);
}

/* Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.card-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.importance {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.examples {
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 1rem;
}

.ex-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.label {
    font-weight: 600;
    color: var(--text-dark);
}

.text-danger {
    color: var(--primary);
    font-weight: 600;
}

/* Detail Pages Layout */
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.full-width {
    grid-column: span 2;
}

.detail-card h2 {
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-size: 1.8rem;
}

.detail-card ul {
    list-style: none;
}

.detail-card li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.detail-card li::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.solutions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.sol-item {
    background: rgba(255, 255, 255, 0.5);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .section-header h1 {
        font-size: 2.2rem;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .full-width {
        grid-column: span 1;
    }
    
    .nav-links {
        display: none; /* Simplification for brief demo, usually a hamburger menu would be here */
    }
    
    .logo {
        margin: 0 auto;
    }
}

/* --- Classifier UI --- */
.classifier-container {
    max-width: 800px;
    margin: 0 auto;
}

.gender-toggle {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.gender-toggle button {
    flex: 1;
    max-width: 150px;
    padding: 0.8rem;
    border: 1px solid rgba(0,0,0,0.1);
    background: white;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.gender-toggle button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(197, 48, 48, 0.2);
}

.classifier-form {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255,155, 0.4);
    box-shadow: var(--shadow);
    margin-bottom: 3rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.input-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.input-group input {
    padding: 0.8rem 1rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input-group input.err-field {
    border-color: #e53e3e;
}

.actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-primary, .btn-secondary {
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #a02c2c;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(0,0,0,0.1);
    color: var(--text-light);
}

.btn-secondary:hover {
    background: rgba(0,0,0,0.05);
}

/* Result Cards */
.result-card {
    padding: 2.5rem;
    border-radius: var(--radius);
    animation: fadeIn 0.6s ease forwards;
}

.result-card.success { border-left: 6px solid #48bb78; background: rgba(72, 187, 120, 0.05); }
.result-card.warning { border-left: 6px solid #ecc94b; background: rgba(236, 201, 75, 0.05); }
.result-card.alert   { border-left: 6px solid var(--primary); background: rgba(197, 48, 48, 0.05); }

.result-card h3 {
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

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

.badge {
    background: var(--primary);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.result-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.metric-item {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(0,0,0,0.05);
}

.metric-item.low  .m-value { color: #e53e3e; }
.metric-item.high .m-value { color: #d69e2e; }

.m-label { font-size: 0.8rem; color: var(--text-light); margin-bottom: 0.2rem; }
.m-value { font-weight: 700; font-size: 1.1rem; }

.diagnosis-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

.diag-sec h4 {
    margin-bottom: 0.8rem;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.diag-sec ul {
    list-style: none;
}

.diag-sec li {
    padding: 0.4rem 0;
    padding-left: 1.2rem;
    position: relative;
    font-size: 0.95rem;
}

.diag-sec li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary);
}

.divider {
    height: 1px;
    background: rgba(0,0,0,0.05);
    margin: 1.5rem 0;
}

.error-msg {
    color: #e53e3e;
    text-align: center;
    margin-top: 1rem;
    font-weight: 500;
    display: none;
}

@media (max-width: 600px) {
    .diagnosis-info {
        grid-template-columns: 1fr;
    }
}

/* --- Smart Tools UI --- */
.smart-tools {
    margin-top: 2.5rem;
    padding-top: 2rem;
}

.tool-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
}

.tool-divider::before, .tool-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.tool-divider span {
    padding: 0 1rem;
}

.tool-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.tool-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1rem;
    background: white;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}

.tool-btn:hover {
    background: #fdfdfd;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.tool-btn svg {
    color: var(--primary);
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 2rem;
    background: rgba(255,255,255,0.5);
    border-radius: var(--radius);
    backdrop-filter: blur(4px);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--primary-light);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Batch Grid */
.batch-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.batch-grid .result-card {
    padding: 1.5rem;
}

.batch-grid .result-card h3 {
    font-size: 1.3rem;
}

.batch-grid .diagnosis-info {
    grid-template-columns: 1fr;
    gap: 1rem;
}
