/*
 * assets/css/style.css
 * Heart Disease Prediction and Health Guidance System
 * Custom styles — clean medical aesthetic with deep navy + crimson accent
 */

/* ═══════════════════════════════════════════ CSS CUSTOM PROPERTIES (Tokens) ══ */
:root {
    /* Brand palette */
    --hg-navy:        #0d1b2a;
    --hg-navy-mid:    #1b2e45;
    --hg-navy-light:  #243b55;
    --hg-crimson:     #c0392b;
    --hg-crimson-hover: #a93226;
    --hg-rose:        #e74c3c;
    --hg-gold:        #f39c12;
    --hg-teal:        #1abc9c;
    --hg-sky:         #2980b9;

    /* Neutrals */
    --hg-white:       #ffffff;
    --hg-off-white:   #f8f9fc;
    --hg-muted:       #6c757d;
    --hg-border:      #e2e8f0;
    --hg-surface:     #ffffff;

    /* Typography */
    --font-heading:   'Sora', sans-serif;
    --font-body:      'DM Sans', sans-serif;

    /* Spacing & radius */
    --hg-radius:      12px;
    --hg-radius-sm:   8px;
    --hg-shadow:      0 4px 24px rgba(13, 27, 42, 0.10);
    --hg-shadow-lg:   0 8px 40px rgba(13, 27, 42, 0.15);
}

/* ════════════════════════════════════════════════════════════ BASE RESET ══ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    color: #2d3748;
    background-color: var(--hg-off-white);
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--hg-navy);
    line-height: 1.3;
}

a { color: var(--hg-sky); text-decoration: none; }
a:hover { color: var(--hg-crimson); text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════ NAVBAR ══ */
.hg-navbar {
    background-color: var(--hg-navy);
    border-bottom: 3px solid var(--hg-crimson);
    padding: 0.6rem 0;
    box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}

.hg-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--hg-white) !important;
    text-decoration: none;
}

.hg-brand-icon {
    background: var(--hg-crimson);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    animation: pulse-icon 2.4s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.5); }
    50%       { box-shadow: 0 0 0 8px rgba(192, 57, 43, 0); }
}

.hg-navbar .nav-link {
    color: rgba(255,255,255,0.80) !important;
    font-size: 0.92rem;
    font-weight: 500;
    padding: 0.45rem 0.8rem;
    border-radius: var(--hg-radius-sm);
    transition: background 0.2s, color 0.2s;
}

.hg-navbar .nav-link:hover,
.hg-navbar .nav-link.active {
    color: var(--hg-white) !important;
    background: rgba(255,255,255,0.10);
}

.hg-btn-primary {
    background: var(--hg-crimson);
    color: #fff !important;
    border: none;
    border-radius: var(--hg-radius-sm);
    padding: 0.42rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-heading);
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.hg-btn-primary:hover {
    background: var(--hg-crimson-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(192,57,43,0.35);
    text-decoration: none;
}

.hg-user-btn {
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--hg-radius-sm);
}

.hg-dropdown {
    border: none;
    border-radius: var(--hg-radius);
    box-shadow: var(--hg-shadow-lg);
    padding: 0.5rem;
}

.hg-dropdown .dropdown-item {
    border-radius: var(--hg-radius-sm);
    font-size: 0.9rem;
    padding: 0.45rem 1rem;
    transition: background 0.15s;
}

/* ══════════════════════════════════════════════════════════════ MAIN WRAP ══ */
.hg-main {
    flex: 1;
    padding-bottom: 2rem;
}

/* ══════════════════════════════════════════════════════════════════ HERO ══ */
.hg-hero {
    background: linear-gradient(135deg, var(--hg-navy) 0%, var(--hg-navy-light) 60%, #1a3a5c 100%);
    color: var(--hg-white);
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hg-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hg-hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    color: var(--hg-white);
    line-height: 1.15;
    margin-bottom: 1.2rem;
}

.hg-hero-title span {
    color: var(--hg-rose);
}

.hg-hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.78);
    max-width: 540px;
    margin-bottom: 2rem;
}

.hg-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.20);
    color: var(--hg-white);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.35rem 0.9rem;
    border-radius: 100px;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(6px);
}

.hg-hero-btn {
    background: var(--hg-crimson);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    padding: 0.75rem 2rem;
    border-radius: var(--hg-radius);
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.hg-hero-btn:hover {
    background: var(--hg-crimson-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(192,57,43,0.40);
    text-decoration: none;
}

.hg-hero-btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.40);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    padding: 0.72rem 1.8rem;
    border-radius: var(--hg-radius);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: border-color 0.2s, background 0.2s;
}

.hg-hero-btn-outline:hover {
    border-color: #fff;
    background: rgba(255,255,255,0.10);
    color: #fff;
    text-decoration: none;
}

/* Heartbeat SVG graphic in hero */
.hg-hero-graphic {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 260px;
}

.hg-ecg-box {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(8px);
    text-align: center;
    position: relative;
}

.hg-big-heart {
    font-size: 5rem;
    color: var(--hg-rose);
    animation: heartbeat 1.2s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1);   }
    14%       { transform: scale(1.13); }
    28%       { transform: scale(1);   }
    42%       { transform: scale(1.08); }
    56%       { transform: scale(1);   }
}

.hg-ecg-label {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 1rem;
}

/* ════════════════════════════════════════════════════════════ STAT STRIP ══ */
.hg-stats-strip {
    background: var(--hg-white);
    border-bottom: 1px solid var(--hg-border);
    padding: 1.5rem 0;
}

.hg-stat-item {
    text-align: center;
    padding: 0.5rem 1rem;
}

.hg-stat-number {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--hg-crimson);
    line-height: 1;
}

