/* Global Styles & Hacker Theme */
:root {
    --primary-color: #00FF41; /* Neon Green */
    --secondary-color: #FF003B; /* Sharp Red (untuk alert/warning) */
    --tertiary-color: #0DFFFF; /* Electric Blue (aksen lain) */
    --background-color: #050505; /* Sangat gelap */
    --container-bg: rgba(10, 15, 10, 0.75);
    --border-color: var(--primary-color);
    --text-color: var(--primary-color);
    --darker-text-color: #00a32a;
    --font-primary: 'VT323', monospace;
    --font-secondary: 'Share Tech Mono', monospace;
    --font-data: 'Roboto Mono', monospace;

    --glitch-color-1: var(--secondary-color);
    --glitch-color-2: var(--tertiary-color);
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: var(--font-primary);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    cursor: crosshair;
    font-size: 16px; /* Ukuran font dasar untuk desktop */
}

body.modal-open-no-scroll {
    overflow: hidden;
}

.overlay-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.scanlines {
    width:100%;
    height:100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 65, 0.015),
        rgba(0, 255, 65, 0.015) 1px,
        transparent 1px,
        transparent 4px
    );
    animation: scanlineMove 20s linear infinite, scanlineFlicker 0.1s infinite alternate;
    opacity: 0.6;
}

@keyframes scanlineMove {
    0% { background-position-y: 0; }
    100% { background-position-y: 100px; }
}

@keyframes scanlineFlicker {
    from { opacity: 0.5; }
    to { opacity: 0.7; }
}

.noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    animation: noiseAnim 0.2s linear infinite alternate;
}
@keyframes noiseAnim {
  0% { transform: translate(0,0); }
  25% { transform: translate(-2px,2px); }
  50% { transform: translate(2px,-2px); }
  75% { transform: translate(2px,2px); }
  100% { transform: translate(0,0); }
}

header {
    background-color: rgba(0,0,0,0.5);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 255, 65, 0.3);
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.2), inset 0 -2px 5px rgba(0,0,0,0.5);
    position: relative;
    z-index: 100;
}

.logo-container { flex-shrink: 0; }
#system-logo {
    max-height: 50px;
    width: auto;
    filter: drop-shadow(0 0 8px var(--primary-color));
    animation: logoPulse 5s infinite ease-in-out;
}
#text-logo {
    font-family: var(--font-secondary);
    font-size: 1.8em;
    color: var(--tertiary-color);
    text-shadow: 0 0 5px var(--tertiary-color), 0 0 10px var(--tertiary-color), 0 0 20px #000;
    animation: textGlitchSimple 3s infinite alternate;
    letter-spacing: 1px;
}
@keyframes logoPulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.03); filter: drop-shadow(0 0 12px var(--primary-color));}
}

.header-text { text-align: center; flex-grow: 1; }
header h1 {
    font-family: var(--font-secondary);
    font-size: 2.2em;
    margin: 0;
    letter-spacing: 2px;
    animation: textGlitch 2.5s linear infinite, textFlickerIntense 4s infinite alternate;
    color: var(--primary-color);
}
header .subtitle {
    font-family: var(--font-data);
    font-size: 0.9em;
    color: var(--darker-text-color);
    margin-top: 5px;
    letter-spacing: 1px;
    animation: textFlickerSubtle 5s infinite alternate;
}

