/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #121212;
    color: #e0e0e0;
    line-height: 1.6;
    font-size: 12px;   /* ukuran default diperkecil */
}


.container {
    width: 100%;        /* penuh */
    max-width: none;    /* hilangkan batas */
    margin: 0;          /* hapus auto center */
    padding: 20px;      /* boleh kecilkan jadi 10px kalau mau rapat */
}


/* Login Page */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.login-container {
    background-color: #1e1e1e;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #bb86fc;
}

.login-form {
    display: flex;
    flex-direction: column;
}

.input-group {
    margin-bottom: 15px;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 4px;
    background-color: #2d2d2d;
    color: #e0e0e0;
    font-size: 16px;
}

.input-group input:focus {
    outline: none;
    border-color: #bb86fc;
}

.login-btn {
    padding: 12px;
    background-color: #bb86fc;
    color: #121212;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-btn:hover {
    background-color: #9b6ce0;
}

/* Toolbar */
.toolbar {
    display: flex;
    flex-wrap: wrap;        /* tombol turun kalau sempit */
    gap: 10px;
    justify-content: flex-start;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-refresh {
    background-color: #03dac6;
    color: #000;
}

.btn-refresh:hover {
    background-color: #018786;
}

.btn-download {
    background-color: #018786;
    color: #fff;
}

.btn-download:hover {
    background-color: #016b6b;
}

.btn-delete {
    background-color: #cf6679;
    color: #fff;
}

.btn-delete:hover {
    background-color: #b00020;
}

.btn-logout {
    background-color: #cf6679;
    color: #fff;
}

.btn-logout:hover {
    background-color: #b00020;
}

.btn-password {
    background-color: #bb86fc;
    color: #000;
}

.btn-password:hover {
    background-color: #9b6ce0;
}

.btn-create {
    background-color: #03dac6;
    color: #000;
}

.btn-create:hover {
    background-color: #018786;
}

.btn-cancel {
    background-color: #cf6679;
    color: #fff;
}

.btn-cancel:hover {
    background-color: #b00020;
}

.btn-preview {
    background-color: #6200ee;
    color: #fff;
}

.btn-preview:hover {
    background-color: #3700b3;
}

.btn-close {
    background-color: #cf6679;
    color: #fff;
}

.btn-close:hover {
    background-color: #b00020;
}

/* Messages */
.message {
    padding: 10px;
    background-color: #03dac6;
    color: #000;
    border-radius: 4px;
    margin-bottom: 20px;
}

.error-message {
    padding: 10px;
    background-color: #cf6679;
    color: #fff;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Tables */
.files-table, .users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.files-table th, .files-table td,
.users-table th, .users-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #333;
}

.files-table th, .users-table th {
    background-color: #1e1e1e;
    color: #bb86fc;
}

.files-table tr:hover, .users-table tr:hover {
    background-color: #2d2d2d;
}

/* File links */
.file-link {
    color: #bb86fc;
    text-decoration: none;
}

.file-link:hover {
    text-decoration: underline;
}

/* Admin sections */
.admin-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #1e1e1e;
    border-radius: 8px;
}

.user-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.user-form input {
    padding: 10px;
    border: 1px solid #333;
    border-radius: 4px;
    background-color: #2d2d2d;
    color: #e0e0e0;
}

/* Password form */
.password-form {
    margin-top: 30px;
    padding: 20px;
    background-color: #1e1e1e;
    border-radius: 8px;
}

.password-form .input-group {
    margin-bottom: 15px;
}

/* Preview page */
.preview-container {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.preview-toolbar {
    display: flex;
    gap: 10px;
}

.preview-content {
    background-color: #1e1e1e;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    max-height: 70vh;
    overflow: auto;
}

.preview-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #e0e0e0;
}

.preview-footer {
    text-align: center;
    padding: 10px;
    background-color: #1e1e1e;
    border-radius: 4px;
}

.btn-delete {
background-color: #cf6679;
color: #fff;
}

.btn-delete:hover {
    background-color: #b00020;
}

/* Tombol menu */
.btn {
    min-width: 90px;     /* minimal 90px */
    padding: 8px 16px;   /* biar isi fleksibel */
    text-align: center;
}

/* Modal Universal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; 
    top: 0;
    width: 100%; 
    height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: #1e1e1e;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    animation: scaleIn 0.25s ease;
}

.modal-content h2 {
    color: #bb86fc;
    margin-bottom: 15px;
    font-size: 20px;
}

.modal-content p {
    margin-bottom: 20px;
    font-size: 14px;
    color: #e0e0e0;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Animasi modal */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
/* ================================
   MODAL UNIVERSAL & MODAL PASSWORD
   ================================ */
