/* Grundlayout */
.kkg-calendar-wrapper {
    max-width: 1100px;
    margin: 0 auto 4rem;
    font-family: inherit;
}

/* Suchfeld */
.kkg-calendar-search {
    display: flex;
    align-items: center;
    margin: 0 auto 1rem;
    border: 1px solid #000;
    padding: 0.5rem 0.75rem;
    max-width: 700px;
}
#kkg-calendar-search {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
}
#kkg-calendar-search-btn {
    border: none;
    background: transparent;
    font-size: 1.1rem;
    cursor: pointer;
}

/* Filterbuttons */
.kkg-calendar-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}
.kkg-filter-btn {
    font-size: 0.68rem;
    padding: 0.25rem 0.65rem;
    border-radius: 2px;
    border: 2px solid #000;
    text-transform: uppercase;
    cursor: pointer;
    background: #f8f8f8;
    font-family: inherit;
    letter-spacing: 0.03em;
}
.kkg-filter-btn.is-active {
    outline: 2px solid #000;
}

/* Kalender-Header (Monat + Navigation) */
.kkg-calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
    gap: 0.75rem;
}
.kkg-calendar-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0;
}
.kkg-nav-btn {
    background: transparent !important;
    border: 1px solid #000 !important;
    color: #000 !important;
    border-radius: 0 !important;
    font-family: inherit !important;
    font-size: 0.75rem !important;
    padding: 0;
    width: 28px;
    height: 28px;
    line-height: 26px;
    text-align: center;
    cursor: pointer;
    box-shadow: none !important;
}
.kkg-nav-btn:hover {
    background: #000 !important;
    color: #fff !important;
}

/* Grid */
.kkg-calendar-grid {
    border: 1px solid #000;
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    width: 100%;
}
.kkg-calendar-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.kkg-calendar-cell {
    border: 1px solid #000;
    min-height: 90px;
    padding: 0.2rem 0.25rem 0.25rem;
    position: relative;
    box-sizing: border-box;
}
.kkg-calendar-cell-outside {
    background: #fafafa;
    color: #999;
}

/* Kopfzeile in jeder Zelle: Wochentag links, Datum rechts */
.kkg-day-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 1px solid #000;
    padding-bottom: 0.1rem;
    margin-bottom: 0.15rem;
}
.kkg-day-weekday {
    font-size: 0.65rem;
    text-transform: none;
}
.kkg-day-number {
    font-size: 0.75rem;
    font-weight: 700;
}
.kkg-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Balken-Events (Stil B) */
.kkg-day-event {
    display: flex;
    align-items: center;
    padding: 0.05rem 0.2rem;
    border-radius: 3px;
    font-size: 0.65rem;
    line-height: 1.3;
    color: #000;
    background-clip: padding-box;
    cursor: pointer;
}
.kkg-day-event .kkg-event-time {
    font-weight: 700;
    margin-right: 0.25rem;
}
.kkg-day-event .kkg-event-title {
    flex: 1;
}

/* Tooltip */
.kkg-calendar-tooltip {
    position: absolute;
    z-index: 9999;
    padding: 0.45rem 0.6rem;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    background: #333;
    color: #fff;
    max-width: 260px;
    pointer-events: none;
    font-size: 0.8rem;
    font-family: inherit;
}
.kkg-tooltip-title {
    font-weight: 700;
    margin-bottom: 0.2rem;
}
.kkg-tooltip-desc {
    font-size: 0.75rem;
}

/* Popup */
.kkg-calendar-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 9998;
    display: none;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 2rem 1rem;
}
.kkg-calendar-popup {
    background: #111;
    color: #f5f5f5;
    max-width: 900px;
    width: 100%;
    border-radius: 8px;
    position: relative;
    padding: 1rem;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    font-family: inherit;
}
.kkg-popup-close {
    position: absolute;
    top: 0.5rem;
    right: 0.7rem;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}
.kkg-popup-image-wrap {
    max-height: 260px;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 1rem;
}
.kkg-popup-image-wrap img {
    width: 100%;
    display: block;
}
.kkg-popup-content {
    font-size: 0.95rem;
}
#kkg-popup-title {
    font-size: 1.4rem;
    margin: 0 0 0.5rem;
}
.kkg-popup-meta > div {
    margin-bottom: 0.2rem;
}
.kkg-popup-flags {
    margin: 0.5rem 0 0.75rem;
}
.kkg-flag {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    font-size: 0.7rem;
    margin-right: 0.3rem;
}
.kkg-flag-free {
    background: #2e7d32;
    color: #fff;
}
.kkg-flag-price {
    background: #1565c0;
    color: #fff;
}
.kkg-flag-soldout {
    background: #c62828;
    color: #fff;
}
.kkg-flag-kids {
    background: #ffb74d;
    color: #000;
}

/* Veranstalter & Aktionen */
.kkg-popup-promoter {
    margin-top: 0.75rem;
}
.kkg-promoter-logo img {
    max-height: 40px;
    margin-top: 0.3rem;
}
.kkg-promoter-gmaps a {
    color: #90caf9;
}
.kkg-popup-actions {
    margin-top: 1rem;
}
.kkg-btn {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    margin-right: 0.4rem;
    font-family: inherit;
}
.kkg-btn-ticket {
    background: #fdd835;
    color: #000;
}
.kkg-btn-details {
    background: #424242;
    color: #fff;
}
.kkg-btn:hover {
    opacity: 0.9;
}

/* Body scroll sperren, wenn Popup offen */
body.kkg-popup-open {
    overflow: hidden;
}

/* Mobile */
@media (max-width: 768px) {
    .kkg-calendar-wrapper {
        padding: 0 0.5rem;
    }
    .kkg-calendar-title {
        font-size: 1.1rem;
    }
    .kkg-calendar-cell {
        min-height: 70px;
    }
    .kkg-calendar-popup {
        max-width: 100%;
        border-radius: 0;
        min-height: 100vh;
    }
    .kkg-calendar-popup-backdrop {
        padding: 0;
        align-items: stretch;
    }
}