.hg-stat-label {
    font-size: 0.82rem;
    color: var(--hg-muted);
    margin-top: 0.2rem;
}

/* ═══════════════════════════════════════════════════════════ CARDS / UI ══ */
.hg-card {
    background: var(--hg-surface);
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    box-shadow: var(--hg-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.hg-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--hg-shadow-lg);
}

.hg-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.hg-icon-red   { background: rgba(192,57,43,0.12);  color: var(--hg-crimson); }
.hg-icon-teal  { background: rgba(26,188,156,0.12); color: var(--hg-teal); }
.hg-icon-gold  { background: rgba(243,156,18,0.12); color: var(--hg-gold); }
.hg-icon-blue  { background: rgba(41,128,185,0.12); color: var(--hg-sky); }

/* Section headings */
.hg-section-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--hg-navy);
    margin-bottom: 0.5rem;
}

.hg-section-subtitle {
    color: var(--hg-muted);
    font-size: 1rem;
    margin-bottom: 2.5rem;
}

/* ═══════════════════════════════════════════════════════════════ FOOTER ══ */
.hg-footer {
    background: var(--hg-navy);
    color: rgba(255,255,255,0.75);
    margin-top: auto;
}

.hg-footer-brand {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--hg-white);
}

.hg-footer-brand i { color: var(--hg-crimson); }

.hg-footer-tagline {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.6;
}

.hg-footer-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--hg-white);
    margin-bottom: 1rem;
}

.hg-footer-links { margin: 0; padding: 0; }
.hg-footer-links li { margin-bottom: 0.5rem; }
.hg-footer-links a {
    color: rgba(255,255,255,0.60);
    font-size: 0.9rem;
    transition: color 0.2s;
    text-decoration: none;
}
.hg-footer-links a:hover { color: var(--hg-white); }

.hg-footer-disclaimer {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-left: 3px solid var(--hg-gold);
    border-radius: var(--hg-radius-sm);
    padding: 0.8rem 1rem;
    line-height: 1.5;
}

.hg-footer-divider {
    border-color: rgba(255,255,255,0.10);
    margin: 0;
}

.hg-footer-copy {
    color: rgba(255,255,255,0.40);
    font-size: 0.82rem;
}

/* ══════════════════════════════════════════════ ALERT / FLASH MESSAGES ══ */
.alert { border-radius: var(--hg-radius); border: none; font-size: 0.93rem; }
.alert-success { background: #d1f5e8; color: #1a5e3f; }
.alert-danger  { background: #fde8e8; color: #7b1c1c; }
.alert-warning { background: #fef3cd; color: #856404; }
.alert-info    { background: #dbeafe; color: #1e40af; }

/* ═════════════════════════════════════════════════════════ FORM STYLES ══ */
.hg-form-card {
    background: var(--hg-white);
    border-radius: var(--hg-radius);
    box-shadow: var(--hg-shadow);
    padding: 2.5rem;
}

.form-control, .form-select {
    border-radius: var(--hg-radius-sm);
    border: 1.5px solid var(--hg-border);
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 0.55rem 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--hg-sky);
    box-shadow: 0 0 0 3px rgba(41,128,185,0.15);
    outline: none;
}

.form-label {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--hg-navy);
    margin-bottom: 0.35rem;
}

.btn-hg-submit {
    background: var(--hg-crimson);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 600;
    border: none;
    border-radius: var(--hg-radius-sm);
    padding: 0.65rem 2rem;
    font-size: 1rem;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    width: 100%;
}

.btn-hg-submit:hover {
    background: var(--hg-crimson-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(192,57,43,0.30);
}

/* ════════════════════════════════════════════════════════ PAGE HEADERS ══ */
.hg-page-header {
    background: linear-gradient(135deg, var(--hg-navy) 0%, var(--hg-navy-light) 100%);
    color: var(--hg-white);
    padding: 2.5rem 0 2rem;
    margin-bottom: 2.5rem;
}

.hg-page-header h1 {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--hg-white);
    margin: 0;
}

.hg-page-header p {
    color: rgba(255,255,255,0.70);
    margin: 0.35rem 0 0;
    font-size: 0.97rem;
}

.hg-page-header .breadcrumb-item,
.hg-page-header .breadcrumb-item a { color: rgba(255,255,255,0.60); font-size: 0.85rem; }
.hg-page-header .breadcrumb-item.active { color: rgba(255,255,255,0.90); }
.hg-page-header .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,0.30); }

/* ═══════════════════════════════════════════════════════ RISK BADGES ══ */
.badge-low      { background: #d1fae5; color: #065f46; font-size: 0.88rem; padding: 0.4em 0.9em; border-radius: 100px; }
.badge-moderate { background: #fef3cd; color: #856404; font-size: 0.88rem; padding: 0.4em 0.9em; border-radius: 100px; }
.badge-high     { background: #fde8e8; color: #7b1c1c; font-size: 0.88rem; padding: 0.4em 0.9em; border-radius: 100px; }

/* ═══════════════════════════════════════════════════════════ UTILITIES ══ */
.text-crimson { color: var(--hg-crimson) !important; }
.text-navy    { color: var(--hg-navy) !important; }
.bg-navy      { background-color: var(--hg-navy) !important; }
.fw-heading   { font-family: var(--font-heading); }

/* Animated underline for section titles */
.hg-underline {
    display: inline-block;
    position: relative;
}
.hg-underline::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 48px;
    height: 4px;
    background: var(--hg-crimson);
    border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════ RESPONSIVE ══ */
@media (max-width: 767.98px) {
    .hg-hero { padding: 3.5rem 0 3rem; }
    .hg-form-card { padding: 1.5rem; }
    .hg-page-header { padding: 1.8rem 0 1.5rem; }
    .hg-page-header h1 { font-size: 1.5rem; }
}