.modal,
.modal-form {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content,
.modal-form-content {
    background: #1e1e1e;
    padding: 20px;
    border-radius: 10px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    animation: scaleIn 0.25s ease;
}

.modal-content h2,
.modal-form-content h2 {
    color: #bb86fc;
    margin-bottom: 15px;
    font-size: 20px;
}

.modal-content p {
    margin-bottom: 20px;
    font-size: 14px;
    color: #e0e0e0;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Animasi muncul modal */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Potong nama file panjang di tabel */
.files-table td.file-name {
    max-width: 200px;          /* batas lebar kolom */
    white-space: nowrap;       /* teks tidak turun */
    overflow: hidden;          /* sembunyikan kelebihan */
    text-overflow: ellipsis;   /* tampilkan ... */
}

.files-table td.file-name a {
    display: block;            /* agar ellipsis berfungsi */
    color: #bb86fc;            /* sesuai tema */
    text-decoration: none;
}
.files-table td.file-name a:hover {
    text-decoration: underline;
}
/* Potong nama file panjang di header preview */
.preview-header h2, 
.preview-header .file-title {
    max-width: 80%;        /* batasi lebar area teks */
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
/* Header utama */
.container h1 {
    text-align: left;   /* rata kiri */
    margin-bottom: 20px;
}


.files-table {
    width: 100%;
    min-width: 600px;       /* jangan hancur saat zoom */
}

/* Tabel full tapi fixed layout */
.files-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;   /* penting: kolom bagi rata */
}

/* Kolom Nama File dengan ellipsis */
.files-table td.file-name,
.files-table th:nth-child(2) {
    width: 40%;                /* beri porsi lebih ke nama */
    max-width: 1px;            /* trik supaya ellipsis aktif */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Kolom lain juga ellipsis biar rapi */
.files-table th,
.files-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* styles.css */
.login-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: flex-start; /* dorong ke atas */
    justify-content: center;
    background-color: #111; /* contoh warna */
}

.login-container {
    margin-top: 10vh;  /* naikkan posisi, bisa disesuaikan */
    background: #1e1e1e;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
    width: 100%;
    max-width: 360px;
    text-align: center;
}
@media (max-height: 600px) {
    .login-container {
        margin-top: 5vh; /* lebih naik lagi saat layar kecil */
    }
}
/* Susun ulang header preview di layar kecil */
@media (max-width: 600px) {
    .preview-header {
        flex-direction: column;      /* susun ke atas-bawah */
        align-items: flex-start;     /* judul rata kiri */
        gap: 10px;                   /* jarak antar elemen */
    }

    .preview-header h2,
    .preview-header .file-title {
        max-width: 100%;             /* biar full lebar */
        white-space: normal;         /* biar bisa turun baris */
        text-align: left;
    }

    .preview-toolbar {
        width: 100%;
        display: flex;
        justify-content: flex-start; /* tombol tetap rata kiri */
        flex-wrap: wrap;             /* turun kalau sempit */
        gap: 10px;
    }
}
/* Input di dalam modal admin */
.modal-form-content .input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 4px;
    background-color: #2d2d2d;
    color: #e0e0e0;
    font-size: 14px;
}

.modal-form-content .input-group input:focus {
    outline: none;
    border-color: #bb86fc;
}
/* Input di dalam modal admin */
.modal-form-content .input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 4px;
    background-color: #2d2d2d;
    color: #e0e0e0;
    font-size: 14px;
    margin-bottom: 12px;
}

.modal-form-content .input-group input:focus {
    outline: none;
    border-color: #bb86fc;
}
/* Tombol hapus di modal pakai hijau kebiruan */
.btn-delete-modal {
    background-color: #03dac6; /* hijau toska */
    color: #000;
}
.btn-delete-modal:hover {
    background-color: #018786;
}
/* Modal notifikasi */
#notifModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    justify-content: center;
    align-items: center;
}

#notifModal .modal-content {
    background: #1e1e1e;
    color: #fff;
    padding: 20px 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 0 15px rgba(0,0,0,0.6);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
/* Rapiin isi modal form & notif */
.modal-form-content {
    padding: 25px 30px;      /* lebih lega */
    border-radius: 12px;
    text-align: center;
}

.modal-form-content h2 {
    margin-bottom: 20px;     /* jarak judul */
}

.modal-form-content p {
    margin-bottom: 25px;     /* jarak teks isi */
    line-height: 1.5;
}

.modal-form-content .input-group {
    margin-bottom: 15px;     /* jarak antar input */
}

.modal-buttons {
    margin-top: 15px;        /* jarak ke tombol */
    gap: 12px;               /* spasi antar tombol */
}

/* khusus modal notifikasi */
#notifModal .modal-form-content {
    max-width: 350px;
}

#notifModal h2 {
    margin-bottom: 15px;
}

#notifModal p {
    font-size: 14px;
    margin-bottom: 20px;
}
