/* Estilos específicos para el S3 Manager adaptados al estilo global */

.mt-4 { margin-top: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }

/* Header y logout */
.header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 2px solid #000;
    gap: 1rem;
}

.header-text {
    text-align: left;
}

.header-text h1 {
    margin: 0;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-text p {
    margin: 0;
    font-size: 0.9rem;
}

.header-logo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.header .logo {
    max-height: 100px;
    width: auto;
}

.header-actions {
    display: flex;
    justify-content: flex-end;
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #fff;
    color: #000;
    border: 1px solid #000;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.logout-btn i {
    font-size: 0.9rem;
}

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

/* Tabs */
.tabs-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #000;
}

.tab-btn {
    padding: 12px 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: inherit;
    transition: all 0.3s ease;
    border-radius: 4px 4px 0 0;
}

.tab-btn:hover {
    background: #f5f5f5;
}

.tab-btn.active {
    background: #000;
    color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Toolbar adaptada */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 1.5rem 0;
    border-bottom: 1px solid #000;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex-grow: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #000;
}

.search-box input {
    width: 100%;
    padding: 10px 10px 10px 35px;
    border: 1px solid #000;
    border-radius: 0;
    font-family: inherit;
}

.view-options .btn-icon {
    background: #fff;
    border: 1px solid #000;
    padding: 8px 12px;
    cursor: pointer;
    color: #000;
    transition: all 0.2s;
}

.view-options .btn-icon.active {
    background: #000;
    color: #fff;
}

.toolbar .actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* File Explorer */
.file-explorer {
    min-height: 400px;
    padding: 2rem 0;
}

/* Grid View */
.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
}

.file-card {
    border: 1px solid #000;
    border-radius: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    background: #fff;
    height: 230px;
    display: flex;
    flex-direction: column;
}

.file-card:hover {
    box-shadow: 10px 10px 0px #000;
    transform: translate(-5px, -5px);
}

.file-card.selected {
    background: #f5f5f5;
    border-width: 2px;
}

.file-card .preview {
    height: 140px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.file-card .preview img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.file-card .info {
    padding: 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

.file-card .name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-card .meta {
    font-size: 0.75rem;
    color: #666;
    display: flex;
    justify-content: space-between;
}

.file-card .actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: none;
    flex-direction: column;
    gap: 5px;
}

.file-card:hover .actions {
    display: flex;
}

.btn-mini {
    padding: 6px;
    font-size: 0.8rem;
    background: #000;
    color: #fff;
    border: 1px solid #000;
    cursor: pointer;
}

.btn-mini:hover {
    background: #fff;
    color: #000;
}

.btn-mini.btn-danger:hover {
    background: #ff0000;
    color: #fff;
}

/* Selection Checkbox */
.select-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    width: 20px;
    height: 20px;
    border: 2px solid #000;
    cursor: pointer;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem;
    color: #000;
    border: 1px dashed #000;
}

.empty-state i { margin-bottom: 1.5rem; }

/* Breadcrumb / ruta de carpetas */
.path-breadcrumb {
    font-size: 0.95rem;
    text-transform: none;
    letter-spacing: 0;
    padding: 0.25rem 0;
    border-bottom: 1px dashed #ccc;
}

.path-breadcrumb .crumb {
    cursor: pointer;
    text-decoration: underline;
}

.path-breadcrumb .crumb-root {
    font-weight: 600;
}

.path-breadcrumb .crumb-separator {
    margin: 0 6px;
}

/* Carpetas en grid y lista */
.file-card.folder-card .preview {
    background: #f5f5f5;
}

.file-card.folder-card i {
    color: #000;
}

.files-table tbody tr.folder-row {
    background: #fafafa;
    cursor: pointer;
}

.files-table tbody tr.folder-row:hover {
    background: #f0f0f0;
}

/* Responsive: ajustar altura de cards en pantallas pequeñas */
@media (max-width: 768px) {
    .grid-view {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1.5rem;
    }

    .file-card {
        height: 200px;
    }

    .file-card .preview {
        height: 120px;
    }
}

/* List View - Tabla */
.list-view {
    display: block;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #000;
    background: #fff;
}

.files-table thead {
    background: #000;
    color: #fff;
}

