/* File: static/css/style.css (Two-Column Clean Design with Scrollable Metrics) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
    color: #374151;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    line-height: 1.6;
}

/* Container Utama */
.container {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 900px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    padding: 1.25rem 2.5rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
    position: relative;
}
header h1 { font-size: 1.5rem; font-weight: 600; color: #111827; margin: 0; }

/* Link kembali di Header */
.back-link-header {
    position: absolute; left: 1.5rem; top: 50%; transform: translateY(-50%);
    color: #6b7280; text-decoration: none; font-size: 0.9rem;
    display: inline-flex; align-items: center; gap: 0.3rem; transition: color 0.2s;
}
.back-link-header:hover { color: #1f2937; }

/* Main Content Area - Flexbox untuk Kolom */
main {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

/* Kolom Kiri (Upload) */
.upload-column {
    flex: 1 1 45%;
    min-width: 320px;
    padding: 2rem 2.5rem;
}

/* Kolom Kanan (Hasil) */
.result-column {
    flex: 1 1 55%;
    min-width: 320px;
    padding: 2rem 2.5rem;
    background-color: #f9fafb;
    border-left: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: center; 
    overflow: hidden; 
}

/* Penyesuaian garis pemisah untuk layar lebar */
@media (min-width: 769px) {
    .upload-column { border-right: 1px solid #e5e7eb; }
    .result-column { border-left: none; }
}


/* Styling Form Upload */
.upload-form h2 { font-size: 1.25rem; font-weight: 600; color: #1f2937; margin-bottom: 1.5rem; text-align: left; }

/* Area Upload Minimalis */
.upload-zone {
    padding: 2.5rem; margin: 2.5rem 0; cursor: pointer; position: relative;
    background-color: transparent; border: none; border-radius: 0;
    box-shadow: none; outline: none; text-align: center;
}
.upload-zone:hover { background-color: rgba(0, 0, 0, 0.02); }
.upload-icon svg { width: 2.5rem; height: 2.5rem; fill: #9ca3af; margin-bottom: 0.75rem; }
.upload-text { color: #6b7280; font-size: 0.9rem; margin-bottom: 1rem; }
.btn-secondary { background-color: #e5e7eb; color: #374151; padding: 0.6rem 1.2rem; border: none; border-radius: 6px; font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: background-color 0.2s ease; display: inline-block; }
.btn-secondary:hover { background-color: #d1d5db; }
#file-input { display: none; }

/* Tombol Submit */
.btn-primary { background-color: #0c4a6e; color: #ffffff; padding: 0.8rem 1.5rem; border: none; border-radius: 8px; font-size: 1rem; font-weight: 500; cursor: pointer; transition: background-color 0.2s ease; width: 100%; margin-top: 1rem; }
.btn-primary:hover { background-color: #075985; }

/* Styling Hasil Prediksi */
.result-column h2 { font-size: 1.25rem; font-weight: 600; color: #1f2937; margin-bottom: 1.5rem; width: 100%; text-align: center; }
.result-placeholder { color: #9ca3af; font-style: italic; margin-top: 2rem; }
.result-content { margin-top: 0; width: 100%; text-align: center; }

/* --- PERBAIKAN GAMBAR HASIL --- */
.result-image {
    display: block;      
    width: 100%;         
    max-width: 100%;     
    height: auto;        
    object-fit: contain; 
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
    margin-left: auto;   
    margin-right: auto;  
}

.prediction-label { font-size: 0.9rem; color: #6b7280; margin-bottom: 0.1rem; }
.prediction-value { font-size: 1.5rem; font-weight: 600; color: #1f2937; margin-bottom: 0.75rem; }
.result-description { font-size: 0.85rem; color: #6b7280; margin-top: -0.5rem; margin-bottom: 1rem; }
.accuracy-label { font-size: 0.9rem; color: #6b7280; margin-bottom: 0.1rem; }
.accuracy-value { font-size: 1.1rem; color: #374151; font-weight: 500; }
.processing-time { margin-top: 1.5rem; font-size: 0.8rem; color: #9ca3af; font-style: italic; }

/* Pesan Error */
.error-box { margin-top: 1.5rem; color: #991b1b; background-color: #fee2e2; border: 1px solid #fecaca; border-radius: 8px; padding: 0.8rem 1rem; font-size: 0.9rem; text-align: center; }

/* Responsiveness */
@media (max-width: 768px) {
    main { 
        flex-direction: column; 
    }
    
    .upload-column, .result-column {
        width: 100% !important; 
        flex-basis: 100% !important;
        min-width: 0 !important; 
        
        padding-left: 1.5rem;  
        padding-right: 1.5rem; 
        border-right: none;
        border-left: none;
    }

    .mobile-only-btn {
        display: inline-block;
    }
    
    .upload-column {
        border-bottom: 1px solid #e5e7eb; 
        margin-bottom: 1.5rem; 
        padding-bottom: 1.5rem;
    }
    
    .result-column { 
        background-color: #ffffff; 
    }
    
    .container { 
        max-width: 100%; 
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }

    header {
        padding: 1rem 1.5rem;
    }
    
    header h1 { 
        font-size: 1.25rem; 
    }
    
    .back-link-header { 
        left: 1rem; 
    }
}


/* --- Styling Tambahan untuk Homepage (index.html) --- */
body.homepage {
    background: linear-gradient(to bottom right, #e0eafc, #cfdef3);
}

body.homepage .container {
    max-width: 600px;
    padding: 3rem;
    text-align: center;
}

body.homepage header {
    border-bottom: none;
    margin-bottom: 1.5rem;
    padding: 0;
}

body.homepage header h1 { 
    font-size: 2rem;
    color: #111827;
    margin-bottom: 0.75rem;
}

body.homepage main p {
    color: #4b5563;
    margin-bottom: 2rem;
    font-size: 1rem;
    text-align: center;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

body.homepage main {
    padding: 0;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

body.homepage .btn-primary.homepage-cta {
    width: auto; 
    padding: 0.9rem 2.5rem;
    font-size: 1.1rem;
    margin-top: 1rem;
    background-color: #0891b2; 
    box-shadow: 0 4px 14px rgba(8, 145, 178, 0.3);
    text-decoration: none !important; 
    display: inline-block;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

body.homepage .btn-primary.homepage-cta:hover {
    background-color: #0e7490;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(8, 145, 178, 0.35);
}

body.homepage .btn-primary.homepage-cta:active {
    transform: translateY(0);
    box-shadow: 0 4px 14px rgba(8, 145, 178, 0.3);
}

.hero-illustration {
    max-width: 150px;
    height: auto;
    margin-bottom: 2rem;
    opacity: 0.8;
}

@media (max-width: 600px) {
    body.homepage .container { padding: 2rem 1.5rem; }
    body.homepage header h1 { font-size: 1.6rem; }
    body.homepage main p { font-size: 0.95rem; }
    .hero-illustration { max-width: 120px; margin-bottom: 1.5rem; }
}


/* --- FITUR SCROLLBAR UNTUK METRIK (BARU) --- */
.scrollable-metrics {
    max-height: 280px; 
    overflow-y: auto;
    padding-right: 15px;
    margin-bottom: 10px;
}
.scrollable-metrics::-webkit-scrollbar {
    width: 6px;
}
.scrollable-metrics::-webkit-scrollbar-track {
    background: #f9fafb; 
    border-radius: 4px;
}
.scrollable-metrics::-webkit-scrollbar-thumb {
    background: #d1d5db; 
    border-radius: 4px;
}
.scrollable-metrics::-webkit-scrollbar-thumb:hover {
    background: #9ca3af; 
}