/* Estilos para la página de planes de estudio */

/* Estilos de carga */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-overlay p {
    margin-top: 1rem;
    color: #007bff;
    font-weight: 500;
}

/* Estilos para la lista de planes */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    grid-gap: 20px;
    margin: 20px 0;
}

.plan-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    background-color: #fff;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.plan-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.plan-card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}

.plan-status {
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 12px;
}

.status-active {
    background-color: #e3f2fd;
    color: #0d6efd;
}

.status-completed {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.plan-card-body p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.plan-progress-container {
    margin: 10px 0;
}

.plan-progress-bar {
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    margin-bottom: 5px;
}

.plan-progress {
    height: 100%;
    background-color: #4caf50;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.plan-progress-text {
    font-size: 0.85rem;
    color: #666;
}

.plan-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    font-size: 0.85rem;
    color: #757575;
}

/* Estado vacío */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 30px auto;
}

.empty-icon {
    font-size: 3rem;
    color: #adb5bd;
    margin-bottom: 15px;
}

/* Detalle del plan */
.plan-detail-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

.plan-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #e0e0e0;
}

.plan-header-left {
    flex: 1;
}

.plan-header-right {
    width: 200px;
}

.plan-header h1 {
    margin-top: 0;
    color: #333;
    font-weight: 600;
}

.plan-objetivo {
    color: #666;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.plan-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.meta-item {
    color: #555;
    font-size: 0.9rem;
}

.progress-container {
    margin-top: 10px;
}

.progress-bar {
    height: 15px;
    background-color: #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress {
    height: 100%;
    background-color: #4caf50;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Secciones del plan */
.section-container {
    margin: 15px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.section-header {
    padding: 15px 20px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
}

.section-container.active .section-header {
    background-color: #e3f2fd;
}

.section-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #333;
}

.section-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-completed {
    color: #2e7d32;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.section-content {
    padding: 20px;
    display: none;
}

.section-description {
    color: #555;
    margin-bottom: 20px;
}

/* Actividades */
.activities-list {
    margin-bottom: 30px;
}

.activity-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #007bff;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.activity-title {
    font-weight: 500;
    color: #333;
    font-size: 1.1rem;
}

.activity-badges {
    display: flex;
    gap: 5px;
}

.activity-description {
    color: #555;
    margin-bottom: 15px;
}

.activity-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 0.9rem;
}

.activity-complete {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

/* Recursos */
.resource-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-gap: 15px;
}

.resource-item {
    display: flex;
    gap: 15px;
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
}

.resource-icon {
    font-size: 1.5rem;
    color: #0d6efd;
}

.resource-title {
    font-weight: 500;
    margin-bottom: 5px;
}

