/* style.css - Premium Eco-Tech Perfectly Balanced Theme with Soothing Corn Leaf Background */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #121c15;
    --bg-panel: rgba(255, 255, 255, 0.96);
    --bg-card: rgba(255, 255, 255, 0.97);
    --border-color: rgba(4, 120, 87, 0.15);
    --border-color-glow: rgba(4, 120, 87, 0.35);
    --primary: #059669;
    --primary-hover: #047857;
    --primary-glow: rgba(5, 150, 105, 0.15);
    --accent: #10B981;
    --text-primary: #1F2937;
    --text-muted: #4B5563;
    --text-green: #047857;
    --shadow-glow: 0 10px 30px rgba(4, 120, 87, 0.08);
    --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--bg-dark);
    /* 
       Menggunakan overlay hijau hutan semi-gelap yang nyaman dan teduh (opacity 45% ke 68%) 
       di atas foto daun jagung, menciptakan efek kontras tinggi (Lush Backdrop).
       Hal ini membuat panel putih bersih melayang di atasnya dan tulisan di dalam panel 100% terbaca tajam.
    */
    background-image: linear-gradient(135deg, rgba(20, 38, 26, 0.5) 0%, rgba(10, 22, 14, 0.72) 100%), url('/static/corn_leaves_bg.png');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background Soft Glow Orbs */
body::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.06) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* Typography settings */
h1, h2, h3, h4, h5, h6, .font-display {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
}

.glass-panel:hover {
    border-color: var(--border-color-glow);
    box-shadow: var(--shadow-glow), 0 15px 35px rgba(4, 120, 87, 0.12);
}

/* Header customization */
.header-badge {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(4, 120, 87, 0.25);
    color: var(--primary-hover);
    padding: 7px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Drag-and-Drop Dropzone */
.dropzone-container {
    position: relative;
    border: 2px dashed rgba(4, 120, 87, 0.35);
    border-radius: 16px;
    padding: 40px 24px;
    text-align: center;
    background: rgba(5, 150, 105, 0.02);
    cursor: pointer;
    transition: var(--transition-smooth);
    overflow: hidden;
}

.dropzone-container:hover, .dropzone-container.dragover {
    border-color: var(--primary);
    background: rgba(5, 150, 105, 0.05);
    box-shadow: 0 0 15px rgba(5, 150, 105, 0.06);
}

.dropzone-icon {
    font-size: 3.5rem;
    color: var(--primary);
    margin-bottom: 16px;
    transition: var(--transition-smooth);
}

.dropzone-container:hover .dropzone-icon {
    transform: translateY(-5px) scale(1.05);
    color: var(--primary-hover);
}

.file-input {
    display: none;
}

/* Glowing Button */
.btn-glow {
    background: linear-gradient(135deg, var(--primary) 0%, #047857 100%);
    border: none;
    color: white;
    font-weight: 700;
    padding: 14px 28px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(4, 120, 87, 0.25);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: 0.5s;
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(4, 120, 87, 0.35), 0 0 8px rgba(4, 120, 87, 0.15);
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
}

.btn-glow:hover::after {
    left: 100%;
}

.btn-glow:active {
    transform: translateY(1px);
}

/* Image Preview & Scan Animation */
.image-preview-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.image-preview-wrapper img {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    display: block;
}

/* Laser scan line overlay */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    box-shadow: 0 0 12px var(--primary), 0 0 4px var(--primary);
    z-index: 2;
    animation: laser-scan 3s infinite ease-in-out;
}

@keyframes laser-scan {
    0% {
        top: 0%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

/* Overlay processing */
.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 5;
    backdrop-filter: blur(8px);
}

/* Result Card */
.result-header {
    border-bottom: 1px solid rgba(0,0,0,0.08);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

/* Diagnostic Tabs */
.diag-tabs {
    display: flex;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    margin-bottom: 16px;
    gap: 8px;
}

.diag-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 16px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.diag-tab-btn:hover {
    color: var(--text-primary);
}

.diag-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
    font-size: 0.95rem;
    line-height: 1.65;
}

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

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

/* Accuracy Meter (Linear Progress) */
.accuracy-bar-container {
    height: 10px;
    background: rgba(0,0,0,0.06);
    border-radius: 50px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0,0,0,0.02);
}

.accuracy-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    box-shadow: 0 0 10px rgba(5, 150, 105, 0.3);
    border-radius: 50px;
    transition: width 1.5s cubic-bezier(0.1, 0.8, 0.3, 1);
    width: 0;
}

/* Encyclopedia Grid */
.encyclo-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px;
    transition: var(--transition-smooth);
    cursor: pointer;
    height: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.03);
}

.encyclo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(5, 150, 105, 0.03) 0%, transparent 100%);
    opacity: 0;
    transition: var(--transition-smooth);
}

.encyclo-card:hover {
    transform: translateY(-5px);
    border-color: rgba(5, 150, 105, 0.3);
    box-shadow: 0 12px 28px rgba(4, 120, 87, 0.1);
}

.encyclo-card:hover::before {
    opacity: 1;
}

.encyclo-card .disease-icon {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 12px;
    display: inline-block;
}

.encyclo-card .disease-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.encyclo-card .disease-snippet {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Info Badges & Cards */
.info-sub-card {
    background: rgba(5, 150, 105, 0.04);
    border: 1px solid rgba(5, 150, 105, 0.08);
    border-radius: 12px;
    padding: 14px;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    font-weight: 600;
}

.info-val {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Reset / Action Buttons */
.btn-reset {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.btn-reset:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #DC2626;
}

/* Modal Customization */
.modal-content-glass {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(5, 150, 105, 0.2);
    border-radius: 24px;
    color: var(--text-primary);
    box-shadow: 0 20px 50px rgba(0,0,0,0.12), 0 0 30px rgba(5, 150, 105, 0.05);
}

.modal-header-custom {
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 24px 24px 16px;
}

.modal-body-custom {
    padding: 24px;
}

.modal-footer-custom {
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 16px 24px 24px;
}

.modal-close-btn {
    background: rgba(0,0,0,0.04);
    border: none;
    color: var(--text-muted);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.modal-close-btn:hover {
    background: rgba(0,0,0,0.08);
    color: var(--text-primary);
}

/* Tech Stat badge */
.tech-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(4, 120, 87, 0.18);
    padding: 6px 14px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    font-weight: 600;
}

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

/* Scanning Pulse Radar Effect */
.pulse-radar {
    position: relative;
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
}

.pulse-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(5, 150, 105, 0.15);
    border-radius: 50%;
    animation: pulse-out 2s infinite ease-out;
}

.pulse-circle-2 {
    animation-delay: 1s;
}

.pulse-core {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--primary);
    color: white;
}

@keyframes pulse-out {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}
