/* ---------------------------------------------------------------------
 * VARIABILI CSS GLOBALI
 * ------------------------------------------------------------------ */
:root {
    --ldgc-primary-color: #01C9C4;    /* movewithbrain */
    --ldgc-secondary-color: #D41566;  /* fitmia-g1/g2/g1g2 */
    --ldgc-tertiary-color: #F37D04;   /* runwithbrain */
    --ldgc-border-radius: 15px;
    --ldgc-glass-bg: rgba(255, 255, 255, 0.15);
    --ldgc-glass-border: rgba(255, 255, 255, 0.2);
    --ldgc-transition: all 0.3s ease;
}

/* ---------------------------------------------------------------------
 * MIXIN UTILITIES - Glassmorphism Effect
 * ------------------------------------------------------------------ */
.ldgc-glass {
    background: var(--ldgc-glass-bg);
    /* Fix Safari iOS: aggiungo -webkit-backdrop-filter */
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--ldgc-glass-border);
    border-radius: var(--ldgc-border-radius);
    transition: var(--ldgc-transition);
}

.ldgc-glass:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

/* ---------------------------------------------------------------------
 * LEARNDASH MY COURSES STYLING (UNIFIED)
 * Applicato sia a .ld-course-list-items che .ldgc-my-courses-wrapper
 * ------------------------------------------------------------------ */

/* Container principale */
.ld-course-list-items,
.ldgc-my-courses-wrapper {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* Effetto decorativo radiale */
.ld-course-list-items::before,
.ldgc-my-courses-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* Titoli dinamici con content CSS */
.ld-course-list-items[data-mycourses="true"]::after,
.ldgc-my-courses-wrapper::after {
    content: "Ciao! È un ottimo giorno per aver cura di te.\A Al momento stai seguendo:";
    white-space: pre-line;
    display: block;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
    color: white;
    line-height: 1.4;
}

/* Titoli tradizionali (classi) */
.ldgc-my-courses-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: white;
    text-align: left;
}

.ldgc-my-courses-subtitle {
    font-size: 16px;
    margin: 0 0 25px 0;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* Lista corsi (flex layout) */
.ldgc-my-courses-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Course Content */
.ldgc-course-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ---------------------------------------------------------------------
 * COURSE ITEMS STYLING (UNIFIED)
 * ------------------------------------------------------------------ */

/* Singolo elemento corso */
.ld-course-list-items .ld-course-list-item,
.ldgc-my-course-item {
    background: var(--ldgc-glass-bg) !important;
    /* Fix Safari iOS: aggiungo -webkit-backdrop-filter */
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--ldgc-glass-border) !important;
    border-radius: var(--ldgc-border-radius) !important;
    transition: var(--ldgc-transition);
    padding: 20px !important;
    margin-bottom: 15px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ld-course-list-items .ld-course-list-item:hover,
.ldgc-my-course-item:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

/* Info corso (contenuto principale) */
.ldgc-my-course-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

/* Titoli corso */
.ld-course-list-items .ld-course-list-item .ld-course-title,
.ldgc-my-course-name {
    color: white !important;
    font-weight: 600 !important;
    margin-bottom: 10px !important;
    background: var(--ldgc-primary-color);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 14px;
    white-space: nowrap;
    /* Fix Samsung Internet: uso max-content per compatibilità */
    min-width: max-content;
}

/* Link nei titoli */
.ld-course-list-items .ld-course-list-item .ld-course-title a {
    color: white !important;
    text-decoration: none !important;
    background: var(--ldgc-primary-color);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
}

.ld-course-list-items .ld-course-list-item .ld-course-title a:hover {
    background: rgba(1, 201, 196, 0.8) !important;
}

/* ---------------------------------------------------------------------
 * COLORI SPECIFICI PER CATEGORIE
 * ------------------------------------------------------------------ */

/* MoveWithBrain */
.ldgc-my-course-name.movewithbrain,
.ldgc-filter-btn[data-category="movewithbrain"] {
    background: var(--ldgc-primary-color) !important;
    border-color: var(--ldgc-primary-color) !important;
}

/* FitMia */
.ldgc-my-course-name.fitmia,
.ldgc-filter-btn[data-category="fitmia-g1"],
.ldgc-filter-btn[data-category="fitmia-g2"],
.ldgc-filter-btn[data-category="fitmia-g1g2"] {
    background: var(--ldgc-secondary-color) !important;
    border-color: var(--ldgc-secondary-color) !important;
}

/* RunWithBrain */
.ldgc-my-course-name.runwithbrain,
.ldgc-filter-btn[data-category="runwithbrain"] {
    background: var(--ldgc-tertiary-color) !important;
    border-color: var(--ldgc-tertiary-color) !important;
}

/* ---------------------------------------------------------------------
 * PROGRESS BAR STYLING
 * ------------------------------------------------------------------ */

/* Container progresso */
.ld-course-list-items .ld-progress {
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    height: 8px !important;
    margin: 10px 0 !important;
    width: 150px;
    margin-left: 20px;
}

/* Barra progresso */
.ld-course-list-items .ld-progress .ld-progress-bar {
    background: var(--ldgc-primary-color) !important;
    height: 100% !important;
    border-radius: 10px !important;
    transition: width 0.3s ease !important;
}

/* Percentuale progresso */
.ld-course-list-items .ld-progress-percentage,
.ldgc-my-course-progress {
    color: white !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    margin-left: 10px !important;
    min-width: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---------------------------------------------------------------------
 * PILL BUTTONS STYLING
 * ------------------------------------------------------------------ */

.ldgc-pill-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.ldgc-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ldgc-primary-color);
    color: #ffffff !important;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--ldgc-transition);
    line-height: 1;
}