.resource-description {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.resource-source {
    font-size: 0.8rem;
    color: #666;
}

/* Diagnóstico */
.diagnostico-areas {
    margin-bottom: 30px;
}

.area-dificultad {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.area-dificultad.alta {
    border-left: 4px solid #dc3545;
}

.area-dificultad.media {
    border-left: 4px solid #ffc107;
}

.area-dificultad.baja {
    border-left: 4px solid #28a745;
}

.estilos-aprendizaje {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.estilo-aprendizaje {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.estilo-justificacion {
    color: #555;
    font-size: 0.95rem;
}

.objetivos-aprendizaje {
    margin-top: 20px;
}

.objetivo-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.objetivo-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.objetivo-metrica {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

/* Conceptos clave */
.concepts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-gap: 15px;
}

.concept-item {
    display: flex;
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    gap: 12px;
}

.concept-icon {
    font-size: 1.2rem;
    color: #ff9800;
    padding-top: 3px;
}

.concept-title {
    font-weight: 500;
    margin-bottom: 5px;
}

.concept-description {
    color: #555;
    font-size: 0.9rem;
}

/* Botones de acción */
.plan-action-buttons {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #e0e0e0;
    margin-top: 20px;
}

/* Formulario de creación */
.create-plan-form {
    background-color: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

.create-plan-form h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-check {
    margin-top: 15px;
}

.form-control-range {
    width: 100%;
}

/* Badges personalizados */
.badge {
    padding: 5px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.badge-basic {
    background-color: #e3f2fd;
    color: #0d6efd;
}

.badge-intermedio {
    background-color: #fff3cd;
    color: #856404;
}

.badge-avanzado {
    background-color: #f8d7da;
    color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
    .plan-header {
        flex-direction: column;
    }
    
    .plan-header-right {
        width: 100%;
        margin-top: 20px;
    }
    
    .concepts-container, .resource-list {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   ESTILOS MEJORADOS PARA TARJETAS DE PLANES
   ========================================== */

/* Tarjeta de plan destacada */
.plan-card.plan-destacado,
.plan-card.featured {
    border: 3px solid #2c5aa0;
    background: linear-gradient(135deg, #f8faff 0%, #e8f0ff 100%);
    transform: scale(1.03);
    box-shadow: 0 10px 40px rgba(44, 90, 160, 0.25);
    position: relative;
    z-index: 2;
}

.plan-card.featured::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(135deg, #2c5aa0, #4a8bc2, #2c5aa0);
    border-radius: 11px;
    z-index: -1;
    animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Badge de recomendado/mejor opción */
.featured-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    white-space: nowrap;
    z-index: 10;
}

/* Contenedor del precio mejorado */
.plan-price-container {
    text-align: center;
    margin: 15px 0;
    position: relative;
}

/* Badge de descuento */
.discount-badge,
.discount-badge-active {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.discount-icon {
    font-size: 1.1em;
}

/* Precio original tachado */
.original-price {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

/* Precio con descuento */
.discounted-price {
    color: #059669;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 5px;
}

/* Badge de ahorro */
.savings-badge {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 15px;
    display: inline-block;
    margin-top: 5px;
}

/* Precio normal (sin descuento) */
.plan-price {
    color: #2c5aa0;
    font-size: 2rem;
    font-weight: 800;
}

/* Precio por día */
.precio-por-dia {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 10px 0 5px;
}

.precio-dia-valor {
    color: #2c5aa0;
    font-weight: 700;
}

/* Información de duración */
.duracion-info {
    color: #4b5563;
    font-size: 0.9rem;
    margin-top: 5px;
}

.duracion-icono {
    margin-right: 4px;
}

/* DESTACAR PREGUNTAS DE PRÁCTICA */
.preguntas-highlight {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e40af 100%);
    color: white;
    padding: 20px;
    margin: 15px -15px;
    text-align: center;
    position: relative;
}

.preguntas-numero {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.preguntas-texto {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.preguntas-detalle {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 8px;
}

/* Plan destacado - preguntas aún más visibles */
.plan-card.featured .preguntas-highlight {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Lista de características mejorada */
.plan-features {
    padding: 15px 0;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.feature-text {
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Botón de selección mejorado */
.plan-card .btn-select-plan,
.plan-card .select-plan-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.plan-card .btn-select-plan {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e40af 100%);
    color: white;
}

.plan-card .btn-select-plan:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 90, 160, 0.4);
}

.plan-card.featured .btn-select-plan {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.plan-card.featured .btn-select-plan:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

/* Animación entrada de tarjetas */
.plan-card {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.plan-card:nth-child(1) { animation-delay: 0.1s; }
.plan-card:nth-child(2) { animation-delay: 0.2s; }
.plan-card:nth-child(3) { animation-delay: 0.3s; }
.plan-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover mejorado en tarjetas */
.plan-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.plan-card.featured:hover {
    transform: scale(1.05);
}

/* Responsive para tarjetas de planes */
@media (max-width: 768px) {
    .plan-card.featured {
        transform: scale(1);
    }
    
    .plan-card.featured:hover {
        transform: scale(1.02);
    }
    
    .preguntas-numero {
        font-size: 2.5rem;
    }
    
    .featured-badge {
        font-size: 0.75rem;
        padding: 5px 15px;
    }
}