/* Estilos principales para el repetidor de charlas */

.charlas-repeater-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.charlas-header {
    margin-bottom: 30px;
    text-align: left;
}

.charlas-title {
    font-size: 32px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    padding: 0;
}

/* Estilos de la Barra de Progreso - Exactamente igual a la imagen */
.progress-bar-container {
    background: #ffe4cc; /* Fondo naranja más claro y suave */
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 40px;
    box-shadow: 0 2px 8px rgba(255, 228, 204, 0.4);
}

.progress-bar-content {
    background: #ffffff;
    border-radius: 6px;
    padding: 12px 16px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.progress-bar-text {
    font-size: 13px;
    font-weight: 400;
    color: #333333;
    white-space: nowrap;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #f5f5f5;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    max-width: 180px;
}

.progress-bar-fill {
    height: 100%;
    background: #ff9966; /* Naranja exacto como en la imagen */
    border-radius: 3px;
    transition: width 0.6s ease-out;
    position: relative;
}

.progress-bar-percentage {
    font-size: 13px;
    font-weight: 500;
    color: #333333;
    min-width: 35px;
    text-align: right;
    white-space: nowrap;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-complete {
    margin-top: 15px;
    text-align: center;
}

.complete-badge {
    display: inline-block;
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.charlas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.charla-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e8e8e8;
}

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

.charla-thumbnail {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 16px 16px 0 0;
}

.charla-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
    -webkit-backface-visibility: hidden;
}

.charla-card:hover .charla-thumbnail img {
    transform: scale(1.05);
}

.no-thumbnail {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 18px;
    font-weight: 500;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.charla-card:hover .play-overlay {
    opacity: 1;
}

.play-button {
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.charla-card:hover .play-button {
    transform: scale(1);
}

.play-button svg {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.charla-content {
    padding: 25px;
}

.charla-title-card {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 15px 0;
    line-height: 1.4;
    min-height: 50px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.charla-speaker {
    margin-bottom: 20px;
}

.speaker-name {
    font-size: 16px;
    font-weight: 500;
    color: #34495e;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.speaker-profession {
    font-size: 14px;
    color: #7f8c8d;
    margin: 0;
    line-height: 1.3;
    font-style: italic;
}

.charla-status {
    text-align: center;
    margin-top: 20px;
}

.status-button {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-button.available {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.status-button.available:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.status-button.coming-soon {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.status-button.coming-soon:hover {
    background: linear-gradient(135deg, #e67e22, #d68910);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.status-button.unavailable {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.status-button.unavailable:hover {
    background: linear-gradient(135deg, #7f8c8d, #707b7c);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

/* Modal styles - Enhanced Design */
.video-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(231, 76, 60, 0.1) 100%);
    backdrop-filter: blur(10px);
    animation: modalFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #ffffff;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.close-modal:hover {
    background: rgba(231, 76, 60, 0.9);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 40px rgba(231, 76, 60, 0.4);
}

.close-modal::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 2px;
    background: white;
    transform: rotate(45deg);
}

.close-modal::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 2px;
    background: white;
    transform: rotate(-45deg);
}

.video-container {
    position: relative;
    width: 90%;
    max-width: 700px;
    height: 0;
    padding-bottom: 38%; /* Further reduced to make it much less tall */
    background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: modalSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    margin-top: 10px; /* Add space to avoid close button overlap */
}

.video-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, transparent 100%);
    z-index: 1;
    pointer-events: none;
}

.video-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.3) 0%, transparent 100%);
    z-index: 1;
    pointer-events: none;
}

#video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
}

#video-player iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 20px;
}

#video-player video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

/* Loading animation for video */
.video-container.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    margin: -30px 0 0 -30px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #e74c3c;
    border-radius: 50%;
    animation: videoLoading 1s linear infinite;
    z-index: 2;
}

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

/* Enhanced modal animations */
@keyframes modalFadeIn {
    0% { 
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    100% { 
        opacity: 1;
        backdrop-filter: blur(10px);
    }
}

@keyframes modalSlideIn {
    0% { 
        transform: translateY(50px) scale(0.9);
        opacity: 0;
    }
    100% { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Video controls overlay */
.video-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-container:hover .video-controls {
    opacity: 1;
}

.video-title {
    color: white;
    font-size: 16px;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.video-actions {
    display: flex;
    gap: 10px;
}

.video-action-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-action-btn:hover {
    background: rgba(231, 76, 60, 0.8);
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .charlas-repeater-container {
        padding: 15px;
    }
    
    .charlas-title {
        font-size: 28px;
    }
    
    .progress-bar-container {
        padding: 15px;
        margin-bottom: 30px;
    }
    
    .progress-bar-content {
        padding: 12px 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .progress-bar-text {
        font-size: 13px;
        text-align: center;
    }
    
    .progress-bar {
        max-width: none;
        height: 6px;
    }
    
    .progress-bar-percentage {
        font-size: 13px;
        text-align: center;
        min-width: auto;
    }
    
    .charlas-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .charla-thumbnail {
        height: 200px;
    }
    
    .charla-content {
        padding: 20px;
    }
    
    .charla-title-card {
        font-size: 16px;
    }
    
    .speaker-name {
        font-size: 15px;
    }
    
    .speaker-profession {
        font-size: 13px;
    }
    
    .status-button {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .close-modal {
        top: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }
    
    .close-modal::before,
    .close-modal::after {
        width: 25px;
    }
    
    .video-container {
        width: 95%;
        max-width: 600px;
        padding-bottom: 32%; /* Adjusted for mobile with new height */
        margin-top: 8px;
    }
    
    .video-controls {
        bottom: 15px;
        left: 15px;
        right: 15px;
    }
    
    .video-title {
        font-size: 14px;
    }
    
    .video-action-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .charlas-repeater-container {
        padding: 10px;
    }
    
    .charlas-title {
        font-size: 24px;
    }
    
    .progress-bar-container {
        padding: 12px;
        margin-bottom: 25px;
    }
    
    .progress-bar-content {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .progress-bar-text {
        font-size: 12px;
        text-align: center;
    }
    
    .progress-bar {
        height: 5px;
    }
    
    .progress-bar-percentage {
        font-size: 12px;
        text-align: center;
    }
    
    .charla-thumbnail {
        height: 180px;
    }
    
    .charla-content {
        padding: 15px;
    }
    
    .close-modal {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
    }
    
    .close-modal::before,
    .close-modal::after {
        width: 20px;
    }
    
    .video-container {
        width: 98%;
        max-width: 320px;
        border-radius: 12px;
        padding-bottom: 28%; /* Further reduced for small mobile */
        margin-top: 5px;
    }
    
    #video-player iframe,
    #video-player video {
        border-radius: 15px;
    }
    
    .video-controls {
        bottom: 10px;
        left: 10px;
        right: 10px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .video-title {
        font-size: 12px;
    }
    
    .video-actions {
        align-self: stretch;
    }
    
    .video-action-btn {
        padding: 8px 12px;
        font-size: 11px;
        width: 100%;
    }
    
    .charla-title-card {
        font-size: 15px;
        min-height: 42px;
    }
    
    .status-button {
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* Loading state */
.charla-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.charla-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #e74c3c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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