/**
 * Frontend styles for Courses eDestiny plugin
 */

/* Definição de cores base para personalização */
:root {
    /* Cor primária (roxa) e suas variações */
    --ed-primary-color: #5624d0 !important;
    --ed-primary-color-dark: #4a1fb3 !important;
    --ed-primary-color-light: #6b3ad9 !important;

    /* Cores secundárias */
    --ed-secondary-color: #f44336 !important; /* Vermelho para botões de cancelar/remover */
    --ed-secondary-color-dark: #d32f2f !important;

    /* Cores de texto */
    --ed-text-color-light: #ffffff !important;
    --ed-text-color-dark: #333333 !important;
    --ed-text-color-muted: #6a6f73 !important;

    /* Cores de fundo */
    --ed-background-dark: #1c1d1f !important;
    --ed-background-light: #f7f9fa !important;
    --ed-background-medium: #e8e9eb !important;

    /* Cores de borda */
    --ed-border-color: #e8e9eb !important;
}

/* Video info */
.bb-grid .ed-video-wrapper .ed-video-info{
	padding-bottom:80px !important;

}



/* Grid */
#content .bb-grid{
	position:static;
}

/* Course container */
#content .bb-grid .ed-course-container{
	position:static !important;

}



/* Estilos para o corpo da página */
body.ed-course-page {
    overflow: hidden !important; /* Impede o scroll no corpo da página */
}

/* Content */
#content {
    background-color: #000000 !important;
    padding-left: 0px !important;
    padding-right: 0px !important;
    padding-top: 78px !important;
    overflow: hidden !important; /* Impede o scroll no conteúdo */
}



/* Use high specificity to override theme styles */
.ed-course-container {
    display: flex !important;
    height: calc(100vh - 60px) !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    overflow: hidden !important; /* Impede o scroll na página inteira */
    position: fixed !important; /* Fixa o container na tela */
    top: 60px !important; /* Ajusta a posição para considerar o cabeçalho */
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

/* Video Player Section */
.ed-video-container {
    flex: 1 !important;
    background-color: #000 !important;
    position: relative !important;
    overflow: hidden !important;
    height: 100% !important; /* Usa altura completa */
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}



/* Course Logo */
.ed-course-logo {
    position: absolute !important;
    top: 20px !important;
    left: 20px !important;
    z-index: 10 !important;
    max-width: 200px !important;
    max-height: 80px !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    padding: 10px !important;
    border-radius: 4px !important;
}

.ed-course-logo img {
    max-width: 100% !important;
    max-height: 100% !important;
    display: block !important;
}

.ed-video-wrapper {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: auto !important;
    scrollbar-width: thin !important;
    scrollbar-color: var(--ed-primary-color) var(--ed-background-light) !important;
    position: relative !important;
    -webkit-overflow-scrolling: touch !important;
}

.ed-video-player {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    background-color: #000 !important;
}

/* Estilos básicos para vídeo e iframe removidos */

.ed-video-info {
    background-color: var(--ed-background-dark) !important;
    color: var(--ed-text-color-light) !important;
    padding: 1rem !important;
}

.ed-video-title {
    font-size: 1.5rem !important;
    margin-bottom: 0.5rem !important;
    color: var(--ed-text-color-light) !important;
}

.ed-video-description {
    font-size: 0.9rem !important;
    color: #ccc !important;
}

/* Sidebar Styles */
.ed-course-sidebar {
    width: 350px !important;
    background-color: white !important;
    border-left: 1px solid #e8e9eb !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    transition: transform 0.3s ease !important;
    height: 100% !important; /* Usa altura completa */
    display: flex !important;
    flex-direction: column !important;
    position: relative !important; /* Cria um novo contexto de posicionamento */
    z-index: 5 !important; /* Garante que fique acima de outros elementos */
}

.ed-sidebar-header {
    padding: 1rem !important;
    background-color: var(--ed-background-light) !important;
    border-bottom: 1px solid var(--ed-border-color) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    flex-shrink: 0 !important;
}

.ed-sidebar-header h3 {
    margin: 0 0 10px 0 !important;
    font-size: 1.2rem !important;
    color: var(--ed-text-color-dark) !important;
}

/* Paragraph in sidebar header - custom style */
#course-sidebar .ed-sidebar-header p {
    margin-bottom: 0px !important;
    margin-top: 0px !important;
}

.ed-progress-container {
    margin-top: 10px !important;
    background-color: var(--ed-background-medium) !important;
    height: 8px !important;
    border-radius: 4px !important;
    overflow: hidden !important;
    position: relative !important;
    width: 100% !important;
}

/* Hide progress container in sidebar header - custom style */
#course-sidebar .ed-sidebar-header .ed-progress-container {
    display: none !important;
}

