/* =============================================
   DESIGN TOKENS — identical to style.css
   ============================================= */
:root {
    --green-900: #1b4332;
    --green-800: #2d6a4f;
    --green-700: #40916c;
    --green-600: #52b788;
    --green-500: #74c69d;
    --green-400: #95d5b2;
    --green-300: #b7e4c7;
    --green-200: #d8f3dc;
    --green-100: #f0fdf4;

    --gray-900: #1a202c;
    --gray-700: #4a5568;
    --gray-500: #a0aec0;
    --gray-200: #edf2f7;
    --gray-100: #f7fafc;
    --gray-50:  #fcfdfd;

    --font-sans:    'Plus Jakarta Sans', sans-serif;
    --font-serif:   'Source Sans 3', serif;
    --font-display: 'Poppins', sans-serif;

    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-y: scroll; scrollbar-gutter: stable; }

body {
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    background-color: var(--gray-50);
    color: var(--gray-700);
    line-height: 1.5;
}

/* =============================================
   HEADER — identical to style.css / indexAfter
   ============================================= */
header {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #e9efec;
    z-index: 1000;
    padding: 0.5rem 0;
    box-shadow: none;
}

.container-H {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 56px;
    position: relative;
}

/* =============================================
   LOGO
   ============================================= */
.logo {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.logo img {
    height: 32px;
    width: 32px;
    border-radius: 50%;
}
.logo span {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--green-900);
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}
.logo a span:has(img) {
    display: flex;
    align-items: center;
    font-size: 0;
}

/* =============================================
   NAV PILL — identical to style.css
   ============================================= */
nav {
    display: flex;
    gap: 0.2rem;
    align-items: center;
    padding: 0.26rem;
    border-radius: 999px;
    background: #f4f6f5;
    border: 1px solid #edf1ef;
    position: static;
    right: auto;
}
nav a {
    font-weight: 600;
    color: #2f3e36;
    text-decoration: none;
    font-size: 0.88rem;
    position: relative;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    transition: color .2s ease, background-color .2s ease;
    width: max-content;
    display: inline-block;
}
nav a:hover { color: var(--green-900); background: #e9f2ed; }
nav a::after {
    content: '';
    position: absolute;
    left: 50%; bottom: 0.25rem;
    width: 6px; height: 2px;
    background: #5a9a78;
    border-radius: 2px;
    transform: translateX(-50%) scaleX(0);
    transition: transform .24s ease;
}
nav a:hover::after,
nav a.active::after { transform: translateX(-50%) scaleX(1); }
nav a.active { background: #dfeee5; color: var(--green-900); }

/* =============================================
   DROPDOWN
   ============================================= */
.dropdown { position: relative; display: inline-flex; align-items: center; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.62rem);
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    box-shadow: 0 12px 24px rgba(19,50,36,.12);
    border-radius: 0.8rem;
    min-width: 190px;
    z-index: 1001;
    padding: 0.45rem 0;
    border: 1px solid #e8efea;
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color .2s ease;
    background: none;
    width: 100%;
}
.dropdown-menu a:hover { background-color: #edf4ef; color: var(--green-900); }
.dropdown-menu a::after { display: none !important; }
.dropdown-menu a i { margin-right: 0.75rem; font-size: 1rem; width: 20px; text-align: center; }
#scanPlant i.fa-chevron-down { margin-left: 0.3rem; font-size: 0.8rem; transition: transform .2s ease; }
.dropdown:hover #scanPlant i.fa-chevron-down { transform: rotate(180deg); }

/* =============================================
   USER / PROFILE ICON
   ============================================= */
.user-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--green-800);
    box-shadow: 0 4px 12px rgba(45,106,79,.25);
    cursor: pointer;
    flex-shrink: 0;
}
.user-icon a.profile {
    color: var(--green-200);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%; height: 100%;
    border-radius: 50%;
    text-decoration: none;
}
.user-icon a.profile::after { display: none !important; }

/* =============================================
   PROFILE SUB-MENU
   ============================================= */
