/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 20px;
    background: #2c3e50;
    color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    font-weight: 600;
}

header p {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

/* Sección de navegación */
.navigation-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e1e5e9;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.breadcrumb-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.breadcrumb-btn:hover {
    background: #2980b9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#currentPath {
    color: #495057;
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

/* Sección de búsqueda */
.search-section {
    margin-top: 15px;
}

.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#searchInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#searchBtn {
    padding: 15px 25px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    font-weight: 500;
}

#searchBtn:hover {
    background: #229954;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.search-filters select {
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* Información de descarga */
.download-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e1e5e9;
}

.download-counter {
    font-weight: 600;
    color: #2c3e50;
}

#downloadsLeft {
    color: #27ae60;
    font-size: 1.2rem;
}

.user-info {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Resultados */
.results-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e1e5e9;
    min-height: 400px;
}

.loading {
    text-align: center;
    padding: 50px;
    color: #3498db;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 15px;
    display: block;
}

.no-results {
    text-align: center;
    padding: 50px;
    color: #7f8c8d;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
    opacity: 0.5;
}

.results-container {
    display: grid;
    gap: 15px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-bottom: 8px;
    background: #fafafa;
}

.file-item:hover {
    border-color: #3498db;
    background: #f0f8ff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.folder-item {
    cursor: pointer;
}

.folder-item:hover {
    border-color: #f39c12;
    background-color: #fff8e1;
}

.file-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    font-size: 1.5rem;
    color: white;
}

.file-icon.pdf { background: #e74c3c; }
.file-icon.doc { background: #3498db; }
.file-icon.xls { background: #27ae60; }
.file-icon.jpg, .file-icon.png { background: #f39c12; }
.file-icon.zip { background: #9b59b6; }
.file-icon.txt { background: #95a5a6; }
.file-icon.default { background: #34495e; }
.file-icon.folder { background: #f39c12; }

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #2c3e50;
}

.file-details {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.file-actions {
    display: flex;
    gap: 10px;
}

.download-btn {
    padding: 8px 16px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.download-btn:hover {
    background: #229954;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.download-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e1e5e9;
}

.modal-header h3 {
    color: #2c3e50;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 25px;
}

.file-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.modal-footer {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding: 20px 25px;
    border-top: 1px solid #e1e5e9;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #27ae60;
    color: white;
}

.btn-primary:hover {
    background: #229954;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Mensaje de error */
.error-message {
    background: #e74c3c;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Utilidades */
.hidden {
    display: none !important;
}

/* Estilos adicionales para compatibilidad */
.container {
    background: #f5f5f5;
    min-height: 100vh;
}

/* Mejorar la apariencia de los inputs */
#searchInput {
    border: 1px solid #ddd;
    background: white;
}

#searchInput:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.search-filters select {
    border: 1px solid #ddd;
    background: white;
}

/* Mejorar el modal */
.modal-content {
    border: 1px solid #ddd;
}

/* Modal especial de seguridad */
.security-modal {
    max-width: 600px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.security-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    text-align: center;
    padding: 25px;
    border-radius: 8px 8px 0 0;
}

.security-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #3498db;
}

.security-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.security-body {
    padding: 30px;
    background: #f8f9fa;
}

/* Preview del archivo */
.file-preview {
    display: flex;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.file-icon-large {
    width: 80px;
    height: 80px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    font-size: 2.5rem;
    color: white;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.file-details h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.file-details p {
    margin: 0;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Proceso de seguridad */
.security-process {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 25px;
}

.timer-container {
    flex-shrink: 0;
}

.timer-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: pulse 2s infinite;
}

.timer-text {
    text-align: center;
    color: white;
}

.timer-text span {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}

.timer-text small {
    font-size: 0.8rem;
    opacity: 0.9;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Mensajes de seguridad */
.security-messages {
    flex: 1;
}

.current-message {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    margin-bottom: 15px;
    font-weight: 600;
    color: #2c3e50;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.message-list {
    max-height: 120px;
    overflow-y: auto;
}

.message-item {
    background: #ecf0f1;
    padding: 8px 15px;
    margin-bottom: 5px;
    border-radius: 5px;
    font-size: 0.9rem;
    color: #7f8c8d;
    border-left: 3px solid #bdc3c7;
    transition: all 0.3s ease;
}

.message-item.active {
    background: #d5f4e6;
    color: #27ae60;
    border-left-color: #27ae60;
}

.message-item.completed {
    background: #e8f4fd;
    color: #3498db;
    border-left-color: #3498db;
}

/* Barra de progreso */
.progress-container {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background-color: #ecf0f1;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 6px;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 600;
}

/* Nota de seguridad */
.security-note {
    background: linear-gradient(135deg, #e8f4fd 0%, #d1ecf1 100%);
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 15px;
    color: #0c5460;
    font-size: 0.9rem;
    text-align: center;
}

.security-note i {
    color: #17a2b8;
    margin-right: 8px;
    font-size: 1.1rem;
}

/* Responsive para el modal de seguridad */
@media (max-width: 768px) {
    .security-process {
        flex-direction: column;
        text-align: center;
    }
    
    .timer-circle {
        width: 100px;
        height: 100px;
    }
    
    .timer-text span {
        font-size: 1.5rem;
    }
    
    .file-preview {
        flex-direction: column;
        text-align: center;
    }
    
    .file-icon-large {
        margin-right: 0;
        margin-bottom: 15px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .download-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .file-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .file-icon {
        margin-right: 0;
    }
    
    .modal-content {
        width: 95%;
    }
}