.header-alert {
    font-family: var(--font-data);
    font-size: 0.9em;
    padding: 5px 10px;
    border-left: 2px solid var(--primary-color);
    min-width: 200px;
    text-align: right;
}
.header-alert .status-value {
    font-weight: bold;
    display: inline-block;
    transition: color 0.3s ease;
}
.header-alert .status-warning { color: #FFD700; }
.header-alert .status-critical { color: var(--secondary-color); animation: pulseRed 1s infinite; }

@keyframes pulseRed {
    0%, 100% { text-shadow: 0 0 5px var(--secondary-color); opacity: 1;}
    50% { text-shadow: 0 0 15px var(--secondary-color); opacity: 0.7;}
}

.container {
    width: 90%; /* Lebih sempit untuk desktop agar tidak terlalu lebar */
    max-width: 1200px; /* Batas lebar maksimum */
    margin: 25px auto;
    padding: 25px; /* Padding lebih besar untuk desktop */
    background-color: var(--container-bg);
    border: 1px solid rgba(0, 255, 65, 0.4);
    box-shadow: 0 0 15px rgba(0, 50, 10, 0.5), inset 0 0 10px rgba(0,0,0,0.7);
    flex-grow: 1;
    position: relative;
    overflow: hidden;
}
.container::before, .container::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    border-color: var(--tertiary-color);
    border-style: solid;
    opacity: 0.7;
}
.container::before { top: -2px; left: -2px; border-width: 2px 0 0 2px; }
.container::after { top: -2px; right: -2px; border-width: 2px 2px 0 0; }

.controls-container {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
}
#search-folder-input {
    font-family: var(--font-secondary);
    background-color: rgba(10, 20, 10, 0.8);
    color: var(--primary-color);
    border: 1px solid var(--darker-text-color);
    padding: 10px 15px;
    width: 50%;
    max-width: 400px;
    font-size: 1em;
    outline: none;
    box-shadow: 0 0 8px rgba(0,0,0,0.5) inset;
    transition: border-color 0.3s, box-shadow 0.3s;
}
#search-folder-input::placeholder { color: var(--darker-text-color); opacity: 0.7; }
#search-folder-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.4), 0 0 8px rgba(0,0,0,0.5) inset;
}

.loading-message {
    font-family: var(--font-secondary);
    font-size: 1.5em;
    text-align: center;
    padding: 40px;
    color: var(--tertiary-color);
    text-shadow: 0 0 5px var(--tertiary-color);
    display: block;
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Ukuran folder default untuk desktop */
    gap: 20px;
}
.folder-item {
    background-color: rgba(0, 20, 5, 0.6);
    border: 1px solid rgba(0, 128, 43, 0.5);
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s ease-out, box-shadow 0.2s ease-out, border-color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.folder-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0,255,65,0.15) 50%, transparent 50%);
    background-size: 100% 6px;
    opacity: 0;
    transform: translateY(-100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 0;
}
.folder-item:hover::before {
    opacity: 1;
    transform: translateY(0);
    animation: hoverScanline 0.5s linear infinite alternate;
}
@keyframes hoverScanline {
    from { background-position-y: 0px; }
    to { background-position-y: 6px; }
}
.folder-item:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.5), 0 0 8px rgba(0, 255, 65, 0.3) inset;
    border-color: var(--primary-color);
}
.folder-icon {
    font-size: 3.8em;
    margin-bottom: 12px;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
    transition: transform 0.2s ease;
    z-index: 1;
}
.folder-item:hover .folder-icon { transform: scale(1.1); color: var(--tertiary-color); }
.folder-name {
    font-family: var(--font-secondary);
    font-size: 1.1em;
    margin-bottom: 8px;
    word-break: break-word;
    color: #ccc;
    z-index: 1;
}
.folder-item:hover .folder-name { color: var(--primary-color); }
.file-count {
    font-family: var(--font-data);
    font-size: 0.85em;
    color: var(--darker-text-color);
    z-index: 1;
}
.folder-item:hover .file-count { color: var(--tertiary-color); animation: textGlitchSimple 0.5s infinite; }

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(8px) grayscale(50%);
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-sizing: border-box;
}
.modal-content {
    background-color: rgba(8,8,8, 0.95);
    margin: auto;
    padding: 20px; /* Padding default untuk modal */
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 30px rgba(0,255,65,0.3), 0 0 15px var(--secondary-color) inset;
    width: 90%;
    max-width: 1000px; /* Max width untuk desktop */
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalOpenBjorka 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes modalOpenBjorka {
    from { opacity: 0; transform: scale(0.6) rotate(-5deg); }
    to { opacity: 1; transform: scale(1) rotate(0deg); }
}
.modal-content h2 {
    margin-top: 0;
    text-align: left;
    font-family: var(--font-secondary);
    font-size: 1.6em; /* Ukuran judul modal default */
    border-bottom: 1px dashed var(--darker-text-color);
    padding-bottom: 8px;
    margin-bottom: 20px;
    color: var(--tertiary-color);
    text-shadow: 0 0 5px var(--tertiary-color);
}
.close-button, .close-preview-button {
    color: var(--secondary-color);
    float: right;
    font-size: 30px; /* Ukuran tombol close default */
    font-weight: bold;
    position: absolute;
    top: 15px;
    right: 20px;
    transition: color 0.2s, transform 0.2s;
    text-shadow: 0 0 8px var(--secondary-color);
}
.close-button:hover, .close-preview-button:hover {
    color: #ff4d6f;
    transform: rotate(90deg) scale(1.2);
    cursor: pointer;
}

.image-grid-display {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); /* Ukuran thumbnail default */
    gap: 12px;
}
.image-item-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(0,92,32, 0.7);
    padding: 6px;
    background-color: rgba(0, 10, 0, 0.7);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.image-item-container:hover { border-color: var(--tertiary-color); transform: scale(1.06); box-shadow: 0 0 10px var(--tertiary-color); }
