:root {
    --cc-primary: #8eab9a;
    --cc-primary-text: #fff;
    --cc-dark: #111;
    --cc-light: #f6f6f6;
    --cc-border: #e8e8e8;
}

/*
|--------------------------------------------------------------------------
| WRAPPER
|--------------------------------------------------------------------------
*/

.cc-wrapper {
    width: 100%;
}

/*
|--------------------------------------------------------------------------
| FILTRO + TITOLO ANNO
|--------------------------------------------------------------------------
*/

.container-filter {
    width: 100%;
    margin-bottom: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.cc-current-year-title {
    margin: 0;
    font-size: 30px;
    line-height: 1;
    font-weight: 700;
}

.cc-top-filters {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 0;
}

#cc-search,
#cc-year-filter {
    height: 46px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid #dcdcdc;
    background: #fff;
    font-size: 16px;
}

#cc-search {
    min-width: 260px;
}

#cc-year-filter {
    width: 160px;
    min-height: 48px;
    font-weight: 700;
    appearance: auto;
}

/*
|--------------------------------------------------------------------------
| CONTROLLI VISTA
|--------------------------------------------------------------------------
*/

.cc-calendar-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0;
}

.cc-view-filter {
    min-height: 44px;
    border: 1px solid #eee;
    background: #f7f7f7;
    color: var(--cc-dark);
    padding: 0 18px;
    cursor: pointer;
    font-weight: 700;
    border-radius: 0;
    transition: .25s ease;
}

.cc-view-filter.active,
.cc-view-filter:hover {
    background: var(--cc-primary);
    color: var(--cc-primary-text);
    border-color: var(--cc-primary);
}

/*
|--------------------------------------------------------------------------
| ANNO
|--------------------------------------------------------------------------
*/

.cc-year-group {
    display: none;
}

/* Nasconde il vecchio titolo anno dentro il calendario */
.cc-year-title {
    display: none;
}

/*
|--------------------------------------------------------------------------
| SLIDER CUSTOM
|--------------------------------------------------------------------------
*/

.cc-slider-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin: 10px 0 24px;
}

.cc-slider-current-label {
    font-size: 18px;
    font-weight: 800;
    color: var(--cc-primary);
    min-height: 24px;
}

.cc-now-button {
    min-width: auto;
    height: 36px;
    padding: 0 20px;
    border-radius: 0;
    border: 1px solid var(--cc-border);
    background: #fff;
    color: var(--cc-dark);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    line-height: 36px;
    transition: .25s ease;
}

.cc-now-button:hover {
    background: var(--cc-primary);
    border-color: var(--cc-primary);
    color: var(--cc-primary-text);
}

.cc-slider-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 0;
}

.cc-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--cc-border);
    background: #fff;
    color: var(--cc-dark);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: .25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
}

.cc-slider-arrow:hover {
    background: var(--cc-primary);
    color: var(--cc-primary-text);
    border-color: var(--cc-primary);
}

.cc-prev {
    left: 0;
}

.cc-next {
    right: 0;
}

.cc-slider-dots {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

button.cc-dot {
    margin: 12px;
    padding: 0;
    min-width: 25px;
    min-height: 25px;
    border-radius: 100%;
    border: 1px solid var(--cc-border);
    background: #fff;
    cursor: pointer;
}

.cc-dot.is-near {
    display: block;
}

.cc-dot.active {
    display: block;
    background: var(--cc-primary);
}

/*
|--------------------------------------------------------------------------
| CALENDARIO
|--------------------------------------------------------------------------
*/

.cc-calendar-year {
    display: grid;
    grid-template-columns: repeat(5, minmax(220px, 1fr));
    gap: 18px;
}

/* Slider: tutti i mesi stanno in una riga scrollabile */
.cc-view-slider .cc-calendar-year {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    cursor: grab;
    padding: 4px 4px 26px;
    scrollbar-width: none;
}

.cc-view-slider .cc-calendar-year::-webkit-scrollbar {
    display: none;
}

.cc-view-slider .cc-calendar-year.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
}

.cc-calendar-month {
    display: none;
    background: #fff;
    border: 1px solid var(--cc-border);
    border-radius: 18px;
    padding: 24px 16px 18px;
    transition: .25s ease;
}

.cc-view-slider .cc-calendar-month {
    display: block;
    flex: 0 0 calc((100% - 72px) / 5);
    min-width: 220px;
    scroll-snap-align: center;
}

.cc-calendar-month.is-visible {
    display: block;
}

.cc-calendar-month.is-center {
    border-color: var(--cc-primary);
    box-shadow: 0 18px 45px rgba(0, 0, 0, .08);
    transform: translateY(-4px);
}