.sub-menu-wrap {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 1.5rem;
    width: min(92vw, 300px);
    max-height: 0;
    overflow: hidden;
    transition: max-height .45s ease;
    z-index: 1002;
    filter: none;
}
.sub-menu-wrap.open-menu { max-height: 420px; }
.sub-menu {
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 1.1rem;
    box-shadow: 0 20px 44px rgba(17,66,23,.14);
    padding: 1.25rem;
    margin: 0.5rem 0;
}
.user-info { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 0.8rem; }
.user-info img {
    width: 46px; height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--green-600), var(--green-900));
    padding: 2px;
    object-fit: cover;
}
.user-info h2 {
    font-family: var(--font-display);
    font-size: 1rem; font-weight: 700;
    color: var(--green-900); margin: 0;
}
.sub-menu hr { border: none; border-top: 1px solid var(--gray-200); margin: 0.75rem 0; }
.sub-menu-link { display: flex; flex-direction: column; gap: 0.1rem; }
.sub-menu-link a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: var(--gray-700);
    font-size: 0.88rem; font-weight: 600;
    padding: 0.6rem 0.75rem;
    border-radius: 0.65rem;
    transition: background .2s ease, color .2s ease;
    justify-content: space-between;
    background: none; width: 100%;
}
.sub-menu-link a:hover { background-color: #edf4ef; color: var(--green-900); transform: none; }
.sub-menu-link a::after { display: none !important; }
.sub-menu-link a i.same {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 8px;
    background: linear-gradient(135deg, var(--green-600), var(--green-900));
    color: var(--green-100); font-size: 0.85rem; flex-shrink: 0; margin-right: 0;
    transition: none;
}
.sub-menu-link a:hover i.same { transform: none; }
.sub-menu-link a span {
    margin-left: auto; font-size: 1rem;
    color: var(--gray-500); font-weight: 400;
    visibility: visible; transition: none;
}
.sub-menu-link a:hover span { transform: none; color: var(--gray-500); }
.sub-menu-link-inner { display: flex; align-items: center; gap: 0.7rem; }

/* =============================================
   UPLOAD MODAL
   ============================================= */
.modal {
    display: none; position: fixed;
    z-index: 1010; left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,.6);
    justify-content: center; align-items: center;
}
.modal-content {
    background: white; padding: 2rem;
    border-radius: 1rem; text-align: center;
    width: 90%; max-width: 500px;
    box-shadow: var(--shadow-lg); position: relative;
}
.modal-content h2 {
    font-family: var(--font-serif);
    font-size: 1.75rem; color: var(--gray-900); margin-bottom: 1.5rem;
}
.close {
    position: absolute; top: 1rem; right: 1rem;
    font-size: 1.5rem; cursor: pointer;
    color: var(--gray-500); transition: color .2s ease;
    /* override old fixed positioning */
}
.close:hover { color: var(--gray-900); }
#drop-area {
    border: 2px dashed var(--green-400);
    border-radius: 0.75rem; padding: 3rem 2rem;
    text-align: center; background-color: var(--green-100);
    transition: all .2s ease; font-family: var(--font-sans);
    color: var(--green-800); font-size: 1.05rem; font-weight: 600;
    position: relative;
}
#drop-area:hover { background-color: var(--green-200); border-color: var(--green-600); }
#drop-area.dragover { background-color: var(--green-300); border-color: var(--green-700); }
#drop-area p { margin: 0.5rem 0; }
#fileInput { margin-top: 1rem; }

/* =============================================
   PAGE WRAPPER
   ============================================= */
.page-wrapper {
    padding-top: 72px;
    min-height: calc(100vh - 72px);
    background-color: var(--gray-50);
}

/* =============================================
   WHY CHOOSE — feature strip
   ============================================= */
.why-section {
    background: linear-gradient(180deg, #f8fcfa 0%, #ffffff 100%);
    padding: 4.5rem 1.5rem 3.5rem;
}
.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.section-header h1 {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.5vw, 2.6rem);
    font-weight: 700;
    color: var(--green-900);
    margin: 0;
    letter-spacing: -0.02em;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}
.feature-card {
    background-color: #ffffff;
    padding: 2.2rem;
    border-radius: 1.1rem;
    border: 1px solid var(--gray-200);
    text-align: left;
    transition: all .3s ease;
    box-shadow: var(--shadow-sm);
}
.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--green-300);
}
.feature-card .icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--green-200);
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
    color: var(--green-700);
}
.feature-card h2 {
    font-family: var(--font-display);
    font-size: 1.2rem; font-weight: 700;
    color: var(--gray-900); margin: 0 0 0.6rem;
}
.feature-card p {
    font-size: 0.95rem; line-height: 1.65;
    color: var(--gray-700); margin: 0;
}

/* =============================================
   DIAGNOSES SECTION
   ============================================= */
.diagnoses-section {
    background:
        linear-gradient(115deg, rgba(8,24,17,.68), rgba(19,53,39,.48)),
        url("../bgimg.jpg") center center / cover no-repeat;
    padding: 4rem 1.5rem 5rem;
    position: relative;
}
.diagnoses-section::before {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(8,24,17,.1) 0%, rgba(8,24,17,.0) 100%);
    pointer-events: none;
}
.diagnoses-inner {
    max-width: 1240px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.diagnoses-inner .section-header h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.02em;
    text-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.diagnoses-inner .section-header {
    margin-bottom: 2rem;
}

/* =============================================
   DIAGNOSIS CARDS
   ============================================= */
.diagnoses-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}
.diag-card {
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 1.1rem;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(17,66,23,.15);
    transition: all .3s ease;
    display: flex;
    flex-direction: column;
}
.diag-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 44px rgba(17,66,23,.22);
}
.diag-card .card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.diag-card .card-body {
    padding: 1.1rem 1.25rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.diag-card .card-title {
    font-family: var(--font-display);
    font-size: 1rem; font-weight: 700;
    color: var(--green-900); margin: 0;
}
.diag-card .card-disease {
    font-size: 0.9rem; font-weight: 600;
    color: var(--gray-900); margin: 0;
}
.diag-card .card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.65rem;
    border-top: 1px solid var(--gray-200);
}
.diag-card .card-time {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
}
.diag-card .card-accuracy {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--green-800);
    background: var(--green-100);
    border: 1px solid var(--green-200);
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1200px) {
    nav { display: none; }
    .diagnoses-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 992px) {
    .feature-grid { grid-template-columns: 1fr; max-width: 500px; }
}
@media (max-width: 640px) {
    .diagnoses-grid { grid-template-columns: 1fr; }
    .why-section { padding: 3rem 1rem 2.5rem; }
    .diagnoses-section { padding: 3rem 1rem 3.5rem; }
}