/* /public/css/files.css */

* {
    box-sizing: border-box;
}

.admin-container {
    padding: 2rem 1rem;
    padding-top: 0;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}

/* Table Styling */
/* .files-table uses global .data-table styles */

.col-icon {
    width: 48px;
    text-align: center;
    font-size: 1.5rem;
}

.col-filename strong {
    color: #fff;
    display: block;
    margin-bottom: 0.25rem;
}

.file-desc {
    color: #94a3b8;
    font-size: 0.8rem;
}

.col-uploader, .col-date, .col-size {
    color: #94a3b8;
    font-size: 0.875rem;
}

.col-size {
    font-family: monospace;
}

.col-downloads {
    color: #10b981;
    font-weight: 600;
    text-align: center;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-admin { color: #ef4444; }
.badge-restricted { color: #f59e0b; }
.badge-public { color: #10b981; }

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
}

.btn-primary:hover { background: #2563eb; }

/* Edit Form Styles (from users.css) */
.edit-container {
    padding: 2rem 1rem;
    padding-top: 0;
    max-width: 600px;
    margin: 0 auto;
}

.edit-form {
    background: #1e293b;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid #334155;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    color: #e2e8f0;
    font-size: 1rem;
    font-family: inherit;
}

.file-drop-zone {
    border: 2px dashed #334155;
    border-radius: 0.75rem;
    padding: 2rem 1rem;
    text-align: center;
    background: #0f172a;
    cursor: pointer;
    position: relative;
}

.file-drop-zone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.drop-text { color: #94a3b8; }
.file-name { color: #3b82f6; font-weight: 600; margin-top: 0.5rem; }

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #e2e8f0;
    font-weight: 600;
}

.checkbox-group {
    margin-bottom: 1.5rem;
}

.checkbox-group input { width: 1.2rem; height: 1.2rem; }

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-save { background: #10b981; color: white; flex: 1; padding: 0.75rem; border-radius: 0.5rem; font-weight: 600; text-align: center; text-decoration: none; border: none; cursor: pointer; }
.btn-cancel { background: #334155; color: #e2e8f0; flex: 1; padding: 0.75rem; border-radius: 0.5rem; font-weight: 600; text-align: center; text-decoration: none; }

.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    color: #10b981;
}

/* Mobile */
@media (max-width: 768px) {
    .admin-container h1 { font-size: 1.5rem; }
    .manage-header { flex-direction: column; gap: 1rem; }
    .files-table thead { display: none; }
    .files-table, .files-table tbody { display: block; background: transparent; box-shadow: none; }
    .files-table tr {
        display: block; background: #1e293b; border-radius: 0.75rem; padding: 1rem; margin-bottom: 0.75rem; border: 1px solid #334155; position: relative; padding-left: 4.5rem;
    }
    .files-table td { display: block; padding: 0.25rem 0; border: none; width: 100% !important; text-align: left !important; }
    .files-table td::before {
        content: attr(data-label); font-weight: 600; color: #94a3b8; text-transform: uppercase; font-size: 0.7rem; margin-right: 0.5rem; min-width: 80px; display: inline-block;
    }
    .col-icon { position: absolute; left: 0.75rem; top: 1.5rem; width: 3rem !important; display: flex; justify-content: center; font-size: 2rem; }
    .col-icon::before { content: none !important; }
    .action-buttons { 
        display: flex; 
        justify-content: center; 
        gap: 0.5rem; 
        margin-top: 0.5rem; 
        padding-top: 0.75rem; 
        border-top: 1px solid #334155;
        margin-left: -3.5rem; /* Counteract parent padding to center globally */
    }

    /* Fix Permission Checkboxes in Mobile Cards */
    .recipient-checkbox {
        justify-content: center !important;
    }

    .recipient-checkbox::before {
        content: none !important; /* Remove the "ALLOWED USERS" label from every single checkbox */
    }

    .recipient-checkbox span {
        text-transform: none !important; /* Force lowercase/original casing */
    }

    .edit-container { padding: 1rem 0; }
    .form-actions { flex-direction: column; }
}