.ed-progress-bar, #course-progress {
    height: 100% !important;
    background-color: var(--ed-primary-color) !important;
    width: 0% !important;
    transition: width 0.3s ease !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
}

.ed-course-sections {
    padding: 0.5rem 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex: 1 !important;
    height: calc(100% - 80px) !important; /* Altura total menos o cabeçalho */
    position: relative !important;
    -webkit-overflow-scrolling: touch !important; /* Melhor rolagem em dispositivos iOS */
}

.ed-section {
    margin-bottom: 0.5rem !important;
}

.ed-section-header {
    padding: 1rem !important;
    background-color: var(--ed-background-light) !important;
    cursor: pointer !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 1px solid var(--ed-border-color) !important;
}

.ed-section-title {
    font-weight: bold !important;
    color: var(--ed-text-color-dark) !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    hyphens: auto !important;
    line-height: 1.4 !important;
    max-width: 85% !important; /* Deixar espaço para o ícone de toggle */
}

.ed-section-lessons {
    display: none !important;
}

.ed-section.active .ed-section-lessons {
    display: block !important;
}

.ed-lesson {
    padding: 1rem !important;
    padding-left: 2rem !important;
    border-bottom: 1px solid var(--ed-border-color) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: flex-start !important; /* Alinhamento no topo para textos longos */
    transition: background-color 0.2s !important;
    flex-wrap: wrap !important; /* Permitir quebra de linha para conteúdos longos */
}

.ed-lesson:hover {
    background-color: var(--ed-background-light) !important;
}

.ed-lesson.active {
    background-color: var(--ed-background-medium) !important;
}

.ed-lesson-icon {
    margin-right: 10px !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.8rem !important;
    margin-top: 2px !important; /* Ajuste para alinhar com a primeira linha do texto */
    flex-shrink: 0 !important; /* Impedir que o ícone encolha */
}

.ed-lesson-icon.completed {
    background-color: var(--ed-primary-color) !important;
    color: var(--ed-text-color-light) !important;
}

.ed-lesson-icon.current {
    border: 2px solid var(--ed-primary-color) !important;
}

.ed-lesson-title {
    flex: 1 !important;
    color: var(--ed-text-color-dark) !important;
    font-size: 0.9rem !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    hyphens: auto !important;
    line-height: 1.4 !important;
}

.ed-lesson-duration {
    color: var(--ed-text-color-muted) !important;
    font-size: 0.8rem !important;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .ed-course-container {
        flex-direction: column !important;
        height: auto !important;
    }

    .ed-video-container {
        min-height: 300px !important;
        height: auto !important;
    }

    /* Estilos específicos para players de vídeo em dispositivos móveis foram removidos */

    .ed-course-sidebar {
        width: 100% !important;
        border-left: none !important;
        border-top: 1px solid #e8e9eb !important;
    }

    .ed-sidebar-toggle {
        display: block !important;
    }

    .ed-course-logo {
        top: 10px !important;
        left: 10px !important;
        max-width: 150px !important;
        max-height: 60px !important;
    }
}

/* Loading Indicator */
.loading {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 50px !important;
    height: 50px !important;
    border: 5px solid #f3f3f3 !important;
    border-top: 5px solid var(--ed-primary-color) !important;
    border-radius: 50% !important;
    animation: ed-spin 1s linear infinite !important;
    display: none !important;
}

@keyframes ed-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Mobile Navigation Bar */
.mobile-nav {
    display: none !important; /* Inicialmente oculto, será mostrado apenas em telas pequenas */
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 70px !important;
    background-color: #2d2d42 !important;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.15) !important;
    justify-content: space-around !important;
    align-items: center !important;
    z-index: 100 !important;
    padding: 0 20px !important;
}

.mobile-nav .nav-item {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    color: #ffffff !important;
    text-decoration: none !important;
    position: relative !important;
    transition: all 0.3s ease !important;
}

.mobile-nav .nav-item svg {
    width: 24px !important;
    height: 24px !important;
    fill: currentColor !important;
}

.mobile-nav .nav-item:hover {
    color: var(--ed-primary-color-light) !important;
    transform: translateY(-5px) !important;
}

/* Center button with special styling */
.mobile-nav .nav-item.center {
    background-color: var(--ed-primary-color) !important;
    border-radius: 50% !important;
    width: 60px !important;
    height: 60px !important;
    margin-top: -30px !important;
    box-shadow: 0 5px 20px rgba(86, 36, 208, 0.4) !important;
    z-index: 2 !important;
    transform-origin: center !important;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
}

.mobile-nav .nav-item.center svg {
    width: 30px !important;
    height: 30px !important;
}

