﻿/* --- Container utama list file --- */
#fileList {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 15px;
}

/* --- Card setiap file --- */
.file-card {
    flex: 1 1 200px;
    max-width: 250px; /* batasi lebar box */
    min-width: 180px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 15px;
    text-align: center;
    position: relative;
    transition: transform 0.2s ease-in-out;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between; /* file-info & tombol delete */
    gap: 10px;
}

    .file-card:hover {
        transform: translateY(-4px);
    }

/* --- Icon file (DOC, PDF, PNG, dll) --- */
.file-icon {
    width: 60px;
    height: 60px;
    margin: auto;
    background: #007bff;
    color: white;
    font-weight: bold;
    line-height: 60px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.file-thumb {
    width: 50px; /* batasi lebar */
    height: 50px; /* batasi tinggi */
    object-fit: cover; /* biar gambar tetap proporsional */
    border-radius: 6px;
    flex-shrink: 0;
}

/* --- Nama file --- */
.file-name {
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
    word-wrap: break-word;
    color: #333;
}

/* --- Ukuran file --- */
.file-size {
    font-size: 12px;
    color: gray;
    margin-top: 5px;
}

.file-info {
    flex: 1; /* biar ikut lebar card */
    min-width: 0; /* penting untuk ellipsis di flexbox */
    overflow: hidden; /* sembunyikan teks yang kepanjangan */
    text-overflow: ellipsis; /* tambahin "..." di akhir */
    white-space: nowrap; /* jangan pindah ke baris baru */
}

/* --- Tombol hapus (X) --- */
.file-remove {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: background 0.2s;
}

    .file-remove:hover {
        background: #e74c3c;
        color: #fff;
        border-color: #e74c3c;
    }

/* --- Total size text --- */
#totalSize {
    margin-top: 10px;
    font-weight: bold;
    color: #007bff;
    text-align: right;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #fileList {
        justify-content: center;
    }

    .file-card {
        max-width: 100%;
    }
}
