/**
 * Estilos para Modales de Perfiles Públicos
 * Portal del Paciente - Yari Medic
 */

/* ============================================================================
   MODAL BASE
   ============================================================================ */

.modal-perfil {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-perfil.show {
    opacity: 1;
}

.modal-perfil-container {
    background: white;
    border-radius: 24px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-perfil.show .modal-perfil-container {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #64748b;
    transition: all 0.3s;
    z-index: 10;
}

.modal-close:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

/* ============================================================================
   CONTENIDO DEL MODAL
   ============================================================================ */

.perfil-modal-content {
    padding: 40px;
}

/* Header del Perfil */
.perfil-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f1f5f9;
}

.perfil-logo {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.perfil-logo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
}

.perfil-header-info h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.badge-verificado {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* Rating Summary */
.rating-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    color: white;
    text-align: center;
}

.rating-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.rating-number {
    font-size: 48px;
    font-weight: 700;
}

.rating-stars {
    font-size: 24px;
    color: #fbbf24;
}

.rating-stars i {
    margin: 0 2px;
}

.rating-count {
    font-size: 14px;
    opacity: 0.9;
}

/* Aspectos de Calificación */
.aspectos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.aspecto-item {
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.aspecto-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 10px;
}

.aspecto-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    color: #fbbf24;
}

.aspecto-valor {
    font-weight: 700;
    color: #1e293b;
}

/* Información de Contacto */
.info-contacto {
    background: #f8fafc;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    color: #475569;
}

.info-item:not(:last-child) {
    border-bottom: 1px solid #e2e8f0;
}

.info-item i {
    width: 24px;
    color: #667eea;
    font-size: 16px;
}

.info-item a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

.info-item a:hover {
    color: #764ba2;
}

/* Descripción */
.perfil-descripcion {
    margin-bottom: 30px;
}

.perfil-descripcion h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.perfil-descripcion p {
    color: #64748b;
    line-height: 1.7;
}

/* Servicios */
.perfil-servicios {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.servicio-item {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    padding: 20px;
}

.servicio-item h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 10px;
}

.servicio-item p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

/* Medicamentos/Pruebas */
.medicamentos-section,
.pruebas-section {
    margin-bottom: 30px;
}

.medicamentos-section h3,
.pruebas-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
}

.medicamentos-grid,
.pruebas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.medicamento-card,
.prueba-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s;
}

.medicamento-card:hover,
.prueba-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.medicamento-info h4,
.prueba-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.concentracion,
.categoria {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.tiempo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #667eea;
    margin-top: 8px;
}

.medicamento-precio,
.prueba-precio {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.precio {
    font-size: 18px;
    font-weight: 700;
    color: #10b981;
}

.badge-disponible {
    background: #d1fae5;
    color: #059669;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* Reviews */
.reviews-section {
    margin-bottom: 30px;
}

.reviews-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
}

.reviews-lista {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s;
}

.review-card:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.review-paciente {
    display: flex;
    align-items: center;
    gap: 12px;
}

.paciente-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.paciente-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.paciente-nombre {
    font-weight: 600;
    color: #1e293b;
}

.review-fecha {
    font-size: 13px;
    color: #94a3b8;
}

.review-rating {
    color: #fbbf24;
    font-size: 16px;
}

.review-comentario {
    color: #64748b;
    line-height: 1.6;
    margin: 12px 0;
}

.review-recomienda {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #dbeafe;
    color: #1e40af;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

/* Acciones */
.perfil-acciones {
    display: flex;
    justify-content: center;
    padding-top: 30px;
    border-top: 2px solid #f1f5f9;
}

.btn-reservar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-reservar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* Loader */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid #f1f5f9;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-container p {
    margin-top: 20px;
    color: #64748b;
    font-weight: 500;
}

/* Error */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.error-container i {
    font-size: 48px;
    color: #ef4444;
    margin-bottom: 16px;
}

.error-container p {
    color: #64748b;
    margin-bottom: 24px;
}

.btn-cerrar {
    background: #ef4444;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cerrar:hover {
    background: #dc2626;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .modal-perfil {
        padding: 10px;
    }

    .perfil-modal-content {
        padding: 24px;
    }

    .perfil-header {
        flex-direction: column;
        text-align: center;
    }

    .perfil-header-info h2 {
        font-size: 22px;
    }

    .aspectos-grid {
        grid-template-columns: 1fr;
    }

    .medicamentos-grid,
    .pruebas-grid {
        grid-template-columns: 1fr;
    }

    .perfil-servicios {
        grid-template-columns: 1fr;
    }

    .rating-number {
        font-size: 36px;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .perfil-modal-content {
        padding: 20px;
    }

    .rating-summary {
        padding: 20px;
    }

    .btn-reservar {
        width: 100%;
        justify-content: center;
    }
}