.mobile-nav .nav-item.center:hover {
    transform: scale(1.1) translateY(-5px) !important;
    box-shadow: 0 10px 25px rgba(86, 36, 208, 0.6) !important;
    background-color: var(--ed-primary-color-dark) !important;
}

/* Tooltip styles */
.mobile-nav .tooltip {
    position: absolute !important;
    top: -40px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background-color: #2d2d42 !important;
    color: #ffffff !important;
    padding: 5px 10px !important;
    border-radius: 5px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
}

.mobile-nav .tooltip::after {
    content: "" !important;
    position: absolute !important;
    bottom: -5px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border-width: 5px 5px 0 !important;
    border-style: solid !important;
    border-color: #2d2d42 transparent transparent !important;
}

.mobile-nav .nav-item:hover .tooltip {
    opacity: 1 !important;
    visibility: visible !important;
    top: -45px !important;
}

/* Pulse animation for center button */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(86, 36, 208, 0.7) !important;
    }
    70% {
        box-shadow: 0 0 0 15px rgba(86, 36, 208, 0) !important;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(86, 36, 208, 0) !important;
    }
}

@media (max-width: 768px) {
    .mobile-nav {
        display: flex !important;
    }

    .ed-course-sidebar {
        position: fixed !important;
        bottom: 70px !important; /* Adjusted to account for mobile nav height */
        left: 0 !important;
        right: 0 !important;
        height: 70vh !important;
        transform: translateY(100%) !important;
        z-index: 99 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .ed-course-sidebar.open {
        transform: translateY(0) !important;
    }

    /* Garantir que o scroll da barra lateral seja independente em dispositivos móveis */
    .ed-course-sidebar .ed-course-sections {
        height: calc(100% - 60px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* Lesson Completion Buttons */
.ed-lesson-completion {
    margin-top: 20px !important;
}


.ed-mark-complete-button, #mark-complete-btn {
    padding: 10px 20px !important;
    background-color: var(--ed-primary-color) !important;
    color: var(--ed-text-color-light) !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
}

.ed-mark-complete-button:hover, #mark-complete-btn:hover {
    background-color: var(--ed-primary-color-dark) !important;
}

.ed-mark-incomplete-button, #mark-incomplete-btn {
    padding: 10px 20px !important;
    background-color: var(--ed-secondary-color) !important;
    color: var(--ed-text-color-light) !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
}

.ed-mark-incomplete-button:hover, #mark-incomplete-btn:hover {
    background-color: var(--ed-secondary-color-dark) !important;
}

/* No Video Message */
.no-video-message {
    padding: 30px !important;
    background-color: var(--ed-primary-color-light) !important;
    border-radius: 8px !important;
    text-align: center !important;
    color: white !important;
    font-size: 1.2rem !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    max-width: 80% !important;
    margin: 0 auto !important;
    position: relative !important;
    animation: pulse-light 2s infinite !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

.no-video-icon {
    margin-bottom: 15px !important;
}

.no-video-icon svg {
    stroke: white !important;
    animation: float 3s ease-in-out infinite !important;
}

/* No Modules Message */
.no-modules-message {
    padding: 40px 20px !important;
    text-align: center !important;
    background-color: var(--ed-background-light) !important;
    border-radius: 8px !important;
    margin: 20px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

.no-modules-icon {
    margin-bottom: 20px !important;
}

.no-modules-icon svg {
    stroke: var(--ed-primary-color) !important;
    animation: float 3s ease-in-out infinite !important;
}

.no-modules-message h3 {
    color: var(--ed-primary-color) !important;
    font-size: 1.5rem !important;
    margin-bottom: 10px !important;
    font-weight: 600 !important;
}

.no-modules-message p {
    color: var(--ed-text-color-muted) !important;
    font-size: 1rem !important;
    max-width: 80% !important;
    margin: 0 auto !important;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes pulse-light {
    0% {
        box-shadow: 0 0 0 0 rgba(86, 36, 208, 0.4) !important;
    }
    70% {
        box-shadow: 0 0 0 15px rgba(86, 36, 208, 0) !important;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(86, 36, 208, 0) !important;
    }
}

/* Video Containers - Estilos básicos */
.ed-bunny-video-container,
.ed-youtube-video-container,
.ed-presto-video-container {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
}

/* Estilos para corrigir o player de vídeo */
/* Video player */
.bb-grid .ed-video-wrapper .ed-video-player{
	display:block !important;
	max-width:none !important;
}

/* Presto provider youtube */
.ed-video-player .presto-provider-youtube{
	margin-bottom:0px;
	height:100%;
	overflow:hidden;
	width:84%;
	width:100%;
}

/* Ready */
.ed-video-player .presto-provider-youtube .ready{
	min-height:initial;
	min-width:initial;
	height:100% !important;
	width:auto;
}

/* Video wrapper */
.bb-grid .ed-video-wrapper{
	overflow:auto;
	min-width:100%;
	min-height:100%;
	height:100% !important;
}

/* Estilos adicionais para o player de vídeo */
/* Video player */
#page .ed-course-container .ed-video-container .ed-video-wrapper .ed-video-player{
	min-width:initial !important;
	min-height:initial !important;
}

/* Video player - mantido para compatibilidade com código legado */
#page .ed-course-container .ed-video-container .ed-video-wrapper .ed-video-player .video-player{
	min-height:initial !important;
	min-width:initial !important;
}

/* Video player - mantido para compatibilidade com código legado */
.ed-video-wrapper .ed-video-player .video-player{
	width:100%;
	height:100%;
	display:flex;
	justify-content:center;
	align-items:center;
	align-content:center;
	flex-direction:column;
}

/* Bunny video container - mantido para compatibilidade com código legado */
.ed-video-player .video-player .ed-bunny-video-container{
	display:flex;
	flex-direction:column;
	justify-content:center;
	align-items:center;
	align-content:center;
}

/* Aplicando os mesmos estilos diretamente ao container sem a div intermediária */
.ed-video-player .ed-bunny-video-container{
	display:flex;
	flex-direction:column;
	justify-content:center;
	align-items:center;
	align-content:center;
}

/* Estilos para o Presto Player sem a div intermediária */
.ed-video-player .ed-presto-video-container{
	display:flex;
	flex-direction:column;
	justify-content:center;
	align-items:center;
	align-content:center;
	width:100%;
	height:100%;
}

/* Presto Player container */
.ed-presto-video-container{
	width:100%;
	height:100%;
}

/* Current video */
#current-video{
	width:100%;
	height:100% !important;
	min-width:100%;
	min-height:100%;
	border-top-style:none;
	border-right-style:none;
	border-bottom-style:none;
	border-left-style:none;
}