.image-item-container.image-load-error { border-color: var(--secondary-color) !important; background-color: rgba(50,0,0,0.5); }
.image-item {
    width: 100%;
    height: 110px; /* Tinggi thumbnail default */
    object-fit: cover;
    cursor: pointer;
    border: 1px solid var(--primary-color);
    opacity: 0.85;
    transition: opacity 0.2s;
}
.image-item:hover { opacity: 1; }
.image-item-container.image-load-error .image-item { border-color: var(--secondary-color); filter: grayscale(100%) brightness(0.8); }
.image-item-caption {
    font-family: var(--font-data);
    font-size: 0.75em; /* Ukuran caption thumbnail default */
    margin-top: 6px;
    text-align: center;
    color: var(--darker-text-color);
    word-break: break-all;
    line-height: 1.2;
}
.image-item-container:hover .image-item-caption { color: var(--tertiary-color); }
.image-item-container.image-load-error .image-item-caption { color: var(--secondary-color); font-weight: bold; }

.empty-folder-message {
    text-align: center;
    font-family: var(--font-secondary);
    font-size: 1.3em;
    color: #FFD700;
    padding: 25px;
    border: 1px dashed #FFD700;
    background-color: rgba(50,50,0,0.2);
    grid-column: 1 / -1;
}

.preview-image {
    max-width: 90%;
    max-height: 78vh;
    display: block;
    margin: 15px auto;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 25px var(--primary-color), 0 0 10px var(--secondary-color);
    object-fit: contain;
    opacity: 0.9;
    transition: opacity 0.3s;
}
.preview-image:hover{ opacity: 1; }
.preview-modal-container .caption {
    text-align: center;
    color: var(--tertiary-color);
    margin-top: 10px;
    font-family: var(--font-secondary);
    font-size: 1.2em; /* Ukuran caption preview default */
    text-shadow: 0 0 5px var(--tertiary-color);
}
.prev-button, .next-button {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 12px 15px; /* Padding tombol nav default */
    color: var(--primary-color);
    font-weight: bold;
    font-size: 28px; /* Ukuran ikon nav default */
    transition: 0.2s ease;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--primary-color);
    opacity: 0.7;
}
.prev-button:hover, .next-button:hover {
    background-color: rgba(0, 255, 65, 0.4);
    text-shadow: 0 0 10px var(--primary-color);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}
.prev-button { left: 15px; border-radius: 3px 0 0 3px; }
.next-button { right: 15px; border-radius: 0 3px 3px 0; }

