/**
 * Estilos para el Comparador de Vehículos - Frontend
 */

/* === Contenedor Principal === */
.comparador-vehiculos-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* === Header === */
.comparador-header {
    text-align: center;
    margin-bottom: 40px;
}

.comparador-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
    line-height: 1.2;
}

.comparador-subtitle {
    font-size: 1.125rem;
    color: #666;
    margin: 0;
}

/* === Selectores de Vehículos === */
.comparador-selectores {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: end;
    margin-bottom: 30px;
}

.selector-vehiculo {
    display: flex;
    flex-direction: column;
}

.selector-vehiculo label {
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.vehiculo-select {
    padding: 15px 20px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M1.41 0L6 4.59L10.59 0L12 1.41l-6 6l-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 45px;
}

.vehiculo-select:hover {
    border-color: #e63027;
}

.vehiculo-select:focus {
    outline: none;
    border-color: #e63027;
    box-shadow: 0 0 0 3px rgba(230, 48, 39, 0.1);
}

/* === VS Badge === */
.selector-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.vs-text {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #e63027 0%, #c41e1a 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(230, 48, 39, 0.3);
}

/* === Botón Comparar === */
.comparador-button-container {
    text-align: center;
    margin-bottom: 40px;
}

.btn-comparar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 50px;
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #e63027 0%, #c41e1a 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(230, 48, 39, 0.3);
}

.btn-comparar:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 48, 39, 0.4);
}

.btn-comparar:active:not(:disabled) {
    transform: translateY(0);
}

.btn-comparar:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-icon {
    font-size: 1.5rem;
}

/* === Loading === */
.comparador-loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #e63027;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === Resultado === */
.comparador-resultado {
    margin-top: 50px;
}

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

.resultado-header h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.btn-nueva-comparacion {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    color: #e63027;
    background: #fff;
    border: 2px solid #e63027;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-nueva-comparacion:hover {
    background: #e63027;
    color: #fff;
}

/* === Cards de Vehículos === */
.vehiculos-comparados {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 50px;
}

.vehiculo-card {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.vehiculo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.vehiculo-imagen {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 20px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vehiculo-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vehiculo-nombre {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px 0;
}

.vehiculo-precio {
    font-size: 1.75rem;
    font-weight: 700;
    color: #e63027;
    margin: 0 0 15px 0;
}

.vehiculo-descripcion {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
}

/* === Tabla de Características === */
.caracteristicas-comparacion {
    margin-top: 40px;
}

.categoria-section {
    margin-bottom: 40px;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.categoria-titulo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e63027;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #e63027;
}

.tabla-caracteristicas {
    width: 100%;
    border-collapse: collapse;
}

.tabla-caracteristicas thead {
    background: #f8f8f8;
}

.tabla-caracteristicas th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e63027;
}

.tabla-caracteristicas tbody tr {
    transition: background-color 0.2s ease;
}

.tabla-caracteristicas tbody tr:hover {
    background-color: #f9f9f9;
}

.tabla-caracteristicas td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.caracteristica-nombre {
    font-weight: 600;
    color: #333;
}

.caracteristica-valor {
    color: #555;
}

.no-disponible {
    color: #999;
    font-style: italic;
}

/* === Mensajes de Error === */
.comparador-error {
    text-align: center;
    padding: 30px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 12px;
    margin-top: 30px;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.error-message {
    font-size: 1.125rem;
    color: #856404;
    margin-bottom: 20px;
}

.btn-cerrar-error {
    padding: 10px 25px;
    font-size: 1rem;
    font-weight: 600;
    color: #856404;
    background: #fff;
    border: 2px solid #ffc107;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cerrar-error:hover {
    background: #ffc107;
    color: #fff;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .comparador-vehiculos-wrapper {
        padding: 20px;
    }
    
    .comparador-title {
        font-size: 1.75rem;
    }
    
    .comparador-subtitle {
        font-size: 1rem;
    }
    
    .comparador-selectores {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .selector-vs {
        order: -1;
        margin-bottom: 0;
    }
    
    .vehiculos-comparados {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .resultado-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .resultado-header h3 {
        font-size: 1.5rem;
    }
    
    .tabla-caracteristicas {
        font-size: 0.9rem;
    }
    
    .tabla-caracteristicas th,
    .tabla-caracteristicas td {
        padding: 10px 8px;
    }
    
    .categoria-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .comparador-title {
        font-size: 1.5rem;
    }
    
    .btn-comparar {
        padding: 15px 35px;
        font-size: 1rem;
    }
    
    .vehiculo-card {
        padding: 20px;
    }
    
    .vehiculo-imagen {
        height: 180px;
    }
    
    .vehiculo-nombre {
        font-size: 1.25rem;
    }
    
    .vehiculo-precio {
        font-size: 1.5rem;
    }
    
    .tabla-caracteristicas {
        display: block;
        overflow-x: auto;
    }
}

/* === Botón de Descarga PDF === */
.btn-descargar-pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    border: none;
    border-radius: 50px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(45, 55, 72, 0.3);
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.btn-descargar-pdf:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(45, 55, 72, 0.4);
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #fff;
    text-decoration: none;
}

.btn-descargar-pdf:active {
    transform: translateY(0);
}

.pdf-icon {
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .btn-descargar-pdf {
        padding: 10px 20px;
        font-size: 0.875rem;
        max-width: 100%;
    }
}