.files-table th {
    padding: 12px 15px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85em;
    font-weight: 500;
    border-bottom: 2px solid #000;
}

.files-table th:first-child {
    width: 40px;
    text-align: center;
}

.files-table th:nth-child(2) {
    width: 60px;
    text-align: center;
}

.files-table th:nth-child(3) {
    min-width: 200px;
}

.files-table th:nth-child(4) {
    min-width: 300px;
}

.files-table th:nth-child(5) {
    width: 100px;
}

.files-table th:last-child {
    width: 120px;
    text-align: center;
}

.files-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.files-table tbody tr:hover {
    background: #f5f5f5;
}

.files-table tbody tr.selected {
    background: #f0f0f0;
}

.files-table td {
    padding: 12px 15px;
    vertical-align: middle;
}

.files-table td:first-child {
    text-align: center;
}

.files-table td:last-child {
    text-align: center;
}

.table-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #000;
    cursor: pointer;
}

.table-icon {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border: 1px solid #eee;
    background: #f9f9f9;
    display: block;
}

.table-icon-placeholder {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eee;
    background: #f9f9f9;
    color: #666;
}

.table-url {
    font-size: 0.85em;
    word-break: break-all;
}

.table-url a {
    color: #000;
    text-decoration: underline;
}

.table-url a:hover {
    color: #666;
}

.table-filetype {
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

.table-filename {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9em;
}

.table-actions {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.table-actions .btn-mini {
    padding: 6px 10px;
}

/* Mensajes de notificación */
.message-container {
    margin-top: 20px;
    margin-bottom: 20px;
}

.message {
    padding: 15px 20px;
    border: 2px solid #000;
    background: #fff;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideDown 0.3s ease;
}

.message.error {
    background: #fff;
    border-color: #000;
}

.message.success {
    background: #f5f5f5;
    border-color: #000;
}

.message.warning {
    background: #fff3cd;
    border-color: #ffc107;
}

.message i {
    font-size: 1.2em;
    flex-shrink: 0;
}

.message.error i {
    color: #b00000;
}

.message.success i {
    color: #006600;
}

.message.warning i {
    color: #856404;
}

.message-content {
    flex: 1;
    line-height: 1.5;
}

.message-title {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.message-text {
    font-size: 0.9em;
    line-height: 1.4;
}

.message-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
}

.message-close:hover {
    background: #f5f5f5;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal de configuración de subida */
.upload-config-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.upload-config-content {
    background: #fff;
    border: 2px solid #000;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 10px 10px 0px #000;
}

.upload-config-header {
    padding: 1.5rem;
    border-bottom: 2px solid #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #000;
    color: #fff;
}

.upload-config-header h2 {
    margin: 0;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-close-modal {
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-close-modal:hover {
    background: #fff;
    color: #000;
}

.upload-config-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.upload-preview-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    background: #f5f5f5;
    border: 1px solid #000;
    padding: 1rem;
}

.upload-preview {
    max-width: 100%;
    max-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-preview img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.upload-preview i {
    font-size: 4rem;
    color: #666;
}

.upload-form-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.form-input,
.form-select {
    padding: 10px;
    border: 1px solid #000;
    font-family: inherit;
    font-size: 0.9rem;
    width: 100%;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-width: 2px;
}

.form-help {
    font-size: 0.8rem;
    color: #666;
}

.folder-selector {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.folder-selector .form-select {
    flex: 1;
}

.btn-small {
    padding: 10px 15px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.upload-file-details {
    border-top: 1px solid #eee;
    padding-top: 1rem;
    margin-top: 0.5rem;
}

.upload-file-details h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-weight: 500;
    font-size: 0.9rem;
}

.upload-config-footer {
    padding: 1.5rem;
    border-top: 2px solid #000;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: #f5f5f5;
}

.btn-primary {
    background: #000;
    color: #fff;
    border: 1px solid #000;
    padding: 10px 20px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #fff;
    color: #000;
}

.btn-secondary {
    background: #fff;
    color: #000;
    border: 1px solid #000;
    padding: 10px 20px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #000;
    color: #fff;
}

/* Modal overlay existente */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal {
    background: #fff;
    border: 2px solid #000;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 10px 10px 0px #000;
}

.modal-actions {
    padding: 1.5rem;
    border-top: 2px solid #000;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}
