/* ============================================================
   assets/css/style.css — SawitCek Custom Styles
   ============================================================ */

/* ── Root Variables ─────────────────────────────────────── */
:root {
    --green-dark:   #1a3a2a;
    --green-main:   #2d5a3d;
    --green-mid:    #3d7a52;
    --green-light:  #5a9e6f;
    --green-pale:   #e8f5ed;
    --gray-bg:      #f8f9fa;
    --border-color: #dee2e6;
    --shadow-sm:    0 2px 8px rgba(0,0,0,.08);
    --shadow-md:    0 4px 16px rgba(0,0,0,.12);
    --radius:       10px;
}

/* ── Base ───────────────────────────────────────────────── */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--gray-bg);
    color: #212529;
}
a { text-decoration: none; }

/* ── Navbar ─────────────────────────────────────────────── */
.bg-dark-green  { background-color: var(--green-dark) !important; }
.footer-dark    { background-color: var(--green-dark); }
.text-success-light { color: #6fcf8a !important; }
.text-muted-light   { color: #9abda8 !important; }

.navbar .nav-link { color: rgba(255,255,255,.80) !important; transition: color .2s; }
.navbar .nav-link:hover,
.navbar .nav-link.active { color: #ffffff !important; }
.navbar .nav-link.active { font-weight: 600; border-bottom: 2px solid #6fcf8a; }

/* ── Hero Section ───────────────────────────────────────── */
.hero-section {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-main) 60%, var(--green-mid) 100%);
    color: #fff;
    padding: 80px 0 60px;
    position: relative;
    overflow: hidden;
}
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 40px;
    background: var(--gray-bg);
    clip-path: ellipse(55% 100% at 50% 100%);
}
.hero-badge {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: .82rem;
    display: inline-block;
    margin-bottom: 16px;
}

/* ── Cards ───────────────────────────────────────────────── */
.card-feature {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: #fff;
    padding: 28px 24px;
    transition: transform .2s, box-shadow .2s;
    height: 100%;
}
.card-feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.card-feature .icon-wrap {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}
.icon-green  { background: var(--green-pale); color: var(--green-main); }
.icon-blue   { background: #e8f0fe; color: #1a56db; }
.icon-orange { background: #fef3e8; color: #d67e0a; }

/* ── Upload Zone ─────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed #adb5bd;
    border-radius: var(--radius);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .25s, background .25s;
    background: #fafafa;
}
.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--green-mid);
    background: var(--green-pale);
}
.upload-zone i { font-size: 2.5rem; color: #adb5bd; }
.upload-zone.dragover i { color: var(--green-mid); }

.preview-wrap {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: #f1f3f5;
    min-height: 200px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    position: relative;
}
.preview-wrap img {
    max-width: 100%; max-height: 260px;
    object-fit: contain; border-radius: 8px;
}
.preview-placeholder {
    color: #adb5bd; text-align: center; padding: 20px;
}

/* ── Confidence Bar ──────────────────────────────────────── */
.confidence-bar-wrap { margin-bottom: 8px; }
.confidence-bar-wrap .label {
    font-size: .85rem; display: flex;
    justify-content: space-between; margin-bottom: 4px;
}
.progress { height: 14px; border-radius: 7px; }

/* ── Result Card ─────────────────────────────────────────── */
.result-card {
    border-left: 4px solid var(--green-main);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.badge-kelas {
    font-size: .75rem; padding: 4px 10px;
    border-radius: 20px; font-weight: 600;
}
.badge-fungal    { background: #fde8e8; color: #c0392b; }
.badge-magnesium { background: #fef9c3; color: #92400e; }
.badge-scale     { background: var(--green-pale); color: var(--green-main); }

/* ── Penyakit Cards ──────────────────────────────────────── */
.penyakit-card {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
    height: 100%;
}
.penyakit-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.penyakit-card .card-header-custom {
    padding: 20px;
    color: #fff;
}
.bg-fungal    { background: linear-gradient(135deg,#c0392b,#e74c3c); }
.bg-magnesium { background: linear-gradient(135deg,#d67e0a,#f39c12); }
.bg-scale     { background: linear-gradient(135deg,var(--green-main),var(--green-light)); }

/* ── Admin ────────────────────────────────────────────────── */
.sidebar {
    min-height: 100vh;
    background: var(--green-dark);
    width: 240px;
    flex-shrink: 0;
}
.sidebar .brand {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}
.sidebar .nav-link {
    color: rgba(255,255,255,.7) !important;
    padding: 10px 20px;
    border-radius: 0;
    display: flex; align-items: center; gap: 10px;
    transition: all .2s;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255,255,255,.1);
    color: #fff !important;
    border-left: 3px solid #6fcf8a;
    padding-left: 17px;
}
.admin-content {
    flex: 1; overflow-x: hidden;
    background: var(--gray-bg);
}
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 14px 24px;
    display: flex; align-items: center;
    justify-content: space-between;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    display: flex; align-items: center; gap: 16px;
}
.stat-icon {
    width: 52px; height: 52px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-green {
    background: var(--green-main);
    color: #fff; border: none;
    border-radius: 8px; padding: 10px 28px;
    font-weight: 600; transition: background .2s;
}
.btn-green:hover { background: var(--green-mid); color: #fff; }

/* ── Table ───────────────────────────────────────────────── */
.table th { background: #f1f3f5; font-weight: 600; font-size: .88rem; }
.table td { vertical-align: middle; font-size: .9rem; }

/* ── Alert Box ────────────────────────────────────────────── */
.alert-info-custom {
    background: #e8f4fd; border-left: 4px solid #1a73e8;
    border-radius: 8px; padding: 14px 18px;
}

/* ── Loader Overlay ──────────────────────────────────────── */
#loadingOverlay {
    display: none; position: fixed;
    inset: 0; z-index: 9999;
    background: rgba(255,255,255,.85);
    flex-direction: column;
    align-items: center; justify-content: center;
}
#loadingOverlay .spinner-grow { color: var(--green-main); width: 3rem; height: 3rem; }

/* ── Responsive tweaks ────────────────────────────────────── */
@media (max-width: 768px) {
    .hero-section { padding: 50px 0 40px; }
    .sidebar      { width: 100%; min-height: auto; }
    .upload-zone  { padding: 24px 12px; }
}