.cc-calendar-month h3 {
    font-size: 24px;
    margin: 0 0 22px;
    text-transform: capitalize;
    text-align: center;
}

.cc-weekdays,
.cc-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.cc-weekdays {
    margin-bottom: 8px;
}

.cc-weekdays span {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    opacity: .5;
}

.cc-day-box {
    min-height: 46px;
    border-radius: 10px;
    background: var(--cc-light);
    position: relative;
    padding: 7px;
    font-weight: 600;
    color: #777;
}

.cc-day-box.empty {
    background: transparent;
}

.cc-day-box.has-event {
    background: var(--cc-primary);
    color: var(--cc-primary-text);
    cursor: pointer;
}

.cc-day-box.is-today {
    outline: 2px solid var(--cc-primary);
    outline-offset: 2px;
}

.cc-day-number {
    font-size: 14px;
    font-weight: 700;
}

.cc-event-dot {
    width: 8px;
    height: 8px;
    background: var(--cc-primary-text);
    border-radius: 50%;
    position: absolute;
    top: 9px;
    right: 9px;
}

/*
|--------------------------------------------------------------------------
| TOOLTIP EVENTI
|--------------------------------------------------------------------------
*/

.cc-day-events {
    display: none;
    position: absolute;
    top: 54px;
    left: 0;
    z-index: 99;
    width: 260px;
    background: #fff;
    color: var(--cc-dark);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.15);
}

.cc-day-box.has-event:hover .cc-day-events,
.cc-day-box.has-event.is-open .cc-day-events {
    display: block;
}

.cc-day-events a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border-radius: 12px;
    text-decoration: none;
    color: #000;
    transition: .25s ease;
}

.cc-day-events a:hover {
    background: #f7f7f7;
}

/*
|--------------------------------------------------------------------------
| LISTA
|--------------------------------------------------------------------------
*/

.cc-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 50px;
}

.cc-card {
    display: flex;
    gap: 20px;
    border: 1px solid #eee;
    border-radius: 22px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: .25s ease;
}

.cc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, .08);
}

.cc-date {
    width: 82px;
    min-width: 82px;
    border-radius: 16px;
    background: var(--cc-primary);
    color: var(--cc-primary-text);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.cc-day {
    font-size: 30px;
    font-weight: 700;
}

.cc-month {
    font-size: 13px;
}

.cc-tipologia {
    display: inline-block;
    background: #f2f2f2;
    padding: 6px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
}

.cc-content h3 {
    margin: 0 0 10px;
    font-size: 24px;
}

.cc-content p {
    margin: 5px 0;
}

.cc-no-results {
    margin-top: 30px;
    font-weight: 700;
}

/*
|--------------------------------------------------------------------------
| RESPONSIVE
|--------------------------------------------------------------------------
*/

@media (max-width: 1300px) {
    .cc-calendar-year {
        grid-template-columns: repeat(3, 1fr);
    }

    .cc-view-slider .cc-calendar-month {
        flex: 0 0 calc((100% - 36px) / 3);
    }
}

@media (max-width: 1024px) {
    .cc-calendar-year {
        grid-template-columns: repeat(2, 1fr);
    }

    .cc-view-slider .cc-calendar-month {
        flex: 0 0 calc((100% - 18px) / 2);
    }
}

@media (max-width: 767px) {
    .container-filter {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }

    .cc-current-year-title {
        font-size: 32px;
    }

    .cc-top-filters {
        width: 100%;
        gap: 14px;
    }

    #cc-search,
    #cc-year-filter {
        width: 100%;
        min-width: 100%;
    }

    .cc-calendar-controls {
        width: 100%;
        gap: 10px;
    }

    .cc-view-filter {
        flex: 1;
        padding: 0 10px;
    }

    .cc-calendar-year {
        grid-template-columns: 1fr;
    }

    .cc-slider-wrap {
        padding: 0 44px 38px;
    }

    .cc-view-slider .cc-calendar-month {
        flex: 0 0 100%;
        min-width: 100%;
    }

    .cc-calendar-month.is-center {
        transform: none;
    }

    .cc-card {
        padding: 15px;
    }

    .cc-content h3 {
        font-size: 20px;
    }

    .cc-slider-arrow {
        width: 38px;
        height: 38px;
        min-width: 38px;
        font-size: 24px;
    }
}

/*
|--------------------------------------------------------------------------
| USER SELECT
|--------------------------------------------------------------------------
*/

.cc-calendar-years,
.cc-calendar-year,
.cc-calendar-month,
.cc-calendar-month h3,
.cc-weekdays,
.cc-weekdays span,
.cc-calendar-grid,
.cc-day-box,
.cc-day-number,
.cc-slider-header,
.cc-slider-current-label,
.cc-slider-dots,
.cc-dot,
.cc-slider-arrow,
.cc-now-button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.cc-day-events,
.cc-day-events a,
.cc-day-events strong,
.cc-day-events span {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}