.ldgc-pill-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.ldgc-pill-btn:hover,
.ldgc-pill-btn:focus {
    background: #019a96;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

/* ---------------------------------------------------------------------
 * FILTER SYSTEM
 * ------------------------------------------------------------------ */

/* Container filtri */
.ldgc-courses-filter,
.ldgc-filter-buttons {
    margin-bottom: 40px;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

/* Pulsanti filtro desktop */
.ldgc-filter-btn {
    background: var(--ldgc-primary-color);
    border: 2px solid var(--ldgc-primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: var(--ldgc-transition);
    text-decoration: none;
    display: inline-block;
    opacity: 0.7;
}

.ldgc-filter-btn:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ldgc-filter-btn.active {
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Dropdown mobile */
.ldgc-filter-dropdown {
    display: none;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

/* Rimuovi definizione duplicata - unificata sotto */

/* ---------------------------------------------------------------------
 * COURSE GRID LAYOUT
 * ------------------------------------------------------------------ */

/* Container generale */
.ldgc-custom-courses-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: #000000;
}

.ldgc-courses-container {
    position: relative;
}

/* Grid layout responsive */
.ldgc-courses-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
    justify-content: center;
}

.ldgc-courses-grid[data-columns="2"] {
    grid-template-columns: repeat(auto-fit, minmax(300px, 360px));
}

.ldgc-courses-grid[data-columns="3"] {
    grid-template-columns: repeat(auto-fit, minmax(280px, 360px));
}

.ldgc-courses-grid[data-columns="4"] {
    grid-template-columns: repeat(auto-fit, minmax(250px, 360px));
}

/* Slider layout (principalmente mobile) */
.ldgc-courses-slider {
    display: none;
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    -webkit-overflow-scrolling: touch;
}

.ldgc-courses-slider::-webkit-scrollbar {
    height: 8px;
}

.ldgc-courses-slider::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.ldgc-courses-slider::-webkit-scrollbar-thumb {
    background: var(--ldgc-primary-color);
    border-radius: 10px;
}

/* States per animazioni di filtro */
.ldgc-courses-grid.filtering {
    opacity: 0.6;
    pointer-events: none;
}

.ldgc-courses-grid.loaded {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

/* Utility per wishlist button */
.ldgc-wishlist-btn {
    width: 44px;
    height: 44px;
    border: 2px solid var(--ldgc-primary-color);
    background: var(--ldgc-primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--ldgc-transition);
    color: white;
}

.ldgc-wishlist-btn:hover {
    background: transparent;
    color: var(--ldgc-primary-color);
}

/* ---------------------------------------------------------------------
 * BUTTON COMPONENTS (per azioni corsi e lezioni)
 * ------------------------------------------------------------------ */

/* Button base styling */
.ldgc-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: var(--ldgc-transition);
    line-height: 1;
    min-width: 120px;
}

/* Primary button */
.ldgc-btn-primary {
    background: var(--ldgc-primary-color);
    color: white;
    border: 2px solid var(--ldgc-primary-color);
}

.ldgc-btn-primary:hover {
    background: #019a96;
    border-color: #019a96;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 201, 196, 0.3);
}

/* Secondary button */
.ldgc-btn-secondary {
    background: transparent;
    color: var(--ldgc-primary-color);
    border: 2px solid var(--ldgc-primary-color);
}

.ldgc-btn-secondary:hover {
    background: var(--ldgc-primary-color);
    color: white;
    text-decoration: none;
}

/* Buttons nelle azioni delle lezioni */
.ldgc-lesson-actions .ldgc-btn,
.ldgc-course-actions .ldgc-btn {
    width: 100%;
    text-align: center;
    transition: var(--ldgc-transition);
    align-items: center;
    gap: 10px;
    margin-top: auto;
	background: #01c9c4;
    color: white;
}



/* Liste aggiuntive per corsi */
.ldgc-courses-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

/* ---------------------------------------------------------------------
 * COURSE CARD COMPONENTS (per pagine corsi)
 * ------------------------------------------------------------------ */

/* Course Card - Design unificato */
.ldgc-course-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: var(--ldgc-transition);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
    max-width: 360px;
}

.ldgc-course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(1, 201, 196, 0.15);
    border-color: var(--ldgc-primary-color);
}

/* Course Title */



.ldgc-course-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}


