/* Estilos para el frontend del Gestor de Archivos SUDEASEG */

/* Aplicar fuente Nunito a todos los elementos del plugin */
.gas-container,
.gas-container-public,
.gas-container *,
.gas-container-public *,
.gas-archivos-table,
.gas-archivos-table * {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.gas-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.gas-container-public {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.gas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.gas-header h2 {
    margin: 0;
    color: #333;
    font-size: 28px;
}

.gas-logout-btn {
    background: linear-gradient(135deg, #e2891d 0%, #E8A34D 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.gas-logout-btn .material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

.gas-logout-btn > span:not(.material-icons) {
    text-transform: capitalize;
}

.gas-logout-btn:hover {
    background: linear-gradient(135deg, #b56e17 0%, #e2891d 100%);
    color: white;
}

.gas-upload-section,
.gas-archivos-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.gas-upload-section h3,
.gas-archivos-section h3 {
    margin-top: 0;
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
}

/* Formulario */
.gas-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .gas-form-row {
        grid-template-columns: 1fr;
    }
}

.gas-form-group {
    margin-bottom: 20px;
}

.gas-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.gas-form-group input[type="text"],
.gas-form-group input[type="file"],
.gas-form-group select,
.gas-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.gas-form-group input:focus,
.gas-form-group select:focus,
.gas-form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.gas-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.gas-submit-btn {
    background: linear-gradient(135deg, #0ca6a1 0%, #10CFC9 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: capitalize;
}

.gas-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.gas-submit-btn:active {
    transform: translateY(0);
}

.gas-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 5px;
    display: none;
}

.gas-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.gas-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Tabla de archivos - Lista horizontal */
.gas-archivos-grid {
    margin-top: 20px;
    overflow-x: auto;
}

/* Filtros */
.gas-filters {
    background: white;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
}

.gas-filter-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.gas-filter-group {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
}

.gas-filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
    line-height: 1.4;
}

.gas-filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Nunito', sans-serif;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
    height: 42px;
    box-sizing: border-box;
}

.gas-filter-select:focus {
    outline: none;
    border-color: #667eea;
}

.gas-filter-group:last-child,
.gas-filter-group-button {
    flex: 0 0 auto;
    min-width: auto;
}

.gas-filter-group-button {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: flex-end;
    gap: 10px;
}

.gas-filter-group-button::before {
    content: '';
    display: block;
    height: calc(13px * 1.4 + 8px); /* font-size * line-height + margin-bottom */
    margin-bottom: 0;
}

.gas-btn-clear {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    white-space: nowrap;
    height: 42px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    cursor: pointer;
    text-transform: capitalize;
    transition: background 0.3s;
    margin-top: 0;
    margin-bottom: 21px;
}

.gas-btn-clear:hover {
    background: #5a6268;
}

/* Asegurar margin-bottom en ambas vistas */
.gas-container .gas-btn-clear,
.gas-container-public .gas-btn-clear {
    margin-bottom: 21px;
}

.gas-btn-export {
    background: #93D500;
    color: white;
    padding: 10px 20px;
    white-space: nowrap;
    height: 42px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s;
    margin-top: 0;
    margin-bottom: 21px;
    line-height: 1;
}

.gas-btn-export:hover {
    background: #699900;
    color: white;
    text-decoration: none;
}

.gas-btn-export .material-icons {
    font-size: 20px;
    margin-right: 6px;
    display: inline-block;
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

.gas-btn-export span:not(.material-icons) {
    display: inline-block;
}

@media (max-width: 768px) {
    .gas-filter-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .gas-filter-group {
        min-width: 100%;
    }
    
    .gas-filter-group:last-child {
        min-width: 100%;
    }
    
    .gas-btn-clear {
        width: 100%;
    }
}

.gas-archivos-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.gas-archivos-table thead {
    background: #f8f9fa;
}

.gas-archivos-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    font-size: 14px;
}

.gas-archivos-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.gas-archivos-table tbody tr:hover {
    background: #f8f9fa;
}

.gas-archivos-table tbody tr:last-child td {
    border-bottom: none;
}

/* Columnas específicas */
.gas-col-image {
    width: 80px;
    text-align: center;
}

.gas-col-nombre {
    min-width: 150px;
    max-width: 200px;
}

.gas-col-objetivo,
.gas-col-medio {
    min-width: 120px;
}

.gas-col-fecha {
    width: 100px;
}

.gas-col-usuario {
    min-width: 100px;
}

.gas-col-actions {
    width: auto;
    white-space: nowrap;
}

/* Thumbnail */
.gas-thumbnail {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 4px;
    background: #f5f5f5;
    cursor: pointer;
    border: 1px solid #e0e0e0;
}

.gas-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gas-thumbnail:hover img {
    transform: scale(1.1);
}

/* Información del archivo */
.gas-col-nombre strong {
    display: block;
    color: #333;
    font-size: 14px;
    margin-bottom: 4px;
}

.gas-col-nombre small {
    color: #666;
    font-size: 12px;
    display: block;
}

.gas-col-objetivo,
.gas-col-medio,
.gas-col-fecha,
.gas-col-usuario {
    color: #555;
    font-size: 13px;
}

/* Acciones */
.gas-archivo-actions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.gas-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    white-space: nowrap;
    text-transform: capitalize;
}

.gas-btn-view {
    background: #10CFC9;
    color: white;
}

.gas-btn-view:hover {
    background: #0dbab5;
}

.gas-btn-download {
    background: #93D500;
    color: white;
}

.gas-btn-download:hover {
    background: #699900;
    color: white;
}

.gas-btn-delete {
    background: #dc3545;
    color: white;
}

.gas-btn-delete:hover {
    background: #c82333;
}

.gas-no-archivos {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 16px;
}

@media (max-width: 768px) {
    .gas-archivos-table {
        font-size: 12px;
    }
    
    .gas-archivos-table th,
    .gas-archivos-table td {
        padding: 8px 10px;
    }
    
    .gas-thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .gas-btn {
        padding: 5px 8px;
        font-size: 11px;
    }
}

/* Modal para ver imagen */
.gas-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    overflow: auto;
}

.gas-modal-content {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 900px;
    margin-top: 50px;
    animation: zoom 0.6s;
}

@keyframes zoom {
    from {transform: scale(0)}
    to {transform: scale(1)}
}

.gas-modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.gas-modal-close:hover,
.gas-modal-close:focus {
    color: #bbb;
    text-decoration: none;
}

.gas-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
