/* ===================================
   CFR VALIDATOR - ADUANALIBRE.COM
   Sistema de Compliance para Zonas Francas
   =================================== */

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* ========== HEADER Y NAVEGACIÓN ========== */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.lang-dropdown {
    background: white;
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.lang-dropdown:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
}

/* Estado de conexión en la nube */
.cloud-status {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(255,255,255,0.95);
    padding: 12px 20px;
    border-radius: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-left: 4px solid #28a745;
    font-size: 0.9rem;
    max-width: 300px;
    z-index: 999;
    transform: translateX(350px);
    transition: transform 0.3s ease;
}

.cloud-status.show {
    transform: translateX(0);
}

.cloud-status .status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Información del usuario */
.user-info {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255,255,255,0.9);
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #666;
    z-index: 1000;
}

/* ========== CONTENEDOR PRINCIPAL ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.logo {
    margin-bottom: 10px;
}

.logo img {
    height: 60px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

.main-content {
    background: white;
    border-radius: 0 0 20px 20px;
    padding: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    min-height: 600px;
}

/* ========== INDICADOR DE PASOS ========== */
.step-indicator {
    display: flex;
    justify-content: space-between;
    padding: 30px 50px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #dee2e6;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: linear-gradient(45deg, #3498db, #9b59b6);
    color: white;
}

.step.completed .step-number {
    background: #28a745;
    color: white;
}

.step-line {
    position: absolute;
    top: 20px;
    left: 60%;
    width: 80%;
    height: 2px;
    background: #dee2e6;
    z-index: -1;
}

.step:last-child .step-line {
    display: none;
}

/* ========== FORMULARIOS ========== */
.content-area {
    padding: 40px;
}

.form-section {
    display: none;
}

.form-section.active {
    display: block;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Subida de archivos */
.file-upload {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload:hover {
    background: #e3f2fd;
}

/* ========== BOTONES ========== */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(45deg, #3498db, #9b59b6);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

/* ========== ANIMACIONES DE PROCESAMIENTO ========== */
.processing-animation {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #3498db, #9b59b6);
    width: 0%;
    transition: width 0.5s ease;
}

/* ========== DASHBOARD DE RESULTADOS ========== */
.results-dashboard {
    display: none;
}

.results-dashboard.active {
    display: block;
}

.status-header {
    text-align: center;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.status-compliant {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 1px solid #b8daff;
}

.status-warning {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 1px solid #ffeaa7;
}

.status-risk {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border: 1px solid #f5c6cb;
}

.status-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.result-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    border-left: 5px solid #3498db;
}

/* ========== HISTORIAL Y LISTAS ========== */
.validation-history {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid #17a2b8;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.history-item:last-child {
    border-bottom: none;
}

.checklist {
    list-style: none;
    padding: 0;
}

.checklist li {
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
}

.checklist li:before {
    content: "📋";
    margin-right: 10px;
}

/* ========== ELEMENTOS ESPECIALES ========== */
.dynamic-result {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.risk-item {
    background: #fff5f5;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #e53e3e;
    margin-bottom: 10px;
}

.regulation-match {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.title-badge {
    background: #3498db;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-right: 10px;
}

.ai-analysis {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin: 20px 0;
}

/* ========== GENERACIÓN PDF ========== */
.pdf-generation {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 12px;
    margin: 20px 0;
    display: none;
}

.pdf-progress {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    margin: 15px 0;
    overflow: hidden;
}

.pdf-progress-fill {
    height: 100%;
    background: white;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.download-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .step-indicator {
        padding: 20px 10px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .download-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .user-info {
        position: static;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .language-selector {
        position: static;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .cloud-status {
        position: static;
        transform: none;
        margin-bottom: 20px;
    }
}