/* =====================================================
   HAPPY HOURS – ICS CALENDAR ERWEITERUNGEN
   ===================================================== */

/* Bilder im ICS Calendar */
.ics-calendar .happy-paar-single-bild {
    display: inline-block !important;
    margin-top: 6px !important;
    margin-bottom: 8px !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

.ics-calendar .happy-paar-single-bild img,
.ics-calendar .happy-paar-single-img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    cursor: pointer !important;
}

.ics-calendar .happy-paar-single-title {
    font-size: 1.1em !important;
    font-weight: 700 !important;
}

/* Endezeit ausblenden */
.ics-calendar .end_time {
    display: none !important;
}

/* Spezielle Links */
.ics-calendar .happy-kalender-link {
    color: #c00000 !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    text-decoration: underline !important;
    display: inline-block !important;
    margin: 3px 0 !important;
}

.ics-calendar .happy-kalender-link.happy-jetzt-anmelden {
    font-size: 1.35em !important;
    font-weight: 700 !important;
}

.ics-calendar .happy-spond-link {
    color: #c00000 !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
}

.ics-calendar .happy-preisliste-bild {
    display: inline-block !important;
    margin: 5px 0 !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

.ics-calendar .happy-preisliste-img,
.ics-calendar .happy-preisliste-bild img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    cursor: pointer !important;
}

/* =====================================================
   MONATSANSICHT
   1. Zeile = Startzeit
   2. + 3. Zeile = Terminname
   ===================================================== */

.ics-calendar .ics-calendar-month-grid .events .event {
    white-space: normal !important;
}

.ics-calendar .ics-calendar-month-grid .events .event .time {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.15em !important;
}

.ics-calendar .ics-calendar-month-grid .events .event .title {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
    white-space: normal !important;
    margin: 2px 0 0 0 !important;
    padding: 0 !important;
    line-height: 1.2em !important;
    max-height: 2.4em !important;
}

.ics-calendar .ics-calendar-month-grid .events .event .sublabel {
    display: none !important;
}

/* Texte nur auf Handy */
.nur-mobile {
    display: none;
}

/* Versteckter Asset-Kalender aus älteren Ladevarianten */
#happyasset {
    display: none !important;
}

/* =====================================================
   HANDY-DARSTELLUNG
   ===================================================== */
@media screen and (max-width: 782px) {
    .nur-mobile {
        display: block;
    }

    .ics-calendar .ics-calendar-month-grid .events .event .time,
    .ics-calendar .ics-calendar-month-grid .events .event .title {
        font-size: 7px !important;
    }

    .ics-calendar .events .title {
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 2 !important;
        overflow: hidden !important;
    }
}



/* =====================================================
   FEEDAUSWAHL
   Den eingebauten ICS-Schalter "Alle anzeigen/ausblenden"
   nicht anzeigen. Die einzelnen Kalender sowie der HAPPY-
   Button "Auswahl zurücksetzen" bleiben erhalten.
   ===================================================== */
.ics-calendar .ics-calendar-color-key-header {
    display: none !important;
}

/* Gespeicherte persönliche Kalenderauswahl zurücksetzen */
.ics-calendar .happy-ics-reset-selection {
    appearance: none;
    -webkit-appearance: none;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 4px 0 12px 0 !important;
    font: inherit !important;
    font-size: 0.9em !important;
    text-decoration: underline !important;
    cursor: pointer !important;
    opacity: 0.8;
}

.ics-calendar .happy-ics-reset-selection:hover,
.ics-calendar .happy-ics-reset-selection:focus {
    opacity: 1;
}

/* =====================================================
   SOFORTIGE AJAX-LADEANZEIGE / MONATS-SKELETON
   ===================================================== */

.happy-ics-loading-shell {
    width: 100%;
    min-height: 390px;
    box-sizing: border-box;
    margin: 0 0 16px 0;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.happy-ics-loading-shell.happy-ics-loading-done {
    display: none !important;
    opacity: 0;
}

/* Den fertigen ICS-Kalender erst zeigen, wenn Startauswahl gesetzt ist. */
.ics-calendar.happy-ics-await-selection {
    display: none !important;
}

.happy-ics-loading-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    box-sizing: border-box;
    background: #f7f7f7;
    border: 1px solid #d9d9d9;
    font-weight: 700;
    text-align: center;
}

.happy-ics-loading-spinner {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    box-sizing: border-box;
    border: 3px solid #d2d2d2;
    border-top-color: #555;
    border-radius: 50%;
    animation: happyIcsLoadingSpin 0.75s linear infinite;
}

@keyframes happyIcsLoadingSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.happy-ics-loading-subtext {
    margin: 6px 0 14px 0;
    font-size: 0.92em;
    text-align: center;
    opacity: 0.75;
}

.happy-ics-loading-month {
    margin: 8px 0 10px 0;
    font-size: 1.55em;
    font-weight: 600;
}

.happy-ics-loading-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    width: 100%;
    border-top: 1px solid #d7dce0;
    border-left: 1px solid #d7dce0;
    background: #fff;
}

.happy-ics-loading-weekday,
.happy-ics-loading-cell {
    box-sizing: border-box;
    border-right: 1px solid #d7dce0;
    border-bottom: 1px solid #d7dce0;
}

.happy-ics-loading-weekday {
    min-height: 32px;
    padding: 7px 4px;
    font-size: 0.78em;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    background: #fafafa;
}

.happy-ics-loading-cell {
    position: relative;
    min-height: 72px;
    padding: 5px;
    background: #fff;
}

.happy-ics-loading-cell-empty {
    background: #fafafa;
}

.happy-ics-loading-day {
    display: block;
    font-size: 0.78em;
    font-weight: 700;
    text-align: right;
}

.happy-ics-loading-today .happy-ics-loading-day {
    text-decoration: underline;
    font-weight: 900;
}

/* Dezenter Skeleton-Effekt ohne falsche Termine vorzutäuschen. */
.happy-ics-loading-cell:not(.happy-ics-loading-cell-empty)::after {
    content: '';
    display: block;
    width: 58%;
    height: 5px;
    margin: 10px 0 0 0;
    border-radius: 4px;
    background: linear-gradient(90deg, #f2f2f2 25%, #e7e7e7 50%, #f2f2f2 75%);
    background-size: 200% 100%;
    animation: happyIcsSkeleton 1.4s ease-in-out infinite;
}

@keyframes happyIcsSkeleton {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media screen and (max-width: 782px) {
    .happy-ics-loading-shell {
        min-height: 300px;
    }

    .happy-ics-loading-head {
        min-height: 38px;
        padding: 8px 10px;
    }

    .happy-ics-loading-subtext {
        margin-bottom: 10px;
        font-size: 0.84em;
    }

    .happy-ics-loading-month {
        font-size: 1.25em;
    }

    .happy-ics-loading-weekday {
        min-height: 26px;
        padding: 5px 2px;
        font-size: 0.68em;
    }

    .happy-ics-loading-cell {
        min-height: 42px;
        padding: 3px;
    }

    .happy-ics-loading-day {
        font-size: 0.68em;
    }

    .happy-ics-loading-cell:not(.happy-ics-loading-cell-empty)::after {
        height: 4px;
        margin-top: 7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .happy-ics-loading-spinner,
    .happy-ics-loading-cell:not(.happy-ics-loading-cell-empty)::after {
        animation: none !important;
    }
}
