:root {
    --primary-green: #10b981;
    --dark-green: #064e3b;
    --light-green: #ecfdf5;
    --accent-green: #34d399;
    --bg-gradient: linear-gradient(135deg, #059669 0%, #064e3b 100%);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --border-color: #f1f5f9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 40px 20px;
    color: var(--text-main);
    line-height: 1.5;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 40px;
    min-height: 80vh;
}

/* --- Utility Pencarian (Penting agar JS berfungsi) --- */
.hide-card, .hide-category {
    display: none !important;
}

header {
    text-align: left;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

header h1 {
    color: var(--dark-green);
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 5px;
}

header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- Search Section --- */
.search-section {
    position: relative;
    margin-bottom: 30px;
}

#searchInput {
    width: 100%;
    padding: 16px 55px 16px 24px;
    font-size: 15px;
    background: #f8fafc;
    border: 2px solid var(--primary-green);
    border-radius: 16px;
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    background: #fff;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.1);
}

.clear-btn {
    position: absolute;
    right: 16px;
    top: 28px; /* Menyesuaikan posisi vertikal tengah input */
    transform: translateY(-50%);
    background: #e2e8f0;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    color: #475569;
    display: none; /* Akan dimunculkan oleh JS saat mengetik */
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

/* --- Category Section --- */
.category-section {
    margin-bottom: 40px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.category-header h2 {
    color: var(--text-main);
    font-size: 1.25rem;
    font-weight: 700;
    padding-left: 15px;
    border-left: 4px solid var(--primary-green);
}

.file-count {
    background: var(--light-green);
    color: var(--primary-green);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

/* --- File Grid & Card --- */
.file-grid-2cols {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.file-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.file-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.05);
    border-color: var(--accent-green);
}

.file-icon {
    font-size: 26px;
    width: 52px;
    height: 52px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0; /* Mencegah overflow flex item */
}

/* Mengatur Nama File Panjang agar Tetap Rapi */
.file-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 13.5px;
    margin-bottom: 4px;
    white-space: normal; /* Memungkinkan teks turun baris */
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Batas 2 baris */
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.file-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.dot {
    margin: 0 4px;
}

/* --- Action Button --- */
.download-btn {
    background: var(--primary-green);
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: 0.2s;
    flex-shrink: 0;
}

.download-btn:hover {
    background: var(--dark-green);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* --- State Messsages --- */
.no-results, .empty-folder {
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 20px;
    color: var(--text-muted);
}

/* --- Responsive Layout --- */
@media (max-width: 850px) {
    .file-grid-2cols {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 20px 10px;
    }
    
    header h1 {
        font-size: 1.4rem;
    }

    .file-card {
        padding: 12px;
    }
    
    .file-icon {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }
}