/* ========================================
   ESTILOS PARA SELECCIÓN DE PANELES SOLARES
   panels.css - Módulo específico para funcionalidad de paneles
   ======================================== */

/* Sección principal de paneles */
.panel-selection-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
    animation: fadeIn 0.5s ease-in-out;
}

.subsection-title {
    font-size: 1.2rem;
    color: #2ECC71;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    position: relative;
}

.subsection-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, #2ECC71, transparent);
    margin-left: 1rem;
}

/* Tarjeta de información del panel */
.panel-info-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    border-left: 4px solid #2ECC71;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.panel-info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #2ECC71, #27AE60);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.panel-info-card:hover::before {
    transform: translateX(0);
}

.panel-info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.1);
}

/* Grid de especificaciones */
.panel-specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.spec-item {
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: default;
    position: relative;
}

.spec-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.spec-label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.25rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spec-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2ECC71;
    transition: color 0.3s ease;
}

.spec-item:hover .spec-value {
    color: #27AE60;
}

/* Descripción del panel */
.panel-description {
    text-align: center;
    color: #666;
    font-style: italic;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
    line-height: 1.4;
    font-size: 0.95rem;
}

/* Selector de panel mejorado */
#panelType {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
}

#panelType:focus {
    border-color: #2ECC71;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
    background: #ffffff;
}

#panelType option {
    padding: 0.5rem;
    background: white;
}

/* Estados de carga */
.panel-info-card.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.panel-info-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #2ECC71;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

/* Animación de actualización */
.panel-info-card.updating {
    animation: panelUpdate 0.3s ease;
}

@keyframes panelUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(0.98); }
    100% { transform: scale(1); }
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

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

/* Tooltip para información adicional */
.spec-item[data-tooltip] {
    position: relative;
}

.spec-item[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    opacity: 0;
    animation: tooltipFadeIn 0.3s ease forwards;
}

.spec-item[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
    opacity: 0;
    animation: tooltipFadeIn 0.3s ease forwards;
}

@keyframes tooltipFadeIn {
    to { opacity: 1; }
}

/* Comparación visual de paneles */
.panel-comparison-hint {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(46, 204, 113, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(46, 204, 113, 0.2);
    font-size: 0.85rem;
    color: #2ECC71;
}

.comparison-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.comparison-metric .metric-label {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.comparison-metric .metric-value {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .panel-specs {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .spec-item {
        padding: 0.5rem 0.25rem;
    }
    
    .spec-value {
        font-size: 1rem;
    }
    
    .spec-label {
        font-size: 0.75rem;
    }
    
    .subsection-title {
        font-size: 1.1rem;
    }
    
    .subsection-title::after {
        display: none;
    }
    
    .panel-description {
        font-size: 0.9rem;
    }
    
    .panel-comparison-hint {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .panel-selection-section {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }
    
    .panel-info-card {
        padding: 1rem;
        margin-top: 0.75rem;
    }
    
    .panel-specs {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .spec-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 0.75rem;
    }
    
    .spec-label {
        margin-bottom: 0;
    }
}