/* style.css */
:root {
    --primary-color: #2563eb; /* Biru utama */
    --danger-color: #ef4444;  /* Merah hapus */
    --success-color: #10b981; /* Hijau sukses */
    --bg-color: #f3f4f6;      /* Abu-abu latar */
    --card-bg: #ffffff;       /* Putih kartu */
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --radius: 12px;           /* Lengkungan sudut */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    padding-bottom: 80px; 
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--bg-color);
    min-height: 100vh;
}

/* --- Header --- */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.refresh-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
}

/* --- Action & Filtering Section --- */
.action-section {
    margin: 16px;
    padding: 16px;
    background-color: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.action-group {
    margin-bottom: 15px;
}
.action-group:last-child {
    margin-bottom: 0;
}

.label-title {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
}

select, .text-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-main);
    transition: border-color 0.2s;
}
select:focus, .text-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.text-input {
    flex-grow: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group {
    display: flex;
}

.btn-reset {
    background-color: #e5e7eb;
    color: var(--text-muted);
    border: 1px solid #d1d5db;
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    height: 40px; 
    width: 40px;
    font-size: 16px;
    border-radius: 8px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}


/* --- Upload Section --- */
.upload-section {
    background-color: var(--card-bg);
    margin: 16px;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-primary:hover:not(:disabled) {
    background-color: #1e40af;
}

.btn-primary:disabled {
    opacity: 0.6;
}

.status-msg {
    font-size: 12px;
    margin-top: 8px;
    display: none;
}
.status-msg.show { display: block; }
.status-msg.error { color: var(--danger-color); }
.status-msg.success { color: var(--primary-color); }

/* --- File List --- */
.file-list-container {
    padding: 0 16px;
}

.section-title {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
    margin-left: 4px;
}

.file-item {
    background-color: var(--card-bg);
    padding: 12px;
    margin-bottom: 10px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.1s;
}

.file-item:active {
    transform: scale(0.98);
}

.file-preview {
    width: 50px;
    height: 50px;
    background-color: #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    cursor: pointer;
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview i {
    font-size: 24px;
    color: var(--text-muted);
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.action-buttons {
    display: flex;
    gap: 8px;
    margin-left: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    background-color: #f3f4f6;
    transition: background 0.2s;
}

.btn-icon:hover {
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.btn-copy { color: var(--primary-color); }
.btn-copy:hover { background-color: #dbeafe; }

.btn-delete { color: var(--danger-color); }
.btn-delete:hover { background-color: #fee2e2; }

.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-size: 14px;
}

/* --- Modal Style (Umum) --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 200; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.6); 
    align-items: center;
    justify-content: center;
    padding: 16px; /* Padding untuk mobile */
}

.modal-content {
    background-color: var(--card-bg);
    margin: auto;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    width: 90%; 
    max-width: 350px;
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.modal-body {
    padding: 10px 0;
}

.modal-footer {
    padding-top: 15px;
    text-align: right;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-delete-modal {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

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

/* --- Modal Video BARU --- */
.video-modal-content {
    max-width: 90%; /* Lebih lebar untuk video */
    width: 100%;
    padding: 10px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-main);
    cursor: pointer;
    padding: 0;
}

.close-btn:hover {
    color: var(--danger-color);
}

.video-container {
    position: relative;
    width: 100%;
    /* Rasio aspek 16:9 - membuat video responsif */
    padding-bottom: 56.25%; /* (9/16) * 100% */
    height: 0;
    overflow: hidden;
    background-color: black;
}

#videoPlayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
/* Media Query untuk Desktop/Tablet */
@media (min-width: 600px) {
    .video-modal-content {
        max-width: 700px;
    }
}