/* ============================================================
   MULAI DETEKSI
============================================================ */
#mulai-deteksi { background: var(--slate-50); }

.deteksi-header { text-align: center; margin-bottom: 2.5rem; }
.deteksi-header .section-desc { margin: 0 auto; }

.deteksi-form-wrap { max-width: 1200px; margin: 0 auto; }

/* Form card */
.form-card {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.form-card-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--slate-100);
    background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
    padding: 1.25rem 1.5rem;
    margin: -2rem -2rem 1.5rem -2rem;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: none;
}
.form-card-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    color: #fff; flex-shrink: 0;
}
.form-card-icon svg { width: 20px; height: 20px; }
.form-card-title {
    font-family: 'Inter', sans-serif;
    font-size: 1rem; font-weight: 700; color: #fff;
}
.form-card-sub { font-size: .8rem; color: rgba(255, 255, 255, 0.75); margin-top: -2px; }
.hasil-card-header {
    margin: 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* Form fields */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label { font-size: .82rem; font-weight: 600; color: var(--slate-700); }
.form-label .req { color: var(--red-500); margin-left: 2px; }

.form-input, .form-select {
    padding: .65rem .9rem;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-md);
    font-family: inherit; font-size: .9rem;
    color: var(--slate-800); background: #fff;
    outline: none; transition: all .2s; width: 100%;
}
.form-input:focus, .form-select:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

/* Custom Dropdown */
.custom-select-wrap { position: relative; }

.custom-select-trigger {
    display: flex; align-items: center; justify-content: space-between;
    padding: .65rem .9rem;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-md);
    font-family: inherit; font-size: .9rem;
    color: var(--slate-400); background: #fff;
    cursor: pointer; transition: all .2s;
    user-select: none;
}
.custom-select-trigger.selected { color: var(--slate-800); }
.custom-select-trigger:hover,
.custom-select-wrap.open .custom-select-trigger {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.custom-select-trigger svg {
    width: 16px; height: 16px;
    color: var(--slate-400); flex-shrink: 0;
    transition: transform .2s;
}
.custom-select-wrap.open .custom-select-trigger svg {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    display: none;
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: #fff;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0,0,0,.10);
    z-index: 100; overflow: hidden;
}
.custom-select-wrap.open .custom-select-dropdown { display: block; }

.custom-select-option {
    display: flex; align-items: center; gap: 10px;
    padding: .65rem 1rem;
    font-size: .9rem; color: var(--slate-700);
    cursor: pointer; transition: background .15s;
}
.custom-select-option:hover { background: var(--blue-50); color: var(--blue-600); }
.custom-select-option.active {
    background: var(--blue-50); color: var(--blue-600); font-weight: 600;
}
.custom-select-option .opt-check {
    width: 16px; height: 16px; margin-left: auto;
    color: var(--blue-500); display: none;
}
.custom-select-option.active .opt-check { display: block; }

.form-textarea {
    width: 100%;
    padding: .75rem .9rem;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-md);
    font-family: inherit; font-size: .9rem;
    color: var(--slate-800); background: #fff;
    outline: none; resize: vertical; min-height: 120px;
    transition: all .2s;
}
.form-textarea:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.form-textarea::placeholder { color: var(--slate-300); }

.input-divider {
    display: flex; align-items: center; gap: .75rem;
    margin: 1rem 0;
    color: var(--slate-300); font-size: .78rem;
    font-weight: 600; text-transform: uppercase; letter-spacing: .1em;
}
.input-divider::before, .input-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--slate-200);
}

/* Drop zone */
.drop-zone {
    border: 2px dashed var(--slate-300);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all .25s;
    background: var(--slate-50);
    position: relative;
}
.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--blue-400); background: var(--blue-50);
}
.drop-zone-input {
    position: absolute; inset: 0;
    opacity: 0; cursor: pointer;
    width: 100%; height: 100%;
}
.drop-zone-icon {
    width: 60px; height: 60px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem; color: #fff;
}
.drop-zone-icon svg { width: 32px; height: 32px; }
.drop-zone-title { font-weight: 700; color: var(--slate-700); font-size: .95rem; margin-bottom: .35rem; }
.drop-zone-sub   { font-size: .8rem; color: var(--slate-400); }
.drop-zone-hint  {
    margin-top: .6rem;
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .73rem; color: var(--blue-500); font-weight: 600;
}
.drop-zone-hint svg { width: 13px; height: 13px; }

