/* Upload Panel Styles */

/* Drag & Drop Zone */
.upload-drop-zone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    margin: 0 25px;
    box-sizing: border-box;
}

.upload-drop-zone:hover,
.upload-drop-zone.drag-over {
    border-color: #007bff;
    background-color: #f0f8ff;
}

.upload-drop-zone .fa-file-csv {
    font-size: 48px;
    color: #007bff;
    margin-bottom: 10px;
}

.upload-drop-zone p {
    margin: 0;
    color: #555;
    font-size: 0.95em;
}

/* File List Container */
.file-list-container {
    margin: 0 25px 20px;
    padding: 0;
}

.file-list-container h4 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #333;
}

.file-list-scroll {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 15px;
    background: white;
    box-sizing: border-box;
}

.file-list-scroll::-webkit-scrollbar {
    width: 6px;
}

.file-list-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.file-list-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.file-list-scroll::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* Individual File Item */
.upload-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.9em;
}

.upload-file-item:last-child {
    margin-bottom: 0;
}

.upload-file-item .filename {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
    font-weight: 500;
    color: #333;
}

.upload-file-item .btn-remove {
    background: none;
    border: none;
    font-size: 18px;
    color: #dc3545;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Button Wrapper - Center the Upload All Button */
.button-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 15px;
}

#uploadAllBtn {
    width: auto;
    min-width: 140px;
    padding: 0.42em 0.9em;
    font-size: 0.85em;
}

/* =============================
   BUTTON STYLES - ASTRAL DESIGN (40% Smaller)
   ============================= */

.button,
#uploadAllBtn,
#closeSuccess,
#retryUpload,
#closeError,
#confirmDelete,
#cancelDelete {
    -moz-transition: background-color 0.25s ease-in-out;
    -webkit-transition: background-color 0.25s ease-in-out;
    -ms-transition: background-color 0.25s ease-in-out;
    transition: background-color 0.25s ease-in-out;
    -webkit-appearance: none;
    display: inline-block;
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #ddd;
    cursor: pointer;
    outline: 0;
    padding: 0.42em 0.9em;
    font-size: 0.85em;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Hover: Blue (astral theme) */
.button:hover,
#uploadAllBtn:hover,
#closeSuccess:hover,
#retryUpload:hover,
#closeError:hover,
#confirmDelete:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* Focus (accessibility) */
.button:focus,
#uploadAllBtn:focus,
#confirmDelete:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

/* Special: Confirm Delete (Red) */
#confirmDelete {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

#confirmDelete:hover {
    background-color: #c82333;
    border-color: #c82333;
}

/* Cancel (Grey) */
#cancelDelete {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
}

#cancelDelete:hover {
    background-color: #5a6268;
    border-color: #5a6268;
}

/* ================================
   FILE LIST - DOWNLOAD & DELETE BUTTONS
   (Keep small, colorful, circular)
   ================================ */

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 0.95em;
    transition: background 0.2s ease;
}

.file-item:hover {
    background: #f0f8ff;
    border-color: #007bff;
}

.file-item-left {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.file-item-left .file-title {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-right {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    color: #666;
    font-size: 0.9em;
}

.file-item-right .file-date {
    margin-right: 5px;
    color: #777;
}

.file-item-right button {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.file-item-right .download-btn i {
    color: #007bff;
}

.file-item-right .download-btn:hover i {
    transform: scale(1.2);
    color: #0056b3;
}

.file-item-right .delete-btn i {
    color: #dc3545;
}

.file-item-right .delete-btn:hover i {
    transform: scale(1.2);
    color: #c82333;
}

/* =============================
   UPLOAD STATES (Success, Error)
   ============================= */

.upload-state {
    text-align: center;
    padding: 30px 0;
}

.upload-state i {
    font-size: 32px;
}

.upload-state.loading i {
    color: #007bff;
}

.upload-state.success i {
    color: #28a745;
}

.upload-state.error i {
    color: #dc3545;
}

.upload-state p {
    margin: 10px 0;
    font-size: 1.1em;
}

/* Error Actions */
.error-actions {
    margin-top: 15px;
}

.error-actions .button {
    margin: 0 5px;
}

/* Delete Confirmation Modal */
.modal-delete {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-delete-content {
    background: white;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.modal-delete-content .button-danger {
    background: #dc3545;
    color: white;
    margin: 0 5px;
    min-width: 100px;
}

.modal-delete-content .button-secondary {
    background: #6c757d;
    color: white;
    margin: 0 5px;
    min-width: 100px;
}

/* Enhanced Floating Modal */
#uploadModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

#uploadModal .modal-content {
    background: white;
    width: 90%;
    max-width: 520px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
    padding: 25px;
    box-sizing: border-box;
}

#uploadModal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

#uploadModal.show {
    display: flex;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5em;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #777;
    transform: scale(1.1);
}

/* Year Group Header */
.year-header {
    padding: 10px 15px;
    background: white;
    color: #333;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 8px;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 6px;
}

/* Responsive Adjustments */
@media (max-width: 736px) {
    .upload-drop-zone {
        padding: 30px 15px;
    }
    .upload-drop-zone .fa-file-csv {
        font-size: 40px;
    }
    .upload-drop-zone p {
        font-size: 0.9em;
    }
    .file-list-scroll {
        max-height: 180px;
    }
}