/* Video wrapper */
#page .ed-video-wrapper{
	overflow: auto;
	max-height: 100vh;
}

/* Lesson */
#course-sections .active .ed-lesson{
	padding-left:16px !important;
	justify-content:center;
	align-content:center;
	align-items:center !important;
}

/* Lesson duration */
.ed-section-lessons .ed-lesson .ed-lesson-duration{
	padding-left:10px;
	padding-right:10px;
	padding-top:10px;
	padding-bottom:10px;
	background-color:#f9f9f9;
	border-top-left-radius:10px;
	border-top-right-radius:10px;
	border-bottom-left-radius:10px;
	border-bottom-right-radius:10px;
}

/* Estilos para o loader de vídeo */
.ed-video-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #5624d0;
    animation: spin 1s ease-in-out infinite;
    z-index: 10;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.ed-video-player {
    position: relative;
}

.ed-bunny-video-container, .ed-presto-video-container {
    position: relative;
}

/* Estilos para personalizar a barra de rolagem */
.ed-video-wrapper::-webkit-scrollbar,
.ed-course-sidebar::-webkit-scrollbar,
.ed-course-sections::-webkit-scrollbar {
    width: 8px !important;
    height: 8px !important;
}

.ed-video-wrapper::-webkit-scrollbar-track,
.ed-course-sidebar::-webkit-scrollbar-track,
.ed-course-sections::-webkit-scrollbar-track {
    background: var(--ed-background-light) !important;
}

.ed-video-wrapper::-webkit-scrollbar-thumb,
.ed-course-sidebar::-webkit-scrollbar-thumb,
.ed-course-sections::-webkit-scrollbar-thumb {
    background-color: var(--ed-primary-color) !important;
    border-radius: 4px !important;
    border: 2px solid var(--ed-background-light) !important;
}

.ed-video-wrapper::-webkit-scrollbar-thumb:hover,
.ed-course-sidebar::-webkit-scrollbar-thumb:hover,
.ed-course-sections::-webkit-scrollbar-thumb:hover {
    background-color: var(--ed-primary-color-dark) !important;
}

/* 768px and smaller screen sizes */
@media (max-width:768px){
	/* Current video */
	#current-video{
		min-height:424px;
	}

	/* Hydrated */
	.ed-video-player .presto-provider-youtube .hydrated{
		min-height:424px;
	}

	/* Video player */
	#page .ed-course-container .ed-video-container .ed-video-wrapper .ed-video-player{
		min-height:424px !important;
		height:424px !important;
	}

	/* Video info */
	#page .ed-video-wrapper .ed-video-info{
		min-height:400px;
	}
}