/* Image preview */
.img-preview-wrap { display: none; margin-top: 1rem; position: relative; }
.img-preview-wrap.show { display: block; }
.img-preview {
    width: 100%; max-height: 200px;
    object-fit: cover; border-radius: var(--radius-md);
    border: 1px solid var(--slate-200);
}
.img-preview-remove {
    position: absolute; top: 8px; right: 8px;
    width: 30px; height: 30px;
    background: rgba(0,0,0,.55); border: none;
    border-radius: 50%; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.img-preview-remove:hover { background: var(--red-500); }
.img-preview-remove svg { width: 15px; height: 15px; }

/* Submit button */
.btn-submit {
    width: 100%; padding: .95rem;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
    color: #fff; border: none;
    border-radius: 14px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem; font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    box-shadow: var(--shadow-blue);
    transition: all .25s; margin-top: .5rem;
}
.btn-submit:hover {
    background: linear-gradient(135deg, var(--blue-700), var(--blue-600));
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(37,99,235,.35);
}
.btn-submit:disabled { opacity: .7; cursor: not-allowed; transform: none; }
.btn-submit svg { width: 20px; height: 20px; }

/* Button reset */
.btn-reset {
    width: 100%;
    padding: .9rem;
    background: var(--slate-200);
    color: var(--slate-700);
    border: none;
    border-radius: 14px;
    font-family: 'Inter', sans-serif;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-top: 1rem;
    transition: all .2s;
}
.btn-reset:hover { background: var(--slate-300); }
.btn-reset svg { width: 20px; height: 20px; }

/* Spinner */
.spinner {
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Kalimat terdeteksi judi */
.kalimat-judi-wrap {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}
.kalimat-judi-title {
    font-size: .78rem; font-weight: 700;
    color: var(--red-600);
    text-transform: uppercase; letter-spacing: .07em;
    margin-bottom: .6rem;
    display: flex; align-items: center; gap: 6px;
}
.kalimat-judi-title svg { width: 14px; height: 14px; }
.kalimat-judi-list { display: flex; flex-direction: column; gap: .5rem; }
.kalimat-judi-item {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 3px solid var(--red-500);
    border-radius: var(--radius-md);
    padding: .65rem 1rem;
    font-size: .85rem; color: var(--slate-700); line-height: 1.6;
    display: flex; align-items: flex-start; gap: .6rem;
}
.kalimat-judi-badge {
    flex-shrink: 0;
    font-size: .7rem; font-weight: 700;
    background: var(--red-500); color: #fff;
    padding: .15rem .45rem; border-radius: var(--radius-full);
    margin-top: 2px;
}
.kalimat-judi-conf {
    margin-left: auto; flex-shrink: 0;
    font-size: .72rem; font-weight: 600;
    color: var(--red-500);
    white-space: nowrap;
}

/* ============================================================
   GAMBAR HASIL DETEKSI CNN + BOUNDING BOX
============================================================ */
.annotated-image-wrap {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}
.annotated-image-title {
    font-size: .78rem; font-weight: 700;
    color: var(--red-600);
    text-transform: uppercase; letter-spacing: .07em;
    margin-bottom: .6rem;
    display: flex; align-items: center; gap: 6px;
}
.annotated-image-title svg { width: 14px; height: 14px; }
.annotated-image-container {
    position: relative;
    border: 2px solid #fecaca;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--slate-900);
    cursor: zoom-in;
}
.annotated-image-container img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 480px;
    object-fit: contain;
}
.annotated-image-badge {
    position: absolute; top: 10px; right: 10px;
    background: var(--red-500); color: #fff;
    font-size: .72rem; font-weight: 700;
    padding: .25rem .65rem;
    border-radius: var(--radius-full);
    display: flex; align-items: center; gap: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    pointer-events: none;
}
.annotated-image-badge svg { width: 12px; height: 12px; }
.annotated-image-hint {
    font-size: .72rem; color: var(--slate-400);
    margin-top: .5rem;
    display: flex; align-items: center; gap: 5px;
}
.annotated-image-hint svg { width: 12px; height: 12px; }

/* Lightbox */
.img-lightbox-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.85);
    z-index: 9999;
    align-items: center; justify-content: center;
    padding: 1.5rem;
    cursor: zoom-out;
    animation: fadeIn .15s ease;
}
.img-lightbox-overlay.show { display: flex; }
.img-lightbox-overlay img {
    max-width: 100%; max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0,0,0,.5);
    cursor: default;
}
.img-lightbox-close {
    position: absolute; top: 1rem; right: 1rem;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.15); border: none;
    color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.img-lightbox-close:hover { background: rgba(255,255,255,.3); }
.img-lightbox-close svg { width: 18px; height: 18px; }