footer {
    background-color: #030303;
    padding: 12px 20px;
    text-align: center;
    border-top: 1px solid rgba(0,255,65,0.2);
    font-family: var(--font-data);
    font-size: 0.8em; /* Ukuran font footer default */
    margin-top: auto;
    color: var(--darker-text-color);
    letter-spacing: 0.5px;
}
footer p { margin: 0; }
.status-dynamic {
    color: var(--primary-color);
    min-width: 100px;
    display: inline-block;
}
.status-dynamic.threat-level { color: #FFD700; }
footer #last-scan-time { color: var(--tertiary-color); }

/* Animasi (tetap sama) */
@keyframes textGlitch {
    0%, 100% { clip-path: inset(0 0 0 0); }
    5% { clip-path: inset(calc(random()*100%) 0 calc(random()*100%) 0); transform: translate(calc(random()*-5px + 2.5px), calc(random()*-5px + 2.5px)); }
    10% { clip-path: inset(0 0 0 0); transform: translate(0,0); }
    15% { clip-path: inset(calc(random()*100%) 0 calc(random()*100%) 0); text-shadow: -2px -2px 0 var(--glitch-color-1), 2px 2px 0 var(--glitch-color-2); }
    20% { clip-path: inset(0 0 0 0); text-shadow: none; }
    80% { clip-path: inset(calc(random()*80%) 0 calc(random()*20%) 0); }
    85% { text-shadow: -1px -1px 0 var(--glitch-color-1), 1px 1px 0 var(--glitch-color-2); }
    90% { clip-path: inset(0 0 0 0); text-shadow: none; }
}
@keyframes textGlitchSimple {
  2%,64%{ transform: translate(1px,0) skew(0deg); }
  4%,60%{ transform: translate(-1px,0) skew(0deg); }
  62%{ transform: translate(0,0) skew(2deg); }
}
@keyframes textFlickerIntense {
    0%, 10%, 20%, 30%, 50%, 70%, 100% {
        text-shadow: 0 0 2px #fff, 0 0 5px var(--primary-color), 0 0 10px var(--primary-color), 0 0 18px var(--primary-color), 0 0 30px var(--darker-text-color), 0 0 50px var(--darker-text-color);
        opacity: 1;
    }
    5%, 15%, 25%, 40%, 60%, 80% { text-shadow: none; opacity: 0.5; }
}
@keyframes textFlickerSubtle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.6; }
}


/* ==========================================================================
   RESPONSIVE STYLES - MULAI DARI SINI
   ========================================================================== */

/* Tablet dan Desktop Kecil (misalnya, lebar <= 992px) */
@media (max-width: 992px) {
    body {
        font-size: 15px; /* Sedikit kurangi font dasar */
    }
    header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    .logo-container, .header-text, .header-alert {
        width: 100%;
        margin-bottom: 0;
        text-align: center;
    }
    .header-alert {
        border-left: none;
        border-top: 1px solid var(--primary-color);
        padding-top: 10px;
        margin-top: 10px;
    }

    #text-logo { font-size: 1.6em; }
    header h1 { font-size: 2em; }
    header .subtitle { font-size: 0.85em; }

    .container {
        width: 95%; /* Gunakan hampir seluruh lebar */
        padding: 15px;
        margin: 20px auto;
    }

    #search-folder-input {
        width: 60%;
        max-width: 380px; /* Batas sedikit berbeda */
        font-size: 0.95em;
    }

    .folder-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 18px;
    }

    .modal-content {
        padding: 15px;
        max-width: 95%; /* Modal bisa lebih lebar di tablet */
    }
    .modal-content h2 {
        font-size: 1.4em;
    }
    .image-grid-display {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }
    .image-item {
        height: 100px;
    }
    .image-item-caption {
        font-size: 0.7em;
    }

    .preview-image {
        max-height: 75vh;
    }
    .preview-modal-container .caption {
        font-size: 1em;
    }
    .prev-button, .next-button {
        font-size: 24px;
        padding: 10px 12px;
    }
}

