/* ==========================================================================
   DYNAMIC DASHBOARD FOR ELEMENTOR - ARCHIVO DE ESTILOS PRINCIPALES
   ========================================================================== */

/* CONTENEDOR GENERAL */
.dde-dashboard-container {
    display: flex;
    gap: 30px;
    align-items: stretch;
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

/* SIDEBAR (MENÚ LATERAL) */
.dde-dashboard-sidebar {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: sticky;
    top: 20px;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

/* Ocultar barra de scroll del sidebar pero permitir scroll si es necesario */
.dde-dashboard-sidebar::-webkit-scrollbar {
    width: 4px;
}
.dde-dashboard-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.dde-dashboard-sidebar::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 4px;
}

/* Cabecera del sidebar (Desktop) */
.dde-sidebar-header {
    display: block;
    width: 100%;
    margin-bottom: 25px;
    box-sizing: border-box;
}

.dde-sidebar-close-btn {
    display: none !important; /* Forzar ocultamiento absoluto en escritorio */
}

.dde-dashboard-logo {
    display: block;
    width: 100%;
    margin-bottom: 15px;
}

.dde-dashboard-logo img {
    display: inline-block;
    max-width: 100%;
    height: auto;
}

.dde-sidebar-menu-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* ÍTEM DE MENÚ */
.dde-menu-item {
    display: flex;
    align-items: center;
    text-decoration: none;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.dde-menu-item .dde-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.dde-menu-item .dde-item-text {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Iconos SVG */
.dde-svg-icon svg {
    display: block;
    max-width: 100%;
    max-height: 100%;
    fill: currentColor;
}

.dde-svg-icon svg path {
    transition: fill 0.25s ease;
}

/* ÁREA DE CONTENIDO (DERECHA) */
.dde-dashboard-content {
    flex-grow: 1;
    flex-basis: 0;
    min-width: 0;
    box-sizing: border-box;
}

.dde-tab-content-wrapper {
    display: none;
    box-sizing: border-box;
}

.dde-tab-content-wrapper.dde-tab-active {
    display: block;
}

/* MENÚ DE PERFIL DE USUARIO */
.dde-profile-widget-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
}

.dde-profile-trigger {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    gap: 10px;
    outline: none;
}

.dde-profile-greeting {
    font-weight: 500;
}

.dde-profile-avatar-img {
    display: block;
    object-fit: cover;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.dde-profile-trigger:hover .dde-profile-avatar-img {
    transform: scale(1.05);
}

.dde-profile-arrow-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    opacity: 0.7;
    transition: transform 0.25s ease;
}

.dde-profile-widget-wrapper.dde-dropdown-open .dde-profile-arrow-indicator {
    transform: rotate(180deg);
}

/* Desplegable del Perfil */
.dde-profile-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    box-sizing: border-box;
    z-index: 9999;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-width: 90vw; /* Prevent overflow on mobile */
}

.dde-profile-widget-wrapper.dde-dropdown-open .dde-profile-dropdown-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dde-profile-dropdown-menu li {
    margin: 0;
    padding: 0;
    width: 100%;
    transition: background-color 0.2s ease;
}

.dde-profile-dropdown-menu a {
    display: block;
    width: 100%;
    text-decoration: none;
    box-sizing: border-box;
    transition: color 0.2s ease;
}

/* BOTÓN DE MENÚ MÓVIL Y OVERLAY (OCULTOS POR DEFECTO EN ESCRITORIO) */
.dde-mobile-toggle-btn {
    display: none;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.dde-mobile-toggle-btn:active {
    transform: scale(0.95);
}

.dde-offcanvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99998;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.dde-dashboard-container.dde-sidebar-open .dde-offcanvas-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* MENSAJES DE ERROR / ADVERTENCIA */
.dde-access-denied-message,
.dde-error-message,
.dde-no-content-warning {
    padding: 20px;
    border-radius: 8px;
    background-color: #fff6f6;
    border: 1px solid #fecaca;
    color: #b91c1c;
    text-align: center;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.dde-no-content-warning {
    background-color: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

/* ANIMACIONES DE ENTRADA */
@keyframes ddeFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dde-transition-fadein .dde-tab-content-wrapper.dde-tab-active {
    animation: ddeFadeIn 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes ddeSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dde-transition-slideup .dde-tab-content-wrapper.dde-tab-active {
    animation: ddeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}


/* ==========================================================================
   DISEÑO ADAPTABLE (TABLETS Y MÓVILES)
   ========================================================================== */
@keyframes ddeGlowPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(230, 126, 34, 0.6);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(230, 126, 34, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(230, 126, 34, 0);
    }
}

@media (max-width: 1024px) {
    /* Mostrar botón de menú móvil como botón flotante llamativo en la izquierda */
    .dde-mobile-toggle-btn {
        display: flex !important;
        position: fixed;
        left: 24px;
        bottom: 24px;
        z-index: 99999;
        justify-content: center;
        align-items: center;
        border: none;
        cursor: pointer;
        /* Estilos base por defecto */
        background-color: #e67e22;
        color: #ffffff;
        box-shadow: 0 8px 24px rgba(230, 126, 34, 0.4);
        transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    }

    .dde-mobile-toggle-btn .dde-mobile-btn-text {
        display: none; /* circular icon-only layout */
    }

    .dde-mobile-toggle-btn .dde-mobile-btn-icon {
        margin: 0;
        display: inline-flex;
    }

    .dde-mobile-toggle-btn .dde-mobile-btn-icon i {
        font-size: 20px;
    }

    .dde-mobile-toggle-btn .dde-mobile-btn-icon svg {
        fill: none;
        stroke: currentColor;
        width: 24px;
        height: 24px;
        display: block;
    }

    .dde-mobile-toggle-btn.dde-pulse-animation {
        animation: ddeGlowPulse 2.2s infinite;
    }

    .dde-mobile-toggle-btn:hover {
        transform: translateY(-3px) scale(1.06);
        box-shadow: 0 12px 28px rgba(230, 126, 34, 0.55);
    }

    /* Convertir el sidebar en panel flotante off-canvas de 80% de ancho */
    .dde-dashboard-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important; /* Desplazado completamente a la izquierda */
        width: 80vw !important;  /* Ocupa el 80% de la pantalla */
        height: 100vh !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        z-index: 99999;
        box-shadow: 15px 0 45px rgba(0, 0, 0, 0.15);
        padding: 25px 20px;
        overflow: visible !important; /* Permitir ver el botón cerrar flotante fuera del drawer */
        box-sizing: border-box;
        transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .dde-sidebar-menu-wrapper {
        overflow-y: auto;
        flex-grow: 1;
        max-height: calc(100vh - 120px); /* Evitar desbordamiento vertical */
    }

    /* Cabecera del sidebar (Logo) visible en móvil */
    .dde-sidebar-header {
        display: block;
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        padding-bottom: 15px;
        margin-bottom: 15px;
        box-sizing: border-box;
    }

    /* Botón de cierre móvil (X) flotando a la derecha fuera del drawer */
    .dde-sidebar-close-btn {
        display: flex !important;
        position: absolute;
        top: 20px;
        right: -62px; /* Flota justo al lado del drawer sobre el overlay */
        width: 48px;
        height: 48px;
        justify-content: center;
        align-items: center;
        background-color: #2ecc71; /* verde por defecto */
        color: #ffffff !important;
        border: none;
        border-radius: 8px; /* rounded square */
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        cursor: pointer;
        transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
        box-sizing: border-box;
        z-index: 100000;
    }

    .dde-sidebar-close-btn:hover {
        background-color: #27ae60;
        transform: scale(1.08);
    }

    .dde-close-icon {
        font-size: 28px;
        font-weight: 300;
        line-height: 1;
        display: inline-block;
        color: #ffffff !important;
    }

    .dde-close-svg {
        display: inline-flex;
        width: 20px;
        height: 20px;
    }

    .dde-close-svg svg {
        width: 100%;
        height: 100%;
        fill: currentColor;
    }

    .dde-dashboard-logo {
        max-width: 50%;
        margin-bottom: 0;
    }

    /* Cuando el menú móvil está abierto */
    .dde-dashboard-container.dde-sidebar-open .dde-dashboard-sidebar {
        left: 0 !important;
    }

    /* Forzar al contenedor del dashboard a ser una sola columna */
    .dde-dashboard-container {
        flex-direction: column;
        gap: 15px;
    }

    /* Adaptar los ítems del menú off-canvas para que sean legibles y táctiles */
    .dde-menu-item {
        padding: 14px 20px;
        margin-bottom: 8px;
    }
}

@media (max-width: 768px) {
    .dde-dashboard-sidebar {
        width: 80vw;
    }
}

@media (max-width: 480px) {
    .dde-dashboard-sidebar {
        width: 85vw;
    }
    /* Reducir el offset del botón de cierre en pantallas muy pequeñas para no salirse de pantalla */
    .dde-dashboard-sidebar .dde-sidebar-close-btn {
        right: 15px; /* En pantallas extremadamente chicas se posiciona adentro a la derecha */
        box-shadow: none;
    }
}

/* ==========================================================================
   WIDGET CURSOS LEARNDASH ACADEMY
   ========================================================================== */
.dde-courses-widget-container {
    width: 100%;
    box-sizing: border-box;
}

/* Paginador Centrado */
.dde-courses-pagination-header,
.dde-courses-pagination-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.dde-courses-pagination-header {
    margin-bottom: 25px;
}

.dde-courses-pagination-footer {
    margin-top: 25px;
}

.dde-pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    background-color: #f8f9fa;
    color: #2c3e50;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    padding: 0;
}

.dde-pagination-btn:hover {
    background-color: #e67e22;
    color: #ffffff;
    border-color: #e67e22;
    transform: scale(1.05);
}

.dde-pagination-btn.dde-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.dde-pagination-info {
    font-size: 13px;
    font-weight: 700;
    color: #7f8c8d;
    letter-spacing: 0.5px;
}

/* Rejilla de Cursos */
.dde-courses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Tarjeta de Curso */
.dde-course-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
    border: 1px solid #f1f5f9;
    position: relative;
    box-sizing: border-box;
}

.dde-course-card.dde-page-hidden {
    display: none !important;
}



/* Imagen del Curso */
.dde-course-card-image-wrapper {
    position: relative;
    width: 100%;
    overflow: visible; /* Permitir desbordamiento del botón de flecha */
    box-sizing: border-box;
}

.dde-course-card-image {
    width: 100%;
    height: 240px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.5s ease;
}



/* Badge Inscrito */
.dde-course-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: #0073aa;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 5px 11px;
    border-radius: 4px;
    z-index: 10;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Flecha Naranja Circular */
.dde-course-card-arrow {
    position: absolute;
    bottom: -20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e67e22;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(230, 126, 34, 0.35);
    z-index: 15;
    text-decoration: none;
    transition: background-color 0.25s ease, transform 0.25s ease;
    border: none;
    outline: none;
}

.dde-course-card-arrow i {
    font-size: 13px;
    margin: 0;
}



/* Contenido de la Tarjeta */
.dde-course-card-content {
    padding: 24px 20px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    box-sizing: border-box;
}

.dde-course-card-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 14px;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dde-course-card-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}



/* Progreso */
.dde-course-progress-container {
    margin-bottom: 12px;
    width: 100%;
}

.dde-course-progress-text {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.dde-course-progress-percentage {
    font-size: 11px;
    font-weight: 700;
    color: #27ae60;
    letter-spacing: 0.3px;
}

.dde-course-progress-bar-bg {
    width: 100%;
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.dde-course-progress-bar-fill {
    height: 100%;
    background-color: #2ecc71;
    border-radius: 3px;
    transition: width 0.35s ease;
}

/* Última actividad */
.dde-course-last-activity {
    font-size: 10px;
    color: #7f8c8d;
    margin-bottom: 18px;
    font-weight: 500;
}

/* Botón Continuar Estudio */
.dde-course-card-btn {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #1b4f72;
    color: #ffffff;
    text-decoration: none;
    padding: 11px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 6px;
    box-sizing: border-box;
    transition: background-color 0.25s ease, transform 0.25s ease;
    margin-top: auto;
    text-transform: none;
    border: none;
    cursor: pointer;
}

.dde-course-card-btn:hover {
    background-color: #153d58;
}