/* ============================================================
   HASIL DETEKSI
============================================================ */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.hasil-placeholder { padding: 3.5rem 1.5rem; text-align: center; }
.hasil-placeholder-icon {
    width: 64px; height: 64px;
    margin: 0 auto 1.25rem;
    border-radius: 50%; background: var(--slate-100);
    display: flex; align-items: center; justify-content: center;
    color: var(--slate-300);
}
.hasil-placeholder-icon svg { width: 30px; height: 30px; }
.hasil-placeholder-title {
    font-family: 'Inter', sans-serif;
    font-size: 1rem; font-weight: 700;
    color: var(--slate-400); margin-bottom: .4rem;
}
.hasil-placeholder-sub { font-size: .82rem; color: var(--slate-300); }

.hasil-banner {
    padding: 1.75rem 2rem;
    display: flex; align-items: center; gap: 1rem;
    animation: fadeSlideUp .4s ease both;
}
.hasil-banner.danger  { background: linear-gradient(135deg,#fef2f2,#fee2e2); border-bottom:1px solid #fecaca; }
.hasil-banner.warning { background: linear-gradient(135deg,#fefce8,#fef9c3); border-bottom:1px solid #fde68a; }
.hasil-banner.info    { background: linear-gradient(135deg,#fff7ed,#fed7aa); border-bottom:1px solid #fdba74; }
.hasil-banner.success { background: linear-gradient(135deg,#f0fdf4,#dcfce7); border-bottom:1px solid #86efac; }

.hasil-banner-icon {
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.hasil-banner-icon svg { width: 26px; height: 26px; }
.danger  .hasil-banner-icon { background: var(--red-500);    color: #fff; }
.warning .hasil-banner-icon { background: var(--yellow-500); color: #fff; }
.info    .hasil-banner-icon { background: var(--orange-500); color: #fff; }
.success .hasil-banner-icon { background: var(--green-500);  color: #fff; }

.hasil-banner-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem; font-weight: 800; margin-bottom: 2px;
}
.danger  .hasil-banner-title { color: var(--red-600); }
.warning .hasil-banner-title { color: #92400e; }
.info    .hasil-banner-title { color: #9a3412; }
.success .hasil-banner-title { color: var(--green-600); }

.hasil-banner-level {
    font-size: .8rem; font-weight: 600;
    padding: .2rem .6rem; border-radius: var(--radius-full);
}
.danger  .hasil-banner-level { background: var(--red-500);    color: #fff; }
.warning .hasil-banner-level { background: var(--yellow-500); color: #fff; }
.info    .hasil-banner-level { background: var(--orange-500); color: #fff; }
.success .hasil-banner-level { background: var(--green-500);  color: #fff; }

.hasil-body { padding: 1.75rem 2rem; }

.hasil-scores {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 1rem; margin-bottom: 1.5rem;
}
@media (max-width: 560px) { .hasil-scores { grid-template-columns: 1fr 1fr; } }

.score-box {
    background: var(--slate-50);
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-md); padding: 1rem;
}
.score-box-label {
    font-size: .73rem; font-weight: 700;
    color: var(--slate-400);
    text-transform: uppercase; letter-spacing: .06em; margin-bottom: .35rem;
}
.score-box-val {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem; font-weight: 800;
    color: var(--slate-900); line-height: 1;
}
.score-box-sub { font-size: .72rem; color: var(--slate-400); margin-top: 2px; }

.model-results { display: flex; gap: .75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.model-chip {
    display: flex; align-items: center; gap: 6px;
    padding: .4rem .9rem;
    border-radius: var(--radius-full);
    font-size: .8rem; font-weight: 600; border: 1px solid;
}
.model-chip.judi     { background: var(--red-50);   border-color: #fecaca; color: var(--red-600); }
.model-chip.non-judi { background: var(--green-50); border-color: #86efac; color: var(--green-600); }
.model-chip.not-run  { background: var(--slate-50); border-color: var(--slate-200); color: var(--slate-400); }
.model-chip svg { width: 14px; height: 14px; }

.edukasi-box {
    background: var(--blue-50);
    border: 1px solid var(--blue-100);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
}
.edukasi-title {
    font-size: .78rem; font-weight: 700;
    color: var(--blue-700);
    text-transform: uppercase; letter-spacing: .07em;
    margin-bottom: .5rem;
    display: flex; align-items: center; gap: 6px;
}
.edukasi-title svg { width: 14px; height: 14px; }
.edukasi-text { font-size: .86rem; color: var(--slate-600); line-height: 1.65; }

.pending-notice {
    display: flex; align-items: center; gap: 8px;
    padding: .7rem 1rem;
    background: #fefce8; border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    font-size: .8rem; color: #92400e; font-weight: 500;
    margin-top: 1rem;
}
.pending-notice svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--yellow-500); }

@media (max-width: 768px) {
    .form-card { padding: 1.25rem; }
    .hasil-body { padding: 1.25rem; }
    .hasil-banner { padding: 1.25rem; }
}
