/* ================================================
    ESTILOS BASE (MANTENIDOS)
================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #F5F7FA;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #333;
}

a:hover {
    text-decoration: none; 
    color: #2C3E50;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

header h1 {
    color: #2C3E50;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* ================================================
    CONTENEDOR PRINCIPAL DEL VALIDADOR
================================================ */

.validator-container {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.validator-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.validator-header h2 {
    color: #2C3E50;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.validator-header h2 i {
    color: #27ae60;
}

/* ================================================
    CONTROLES DE ENTRADA
================================================ */

.input-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.input-area {
    flex: 1;
    min-width: 300px;
}

.file-upload-area {
    flex: 0 0 250px;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2C3E50;
    font-size: 0.95rem;
}

#imeiInput {
    width: 100%;
    height: 200px;
    padding: 15px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #f9f9f9;
    resize: vertical;
    font-family: 'Courier New', monospace;
    line-height: 1.4;
}

#imeiInput:focus {
    outline: none;
    border-color: #888;
    background-color: white;
}

.file-upload-box {
    border: 2px dashed #ddd;
    border-radius: 6px;
    padding: 30px 15px;
    text-align: center;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload-box:hover {
    border-color: #2C3E50;
    background-color: #f0f7ff;
}

.file-upload-box i {
    font-size: 40px;
    color: #888;
    margin-bottom: 10px;
}

.file-upload-text {
    color: #555;
    font-size: 14px;
    margin-bottom: 5px;
}

.file-upload-hint {
    color: #888;
    font-size: 12px;
}

#fileInput {
    display: none;
}

/* ================================================
    BOTONES DE ACCIÓN
================================================ */

.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

#processButton {
    background: #2C3E50;
    color: white;
    border: none;
    padding: 15px 25px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s;
    font-weight: 600;
}

#processButton:hover {
    opacity: 0.9;
}

#clearButton {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 15px 25px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s;
    font-weight: 600;
}

#clearButton:hover {
    opacity: 0.9;
}

#exportButton {
    background: #27ae60;
    color: white;
    border: none;
    padding: 15px 25px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s;
    font-weight: 600;
    display: none;
}

#exportButton:hover {
    opacity: 0.9;
}

/* ================================================
    INFORMACIÓN DE ESTADO
================================================ */

.status-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-top: 1px solid #eee;
    gap: 15px;
    flex-wrap: wrap;
}

.status-text {
    text-align: center;
    font-size: 14px;
    margin: 0;
    min-width: 200px;
}

#imei-count {
    font-weight: bold;
    color: #2C3E50;
    display: block;
    margin-bottom: 2px;
}

#process-time {
    color: #6c757d;
}

/* ================================================
    RESUMEN DE RESULTADOS
================================================ */

.summary-container {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 30px;
    display: none;
}

.summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.summary-header h2 {
    color: #2C3E50;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-header h2 i {
    color: #3498db;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: #F5F7FA;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    border-left: 4px solid #2C3E50;
}

.stat-card.valid {
    border-left-color: #27ae60;
}

.stat-card.invalid {
    border-left-color: #e74c3c;
}

.stat-card.skipped {
    border-left-color: #f39c12;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-card.valid .stat-value {
    color: #27ae60;
}

.stat-card.invalid .stat-value {
    color: #e74c3c;
}

.stat-card.skipped .stat-value {
    color: #f39c12;
}

.stat-label {
    color: #555;
    font-size: 14px;
    font-weight: 600;
}

/* ================================================
    TABLA DE RESULTADOS
================================================ */

.results-container {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 30px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.results-header h2 {
    color: #2C3E50;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-header h2 i {
    color: #3498db;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid #eee;
}

#results-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

#results-table th {
    background: #2C3E50;
    color: white;
    font-weight: 600;
    padding: 15px 10px;
    text-align: left;
    font-size: 0.9rem;
}

#results-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    font-size: 0.9rem;
    color: #444;
}

#results-table tr:nth-child(even) { 
    background-color: #F5F7FA; 
}

#results-table tr:hover { 
    background-color: #eef2f7; 
}

.imei-cell {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.1rem;
    color: #2C3E50;
}

.status-valid {
    color: #27ae60;
    font-weight: bold;
}

.status-invalid {
    color: #e74c3c;
    font-weight: bold;
}

.status-skipped {
    color: #f39c12;
    font-weight: bold;
}

/* ================================================
    ESTADOS VACÍOS
================================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    display: none;
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 20px;
    color: #ddd;
}

/* ================================================
    FOOTER
================================================ */

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #888;
    font-size: 14px;
}

/* ================================================
    RESPONSIVE
================================================ */

@media (max-width: 768px) {
    .input-controls { 
        flex-direction: column; 
    }
    
    .input-area, .file-upload-area { 
        width: 100%; 
        min-width: unset;
    }
    
    .action-buttons { 
        flex-direction: column; 
    }
    
    #processButton, #clearButton { 
        width: 100%; 
        justify-content: center;
    }
    
    .status-info { 
        flex-direction: column; 
        align-items: stretch;
        gap: 15px;
    }
    
    .status-text {
        order: 1;
        text-align: center;
        width: 100%;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    #results-table th,
    #results-table td {
        padding: 8px 5px;
        font-size: 12px;
    }
    
    .imei-cell {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .validator-container, .results-container, .summary-container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .validator-header h2, .results-header h2, .summary-header h2 {
        font-size: 1.3rem;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 2rem;
    }
}