/* =========================================================
   SOLO MOBILE - FULL WIDTH + NO PADDING + NO ARROWS + DOT SCROLL
   Incolla ALLA FINE del file calendario-corsi.css
========================================================= */

@media (max-width: 767px) {

    /* Full width solo mobile */
    .cc-wrapper,
    .cc-calendar-years,
    .cc-year-group,
    .cc-slider-wrap,
    .cc-calendar-year {
        width: 100%;
        max-width: 100%;
    }

    /* Tolgo padding laterale del contenitore slider */
    .cc-slider-wrap {
        padding: 0 !important;
    }

    /* Tolgo padding dentro lo scroll */
    .cc-view-slider .cc-calendar-year {
        padding: 0 !important;
        gap: 14px;
        overflow-x: auto;
        overflow-y: visible;
        scroll-snap-type: x mandatory !important;
        scroll-behavior: smooth;
        scroll-padding-left: 0;
        scroll-padding-right: 0;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    /* Non spegnere lo snap quando trascini */
    .cc-view-slider .cc-calendar-year.is-dragging {
        scroll-snap-type: x mandatory !important;
    }

    /* Ogni mese/card occupa tutta la larghezza */
    .cc-view-slider .cc-calendar-month {
        flex: 0 0 100%;
        min-width: 100%;
        scroll-snap-align: center;
        scroll-snap-stop: always;
    }

    .cc-calendar-month {
        width: 100%;
    }

    /* Nascondo le frecce solo mobile */
    .cc-slider-arrow,
    .cc-prev,
    .cc-next {
        display: none !important;
    }

    /* I pallini/numeri sotto diventano scrollabili */
    .cc-slider-dots {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-wrap: nowrap !important;
        justify-content: flex-start;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 10px 0;
        margin-top: 10px;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .cc-slider-dots::-webkit-scrollbar {
        height: 5px;
    }

    button.cc-dot {
        flex: 0 0 auto;
        margin: 0 !important;
        min-width: 18px;
        min-height: 18px;
        width: 18px;
        height: 18px;
    }
}

/* =========================================================
   FIX TOOLTIP EVENTI - SOTTO IL GIORNO
   Incolla ALLA FINE del CSS
========================================================= */

/* Lascia visibile il tooltip dentro card e giorni */
.cc-wrapper,
.cc-calendar-years,
.cc-year-group,
.cc-slider-wrap,
.cc-calendar-month,
.cc-calendar-grid,
.cc-day-box {
    overflow: visible !important;
}

/* Lo slider deve scrollare in X, ma serve spazio sotto per il tooltip */
.cc-view-slider .cc-calendar-year {
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding-bottom: 170px !important;
    margin-bottom: -120px;
}

/* Mese sopra agli altri quando hover */
.cc-calendar-month {
    position: relative;
}

.cc-calendar-month:hover {
    z-index: 999;
}

/* Giorno evento sopra */
.cc-day-box.has-event {
    position: relative;
}

.cc-day-box.has-event:hover,
.cc-day-box.has-event.is-open {
    z-index: 99999;
}

/* Tooltip SOTTO il giorno */
.cc-day-events {
    top: calc(100% + 12px) !important;
    bottom: auto !important;
    left: 0 !important;
    right: auto !important;
    transform: none !important;

    width: 260px;
    max-width: 260px;

    z-index: 999999 !important;
    background: #fff;
    color: var(--cc-dark);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.18);
}

/* Freccetta sopra il tooltip */
.cc-day-events::after {
    content: "";
    position: absolute;
    left: 22px;
    top: -7px;
    bottom: auto;
    border-width: 0 7px 7px 7px;
    border-style: solid;
    border-color: transparent transparent #fff transparent;
}

/* Se il giorno è a destra, il tooltip va verso sinistra */
.cc-calendar-grid .cc-day-box:nth-child(7n) .cc-day-events,
.cc-calendar-grid .cc-day-box:nth-child(7n - 1) .cc-day-events {
    left: auto !important;
    right: 0 !important;
}

.cc-calendar-grid .cc-day-box:nth-child(7n) .cc-day-events::after,
.cc-calendar-grid .cc-day-box:nth-child(7n - 1) .cc-day-events::after {
    left: auto;
    right: 22px;
}

/* Mobile */
@media (max-width: 767px) {
    .cc-view-slider .cc-calendar-year {
        padding-bottom: 150px !important;
        margin-bottom: -100px;
    }

    .cc-day-events {
        width: 220px;
        max-width: 220px;
    }
}
.cc-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}

.cc-meta-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    font-size: 17px;
    line-height: 1;
}