.ldgc-course-title a {
    color: #000000; /* Testo titoli nero */
    text-decoration: none;
    transition: color 0.3s ease;
}

.ldgc-course-title a:hover {
    color: var(--ldgc-primary-color, #01C9C4);
}


/* Course Category */
.ldgc-course-category {
    display: inline-block;
    background: var(--ldgc-primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    text-decoration: none;
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Course Actions */
.ldgc-course-actions {
    margin-top: auto;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Course Image container */
.ldgc-course-image {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* Aspect ratio 1:1 */
    background-color: #f5f5f5;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.ldgc-course-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
    max-width: none !important;
    max-height: none !important;
}

.ldgc-course-card:hover .ldgc-course-image img {
    transform: scale(1.05);
}

/* ---------------------------------------------------------------------
 * LESSON CARD COMPONENTS (per pagine lezioni)
 * ------------------------------------------------------------------ */

/* Lesson Card - Design identico ai corsi ma per lezioni */
.ldgc-lesson-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: var(--ldgc-transition);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
    max-width: 360px;
    cursor: pointer;
}

/* Lesson Card Link (wrapper per link di navigazione) */
.ldgc-lesson-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: var(--ldgc-transition);
}

.ldgc-lesson-card-link:hover .ldgc-lesson-card {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(1, 201, 196, 0.15);
    border-color: var(--ldgc-primary-color);
}

/* Lesson Title */

.ldgc-lesson-title {
    font-weight: 700;
    line-height: 1.4;
    color: rgb(0, 0, 0);
    text-align: center;
    font-size: 18px !important;
    margin: 0px;
    padding: 25px 25px 0px;
    transition: color 0.3s ease;
}

.ldgc-lesson-title:hover {
    color: var(--ldgc-primary-color);
}

/* Lesson Category */
.ldgc-lesson-category {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--ldgc-card-accent, var(--ldgc-primary-color));
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Lesson Meta */
.ldgc-lesson-meta {
    padding: 0 15px;
    margin-bottom: 16px;
    margin-top: 16px!important;
    color: #666;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Lesson Actions */
.ldgc-lesson-actions {
    padding: 12px 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Lesson Image container */
.ldgc-lesson-image {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    background-color: #f5f5f5;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.ldgc-lesson-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
    max-width: none !important;
    max-height: none !important;
}

.ldgc-lesson-card-link:hover .ldgc-lesson-image img {
    transform: scale(1.05);
}

/* ---------------------------------------------------------------------
 * GRID LAYOUTS (per organizzazione contenuti)
 * ------------------------------------------------------------------ */

/* Lessons Grid - Layout specifico per lezioni */
.ldgc-lessons-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
    justify-content: center;
}

.ldgc-lessons-grid[data-columns="2"] {
    grid-template-columns: repeat(auto-fit, minmax(300px, 360px));
}

.ldgc-lessons-grid[data-columns="3"] {
    grid-template-columns: repeat(auto-fit, minmax(280px, 360px));
}

.ldgc-lessons-grid[data-columns="4"] {
    grid-template-columns: repeat(auto-fit, minmax(250px, 360px));
}

/* Layout Grid generico */
.ldgc-layout-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* ---------------------------------------------------------------------
 * CATEGORY SPECIFIC STYLING
 * ------------------------------------------------------------------ */

/* Stili specifici per categoria MoveWithBrain */
.ldgc-categories-movewithbrain .ldgc-btn-primary,
.ldgc-categories-movewithbrain .ldgc-course-category {
    background: var(--ldgc-primary-color) !important;
    border-color: var(--ldgc-primary-color) !important;
    color: white !important;
}

/* Stili specifici per categoria FitMia (tutte le varianti) */
.ldgc-categories-fitmia-g1 .ldgc-btn-primary,
.ldgc-categories-fitmia-g2 .ldgc-btn-primary,
.ldgc-categories-fitmia-g1g2 .ldgc-btn-primary,
.ldgc-categories-fitmia-g1g2 .ldgc-btn,
.ldgc-categories-fitmia-g1 .ldgc-course-category,
.ldgc-categories-fitmia-g2 .ldgc-course-category,
.ldgc-categories-fitmia-g1g2 .ldgc-course-category {
    background: var(--ldgc-secondary-color) !important;
    border-color: var(--ldgc-secondary-color) !important;
    color: white !important;
}

/* Stili specifici per categoria RunWithBrain */
.ldgc-categories-runwithbrain .ldgc-btn-primary,
.ldgc-categories-runwithbrain .ldgc-course-category {
    background: var(--ldgc-tertiary-color) !important;
    border-color: var(--ldgc-tertiary-color) !important;
    color: white !important;
}

/* ---------------------------------------------------------------------
 * LESSON ADDITIONAL COMPONENTS (classi aggiuntive per le lezioni)
 * ------------------------------------------------------------------ */

/* Lesson Content */
.ldgc-lesson-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Lesson Excerpt */
.ldgc-lesson-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Lesson Duration, Level, Intensity */
.ldgc-lesson-duration,
.ldgc-lesson-level,
.ldgc-lesson-intensity {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

.ldgc-lesson-duration i,
.ldgc-lesson-level i,
.ldgc-lesson-intensity i {
    color: var(--ldgc-primary-color);
    font-size: 14px;
}

/* Focus state per lesson card link */
.ldgc-lesson-card-link:focus {
    outline: 2px solid var(--ldgc-primary-color);
    outline-offset: 2px;
    border-radius: 15px;
}

/* Hover per lesson card link */
.ldgc-lesson-card-link:hover {
    text-decoration: none;
    color: inherit;
}

/* ---------------------------------------------------------------------
 * UTILITY CLASSES (classi di utilità per contatori e prezzi)
 * ------------------------------------------------------------------ */

/* Lessons Count e Course Price */
.ldgc-lessons-count,
.ldgc-course-price {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.ldgc-lessons-count svg,
.ldgc-course-price svg {
    color: var(--ldgc-primary-color);
    width: 16px;
    height: 16px;
}

/* ---------------------------------------------------------------------
 * SLIDER SYSTEM (sistema completo per slider di corsi)
 * ------------------------------------------------------------------ */

/* Slider Container */
.ldgc-slider-container {
    overflow: hidden;
    width: 100%;
    position: relative;
}

.ldgc-slide {
    flex: 0 0 100%;
    padding: 0 10px;
}

/* Slider Track */
.ldgc-slider-track {
    display: flex;
    transition: transform 0.3s ease;
    will-change: transform;
}

/* Slider Controls - Solo su mobile, senza hover */
.ldgc-slider-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: none; /* Nascoste su desktop */
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
    padding: 0 10px;
}

/* Slider Previous/Next Buttons */
.ldgc-slider-prev,
.ldgc-slider-next {
    background: rgba(255, 255, 255, 0.95);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
    color: var(--ldgc-primary-color);
    /* Fix Safari iOS: aggiungo -webkit-backdrop-filter */
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ldgc-slider-prev:hover,
.ldgc-slider-next:hover {
    background: var(--ldgc-primary-color);
    color: white;
    transform: scale(1.1);
}

.ldgc-slider-prev:active,
.ldgc-slider-next:active {
    transform: scale(0.95);
}

.ldgc-slider-prev:focus,
.ldgc-slider-next:focus {
    outline: 2px solid var(--ldgc-primary-color);
    outline-offset: 2px;
}

/* Slider Button Icons */
.ldgc-slider-prev svg,
.ldgc-slider-next svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

/* Slider Button Positioning */
.ldgc-slider-prev {
    margin-left: 5px;
}

.ldgc-slider-next {
    margin-right: 5px;
}

/* Slider Dots - Migliorati e più visibili */
.ldgc-slider-dots {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
    padding: 10px 0;
}

.ldgc-slider-dot {
    width: 12px;
    height: 12px;
    background: #d1d5db;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    opacity: 0.7;
    padding: 5px;
}

.ldgc-slider-dot:hover {
    background: var(--ldgc-primary-color);
    opacity: 0.9;
    transform: scale(1.1);
}

.ldgc-slider-dot.active {
    background: var(--ldgc-primary-color);
    transform: scale(1.3);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(1, 201, 196, 0.4);
    opacity: 1;
}

/* ---------------------------------------------------------------------
 * SLIDER ITEMS STYLING (formattazione specifica per elementi dentro slider)
 * ------------------------------------------------------------------ */

/* Slider Item Container */
.ldgc-slider-item {
    flex: 0 0 auto;
    width: 280px;
    margin-right: 20px;
    scroll-snap-align: start;
}

/* Lesson Cards nel contesto Slider */
.ldgc-slider-item .ldgc-lesson-card {
    width: 100%;
    min-height: 420px;
}

/* Lesson Title nel Slider - Dimensioni ottimizzate */
.ldgc-slider-item .ldgc-lesson-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 12px 15px 8px 15px;
    line-height: 1.3;
    text-decoration: none;
    display: block;
    transition: var(--ldgc-transition);
    /* Limita a 2 righe con ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 40px;
}

.ldgc-slider-item .ldgc-lesson-title:hover {
    color: var(--ldgc-primary-color);
}

/* Lesson Category nel Slider - Posizionamento ottimizzato */
.ldgc-slider-item .ldgc-lesson-category {
    display: inline-block;
    background: var(--ldgc-secondary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 8px 0 5px 15px;
    text-decoration: none;
    position: relative;
    top: 0;
    right: 0;
}

/* Course Cards nel contesto Slider */
.ldgc-slider-item .ldgc-course-card {
    width: 100%;
    min-height: 380px;
}

/* Course Title nel Slider */
.ldgc-slider-item .ldgc-course-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 12px 15px 8px 15px;
    line-height: 1.3;
    text-decoration: none;
    display: block;
    transition: var(--ldgc-transition);
    /* Limita a 2 righe con ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 44px;
}

.ldgc-slider-item .ldgc-course-title:hover {
    color: var(--ldgc-primary-color);
}

/* Course Category nel Slider */
.ldgc-slider-item .ldgc-course-category {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--ldgc-primary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-decoration: none;
}

/* Slider Content padding adjustments */
.ldgc-slider-item .ldgc-lesson-content,
.ldgc-slider-item .ldgc-course-content {
    padding: 10px 15px 15px 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Slider Image adjustments */
.ldgc-slider-item .ldgc-lesson-image,
.ldgc-slider-item .ldgc-course-image {
    padding-bottom: 65%; /* Aspect ratio più compatto per slider */
}

/* Slider Actions adjustments */
.ldgc-slider-item .ldgc-lesson-actions,
.ldgc-slider-item .ldgc-course-actions {
    padding: 10px 15px;
    margin-top: auto;
}

/* Slider Button sizing */
.ldgc-slider-item .ldgc-btn {
    font-size: 13px;
    padding: 10px 18px;
    min-width: 100px;
}


/* ============================================================================
 * MY COURSES SHORTCODE - Stile per [ldgc_my_courses]
 * ============================================================================ */
 .ldgc-my-courses {
    margin: 0 auto;
}
.ldgc-greeting {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}
.ldgc-following {
    font-size: 24px;
    color: white;
    margin-bottom: 20px;
}
.ldgc-courses-list {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.ldgc-course-item {
    display: block;
    padding: 20px;
    border-radius: 12px;
    color: white;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.ldgc-course-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}
.ldgc-course-blue {
    background: linear-gradient(135deg, #00b4d8 0%, #0077b6 100%);
}
.ldgc-course-orange {
    background: linear-gradient(135deg, #f48c06 0%, #e85d04 100%);
}
.ldgc-course-progress {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}
.ldgc-progress-bar {
    flex-grow: 1;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-right: 10px;
}
.ldgc-progress-fill {
    height: 100%;
    width: var(--progress);
    background-color: white;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.ldgc-progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 40px;
    text-align: right;
    color: white;
}
.ldgc-no-courses {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

@media (max-width: 768px) {
    /* My courses responsive */
    .ldgc-courses-list {
        grid-template-columns: 1fr;
    }
    .ldgc-greeting {
        font-size: 1.3rem;
    }

    /* Filtri lezioni responsive */
    .ldgc-lessons-filter {
        padding: 20px;
        margin-bottom: 20px;
    }

    .ldgc-filter-row {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .ldgc-filter-group {
        min-width: auto;
        width: 100%;
    }

    /* Filtri responsive unificati */
    .ldgc-filter-select,
    .ldgc-filter-input {
        padding: 14px 16px;
        font-size: 16px; /* Previene zoom su iOS */
    }

    .ldgc-filter-select:not([multiple]) {
        padding-right: 50px;
    }

    /* Multiselect avanzato responsive */
    .ldgc-multiselect-container {
        min-height: 52px;
    }

    .ldgc-multiselect-display {
        padding: 14px 16px;
    }

    .ldgc-multiselect-placeholder {
        font-size: 16px;
    }

    .ldgc-multiselect-dropdown {
        max-height: 280px;
    }

    .ldgc-multiselect-options {
        max-height: 220px;
    }

    .ldgc-multiselect-option-text {
        padding: 14px 16px;
        font-size: 16px;
    }

    .ldgc-multiselect-search-input {
        font-size: 16px;
        padding: 12px 14px;
    }

    /* Messaggio nessuna lezione responsive */
    .ldgc-no-lessons {
        padding: 30px 15px;
        font-size: 14px;
        margin: 15px 0;
    }

    .ldgc-no-lessons::before {
        font-size: 36px;
        margin-bottom: 10px;
    }

    .ldgc-filter-reset {
        margin-top: 10px;
        padding: 14px 20px;
        width: 100%;
    }

    /* Container principali */
    .ld-course-list-items,
    .ldgc-my-courses-wrapper {
        padding: 20px;
        margin: 15px 0;
    }

    /* Titoli più piccoli */
    .ld-course-list-items[data-mycourses="true"]::after,
    .ldgc-my-courses-wrapper::after {
        font-size: 20px;
    }

    .ldgc-my-courses-title {
        font-size: 20px;
    }

    /* Layout elementi corso */
    .ld-course-list-items .ld-course-list-item,
    .ldgc-my-course-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px;
        padding: 15px !important;
    }

    /* Info corso mobile */
    .ldgc-my-course-info {
        width: 100%;
        justify-content: space-between;
    }

    /* Progress bar mobile */
    .ld-course-list-items .ld-progress {
        width: 100% !important;
        margin-left: 0 !important;
    }

    .ld-course-list-items .ld-progress-percentage,
    .ldgc-my-course-progress {
        margin-left: 0 !important;
        align-self: flex-end;
    }

    /* Pill buttons mobile */
    .ldgc-pill-btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    /* Filter mobile */
    .ldgc-filter-buttons {
        display: none;
    }

    .ldgc-filter-dropdown {
        display: block;
    }

    /* Slider mobile */
    .ldgc-courses-grid {
        display: none;
    }

    .ldgc-courses-slider {
        display: block;
        gap: 15px;
        padding: 10px 0;
    }

    /* Course e Lesson cards responsive */
    .ldgc-course-card,
    .ldgc-lesson-card {
        max-width: 100%;
        margin: 0 auto;
    }

    /* Lessons grid responsive */
    .ldgc-lessons-grid,
    .ldgc-layout-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Course images responsive */
    .ldgc-course-image,
    .ldgc-lesson-image {
        padding-bottom: 75%; /* Aspect ratio più adatto al mobile */
    }

    /* Mostra controlli slider solo su mobile */
    .ldgc-slider-controls {
        display: flex;
    }

    .ldgc-slider-controls .ldgc-slider-prev,
    .ldgc-slider-controls .ldgc-slider-next {
        width: 45px;
        height: 45px;
        border-width: 2px;
    }

    /* Slider Items responsive mobile */
    .ldgc-slider-item {
        width: 260px;
        margin-right: 15px;
    }

    .ldgc-slider-item .ldgc-lesson-card,
    .ldgc-slider-item .ldgc-course-card {
        min-height: auto;
    }

    .ldgc-slider-item .ldgc-lesson-title,
    .ldgc-slider-item .ldgc-course-title {
        font-size: 14px;
        margin: 10px 12px 6px 12px;
        min-height: 36px;
    }

    .ldgc-slider-item .ldgc-lesson-category {
        font-size: 9px;
        padding: 3px 6px;
        margin: 6px 0 4px 12px;
    }

    .ldgc-slider-item .ldgc-course-category {
        font-size: 9px;
        padding: 2px 6px;
        top: 6px;
        right: 6px;
    }
}

/* Category-specific colors for courses */
.ldgc-course-movewithbrain {
    background: linear-gradient(135deg, #01C9C4 0%, #00a8a3 100%) !important;
}
.ldgc-course-fitmia {
    background: linear-gradient(135deg, #D41566 0%, #b01255 100%) !important;
}
.ldgc-course-runwithbrain {
    background: linear-gradient(135deg, #F37D04 0%, #d16803 100%) !important;
}

/* ---------------------------------------------------------------------
 * ELEMENTI DA NASCONDERE
 * ------------------------------------------------------------------ */

.ld-course-list-items .ld-course-excerpt,
.ld-course-list-items .ld-course-meta {
    display: none !important;
}

/* ---------------------------------------------------------------------
 * LESSONS FILTER SYSTEM
 * ------------------------------------------------------------------ */

/* Container filtri lezioni */
.ldgc-lessons-filter {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.ldgc-lessons-filter h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

/* Pannello filtri */
.ldgc-filter-panel {
    width: 100%;
}

.ldgc-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: end;
}

/* Gruppo singolo filtro */
.ldgc-filter-group {
    display: flex;
    flex-direction: column;
    min-width: 180px;
    flex: 1;
}

.ldgc-filter-group label {
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Select e Input filtri - DEFINIZIONE UNIFICATA */
.ldgc-filter-select,
.ldgc-filter-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--ldgc-transition);
}

.ldgc-filter-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2301C9C4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 45px;
}

.ldgc-filter-select:focus,
.ldgc-filter-input:focus {
    outline: none;
    border-color: var(--ldgc-primary-color);
    box-shadow: 0 0 0 3px rgba(1, 201, 196, 0.1);
}

.ldgc-filter-select:hover,
.ldgc-filter-input:hover {
    border-color: var(--ldgc-primary-color);
}

/* Pulsante reset */
.ldgc-filter-reset {
    padding: 12px 20px;
    border: 2px solid #6c757d;
    background: transparent;
    color: #6c757d;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ldgc-transition);
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ldgc-filter-reset:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Multi-Select Avanzato - Ispirato a Mobiscroll */
.ldgc-multiselect-hidden {
    display: none !important;
}

/* Container principale */
.ldgc-multiselect-container {
    position: relative;
    width: 100%;
    min-height: 48px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    transition: var(--ldgc-transition);
    cursor: pointer;
}

.ldgc-multiselect-container:hover {
    border-color: var(--ldgc-primary-color);
}

.ldgc-multiselect-container.open {
    border-color: var(--ldgc-primary-color);
    box-shadow: 0 0 0 3px rgba(1, 201, 196, 0.1);
}

.ldgc-multiselect-container.has-selection {
    border-color: var(--ldgc-primary-color);
}

/* Display area con placeholder e tag */
.ldgc-multiselect-display {
    padding: 12px 16px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ldgc-multiselect-placeholder {
    color: #999;
    font-size: 14px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ldgc-multiselect-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s ease;
    user-select: none;
    flex-shrink: 0;
}

.ldgc-multiselect-container.open .ldgc-multiselect-arrow {
    transform: rotate(180deg);
}

/* Container per i tag selezionati */
.ldgc-multiselect-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    flex: 1;
}

/* Tag individuali */
.ldgc-multiselect-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ldgc-primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    animation: ldgc-tag-appear 0.2s ease;
}

@keyframes ldgc-tag-appear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ldgc-multiselect-tag-text {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ldgc-multiselect-tag-remove {
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ldgc-multiselect-tag-remove:hover {
    opacity: 1;
}

/* Dropdown container */
.ldgc-multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--ldgc-primary-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 320px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 4px;
}

.ldgc-multiselect-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Barra di ricerca */
.ldgc-multiselect-search {
    padding: 12px 16px;
    border-bottom: 1px solid #e1e5e9;
    background: #f8f9fa;
}

.ldgc-multiselect-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.ldgc-multiselect-search-input:focus {
    border-color: var(--ldgc-primary-color);
    box-shadow: 0 0 0 2px rgba(1, 201, 196, 0.1);
}

/* Lista opzioni */
.ldgc-multiselect-options {
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--ldgc-primary-color) #f0f0f0;
}

.ldgc-multiselect-options::-webkit-scrollbar {
    width: 6px;
}

.ldgc-multiselect-options::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.ldgc-multiselect-options::-webkit-scrollbar-thumb {
    background: var(--ldgc-primary-color);
    border-radius: 3px;
}

.ldgc-multiselect-options::-webkit-scrollbar-thumb:hover {
    background: var(--ldgc-primary-color-dark, #017c77);
}

/* Singola opzione */
.ldgc-multiselect-option {
    display: block;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.ldgc-multiselect-option:hover {
    background: #f8f9fa;
}

.ldgc-multiselect-option input[type="checkbox"] {
    display: none;
}

.ldgc-multiselect-option-text {
    display: block;
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
    position: relative;
    padding-left: 44px;
    transition: all 0.2s ease;
}

.ldgc-multiselect-option:hover .ldgc-multiselect-option-text {
    background: #f8f9fa;
}

/* Checkmark nascosto di default */
.ldgc-multiselect-checkmark {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ldgc-primary-color);
    font-size: 16px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Quando checkbox è selezionato */
.ldgc-multiselect-option input[type="checkbox"]:checked ~ .ldgc-multiselect-option-text {
    background: rgba(1, 201, 196, 0.1);
    color: var(--ldgc-primary-color);
    font-weight: 600;
}

.ldgc-multiselect-option input[type="checkbox"]:checked ~ .ldgc-multiselect-checkmark {
    opacity: 1;
}

/* Opzioni filtrate (nascoste) */
.ldgc-multiselect-option.hidden {
    display: none;
}

/* Descrizione filtri */
.ldgc-filter-description {
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-left: 3px solid var(--ldgc-primary-color);
    border-radius: 4px;
    color: #666;
}

/* Messaggio nessuna lezione */
.ldgc-no-lessons {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 20px 0;
    border: 2px solid #e1e5e9;
}

.ldgc-no-lessons::before {
    content: '📚';
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
    opacity: 0.6;
}



/* Container lezioni */
.ldgc-lessons-container {
    position: relative;
}

/* Loading state per filtri */
.ldgc-lessons-container.filtering .ldgc-lessons-grid {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.ldgc-lessons-container .ldgc-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.ldgc-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--ldgc-primary-color);
    border-radius: 50%;
    animation: ldgc-spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Stati filtri attivi */
.ldgc-filter-select.has-value,
.ldgc-filter-input.has-value {
    border-color: var(--ldgc-primary-color);
    background-color: rgba(1, 201, 196, 0.05);
}

/* Contatore risultati */
.ldgc-results-count {
    margin: 15px 0;
    color: #666;
    font-size: 14px;
    font-style: italic;
}

/* Notifiche filtri */
.ldgc-filter-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 9999;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    border-left: 4px solid var(--ldgc-primary-color);
    max-width: 300px;
    font-size: 14px;
    font-weight: 500;
}

.ldgc-filter-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.ldgc-filter-notification-success {
    border-left-color: #28a745;
    color: #155724;
}

.ldgc-filter-notification-error {
    border-left-color: #dc3545;
    color: #721c24;
}

.ldgc-filter-notification-info {
    border-left-color: #17a2b8;
    color: #0c5460;
}