/* Mobile (misalnya, lebar <= 767px) */
@media (max-width: 767px) {
    body {
        font-size: 14px; /* Kurangi lagi font dasar */
    }
    header {
        padding: 10px 15px; /* Kurangi padding header */
        gap: 8px;
    }
    #text-logo { font-size: 1.4em; }
    header h1 { font-size: 1.7em; letter-spacing: 1.5px; }
    header .subtitle { font-size: 0.8em; }
    .header-alert { font-size: 0.85em; padding: 8px;}


    .container {
        padding: 10px;
        margin: 15px auto;
    }

    #search-folder-input {
        width: 85%; /* Search bar lebih lebar di mobile */
        font-size: 0.9em;
        padding: 8px 12px;
    }
    .controls-container {
        margin-bottom: 20px;
    }

    .folder-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    .folder-item { padding: 12px; }
    .folder-icon { font-size: 3.2em; margin-bottom: 10px; }
    .folder-name { font-size: 1em; }
    .file-count { font-size: 0.8em; }

    .modal-content {
        padding: 10px; /* Kurangi padding modal */
        width: 95%; /* Pastikan modal tidak terlalu lebar */
    }
    .modal-content h2 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    .close-button, .close-preview-button {
        font-size: 28px;
        top: 10px;
        right: 15px;
    }

    .image-grid-display {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
    }
    .image-item {
        height: 80px;
    }
    .image-item-caption {
        font-size: 0.65em; /* Caption lebih kecil */
    }


    .preview-image {
        max-height: 70vh; /* Lebih banyak ruang untuk kontrol */
    }
    .preview-modal-container .caption {
        font-size: 0.9em;
        margin-top: 8px;
    }
    .prev-button, .next-button {
        font-size: 22px; /* Tombol nav lebih kecil */
        padding: 8px 10px;
        opacity: 0.85; /* Buat lebih terlihat di mobile jika perlu */
    }
    .prev-button { left: 10px; }
    .next-button { right: 10px; }


    footer {
        font-size: 0.75em;
        padding: 10px;
    }
    footer p {
        flex-direction: column; /* Stack item di footer */
        gap: 5px;
    }
    footer p span { /* Pastikan span mengambil lebar penuh saat di-stack */
        display: block;
        min-width: unset; /* Hapus min-width jika ada */
    }
}

/* Mobile Sangat Kecil (misalnya, lebar <= 480px) */
@media (max-width: 480px) {
    body {
        font-size: 13px; /* Font dasar mungkin perlu lebih kecil, hati-hati dengan VT323 */
    }
    header { padding: 8px 10px; gap: 5px; }
    #text-logo { font-size: 1.2em; }
    header h1 { font-size: 1.4em; letter-spacing: 1px; }
    header .subtitle { font-size: 0.7em; letter-spacing: 0.5px; }
    .header-alert { font-size: 0.75em; padding: 6px; }


    .container {
        padding: 8px;
        margin: 10px auto;
    }
    #search-folder-input {
        width: 90%;
        padding: 8px 10px;
        font-size: 0.85em;
    }
    .controls-container {
        margin-bottom: 15px;
    }

    .folder-grid {
        /* Pada layar sangat kecil, mungkin 2 kolom lebih baik */
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .folder-item { padding: 10px; }
    .folder-icon { font-size: 2.8em; margin-bottom: 8px;}
    .folder-name { font-size: 0.9em; }

    .modal-content {
        width: 96%; /* Hampir penuh */
        padding: 8px;
        max-height: 95vh; /* Bisa lebih tinggi */
    }
    .modal-content h2 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }
    .close-button, .close-preview-button {
        font-size: 26px;
        top: 8px;
        right: 10px;
    }

    .image-grid-display {
        /* Mungkin 2 atau 3 kolom tetap */
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 6px;
    }
    .image-item {
        height: 70px;
    }
    .image-item-caption {
        font-size: 0.6em;
        margin-top: 4px;
    }

    .preview-image {
        border-width: 1px; /* Border lebih tipis */
    }
    .preview-modal-container .caption {
        font-size: 0.8em;
        margin-top: 6px;
    }
    .prev-button, .next-button {
        font-size: 20px;
        padding: 6px 8px;
    }

    footer {
        font-size: 0.65em; /* Font footer sangat kecil */
        padding: 8px 5px;
    }
    footer p span {
        line-height: 1.4; /* Spasi antar baris jika teksnya wrap */
    }
}