/* Talencer Services Plugin Styles */

.talencer-services-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Grid de cursos */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* Tarjetas de curso */
.course-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Avatar del curso */
.course-avatar {
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
}

/* Contenido de la tarjeta */
.course-content {
    padding: 20px;
}

.course-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.course-description {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 15px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta información */
.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.course-price {
    font-size: 18px;
    font-weight: 700;
    color: #28a745;
}

.course-difficulty {
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* Botón de detalle */
.course-detail-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.course-detail-btn:hover {
    opacity: 0.9;
}

/* Detalle del curso */
.course-detail {
    padding: 30px;
}

.course-detail-header {
    display: flex;
    gap: 25px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.course-detail-avatar {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    overflow: hidden;
    border-radius: 12px;
    background: #f8f9fa;
}

.course-detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-detail-info {
    flex: 1;
}

.course-detail-title {
    font-size: 24px;
    color: #2c3e50;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.course-detail-short {
    color: #6c757d;
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 20px 0;
}

.course-detail-price {
    display: flex;
    gap: 15px;
    align-items: center;
}

.course-detail-price .price {
    font-size: 28px;
    font-weight: 700;
    color: #28a745;
}

.course-detail-price .difficulty {
    background: #e9ecef;
    color: #495057;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.course-detail-description,
.course-detail-tags {
    margin-bottom: 25px;
}

.course-detail-description h3,
.course-detail-tags h3 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 18px;
}

.course-detail-description p {
    color: #495057;
    line-height: 1.6;
    margin: 0;
}

/* Etiquetas */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.course-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* Meta información del detalle */
.course-detail-meta {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    display: grid;
    gap: 12px;
}

.meta-item {
    font-size: 14px;
    color: #495057;
}

.meta-item strong {
    color: #2c3e50;
    margin-right: 8px;
}

/* Paginación */
.courses-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.pagination-btn {
    padding: 10px 20px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.pagination-btn:hover {
    background: #005a87;
}

.pagination-info {
    color: #6c757d;
    font-size: 14px;
}

/* Mensajes de error y estados vacíos */
.talencer-services-error,
.talencer-services-empty,
.course-detail-error {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #6c757d;
}

.talencer-services-error {
    border-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
    .talencer-services-container {
        padding: 15px;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .course-detail-header {
        flex-direction: column;
        text-align: center;
    }
    
    .course-detail-avatar {
        width: 120px;
        height: 120px;
        margin: 0 auto;
    }
    
    .course-detail {
        padding: 20px;
    }
    
    .courses-pagination {
        flex-direction: column;
        gap: 10px;
    }
}

/* Estilos para Modal */
.course-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.course-modal-content {
    background-color: #fff;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.course-modal-close {
    color: #fff;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.course-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Contenido del modal - usando estructura similar a la página completa */
#course-detail-content .course-detail-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

#course-detail-content .course-detail-avatar {
    flex: 0 0 300px;
}

#course-detail-content .course-detail-avatar img,
#course-detail-content .course-detail-avatar > div {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
}

#course-detail-content .course-detail-info {
    flex: 1;
    padding: 20px 0;
}

#course-detail-content .course-detail-info h1 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 2.2em;
    font-weight: 600;
}

#course-detail-content .course-short-description {
    color: #7f8c8d;
    font-size: 1.1em;
    line-height: 1.6;
    margin: 0;
}

#course-detail-content .course-detail-body {
    padding: 30px;
}

#course-detail-content .course-section {
    margin-bottom: 30px;
}

#course-detail-content .course-section h2 {
    color: #2c3e50;
    font-size: 1.4em;
    margin-bottom: 15px;
    font-weight: 600;
}

#course-detail-content .course-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

#course-detail-content .meta-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#course-detail-content .meta-label {
    font-weight: 600;
    color: #495057;
}

#course-detail-content .meta-value {
    color: #28a745;
    font-weight: 500;
}

/* Responsive para modal */
@media (max-width: 768px) {
    .course-modal-content {
        margin: 1% auto;
        width: 95%;
        max-height: 95vh;
    }
    
    #course-detail-content .course-detail-header {
        flex-direction: column;
        gap: 20px;
    }
    
    #course-detail-content .course-detail-avatar {
        flex: none;
        max-width: 100%;
    }
    
    #course-detail-content .course-detail-body {
        padding: 20px;
    }
    
    #course-detail-content .course-meta-grid {
        grid-template-columns: 1fr;
    }
    
    #course-detail-content .course-detail-info h1 {
        font-size: 1.8em;
    }
}

/* Estilos para botón de inscripción */
.course-enrollment-section {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    text-align: center;
    border: 1px solid #dee2e6;
}

.enrollment-call-to-action h3 {
    color: #28a745;
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 15px;
}

.enrollment-call-to-action p {
    color: #6c757d;
    font-size: 1.1em;
    margin-bottom: 25px;
    line-height: 1.5;
}

.enrollment-button {
    display: inline-block;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    padding: 16px 32px;
    font-size: 1.1em;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    text-transform: none;
    letter-spacing: 0.5px;
}

.enrollment-button:hover {
    background: linear-gradient(135deg, #218838 0%, #1abc9c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    color: #fff;
    text-decoration: none;
}

.enrollment-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* Responsive para botón de inscripción */
@media (max-width: 768px) {
    .course-enrollment-section {
        padding: 20px;
        margin-top: 30px;
    }
    
    .enrollment-call-to-action h3 {
        font-size: 1.3em;
    }
    
    .enrollment-button {
        padding: 14px 28px;
        font-size: 1em;
        width: 100%;
        max-width: 280px;
    }
}