/**
 * Event Manager - Frontend CSS
 * Vereinsfarben TSV Breitengüßbach: Gelb (#f5b800) / Schwarz-Dunkel (#1a1a1a)
 * Optimierte, dezent vergrößerte und barrierefreie Typografie
 */

:root {
    --em-primary: #f5b800;
    --em-primary-hover: #e0a700;
    --em-primary-contrast: #111111;
    --em-dark-bg: #1a1a1a;
    --em-dark-card: #222428;
    --em-dark-border: #33363d;
    --em-surface: #ffffff;
    --em-border: #e2e8f0;
    --em-text: #0f172a;
    --em-text-muted: #475569;
    --em-radius: 10px;
    --em-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   1. Interaktiver Monatskalender ([event_calendar])
   ========================================================================== */
.em-calendar-app {
    background: var(--em-surface);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius);
    box-shadow: var(--em-shadow);
    overflow: hidden;
    margin: 30px 0;
    font-family: inherit;
    box-sizing: border-box;
}

.em-calendar-app * {
    box-sizing: border-box;
}

.em-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 2px solid var(--em-primary);
    flex-wrap: wrap;
    gap: 14px;
}

.em-cal-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--em-text);
    letter-spacing: -0.01em;
}

.em-cal-nav-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.em-cal-btn {
    background: #ffffff;
    border: 1px solid var(--em-border);
    color: var(--em-text);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.em-cal-btn:hover {
    background: var(--em-primary);
    border-color: var(--em-primary);
    color: var(--em-primary-contrast);
    box-shadow: 0 2px 6px rgba(245, 184, 0, 0.35);
}

.em-cal-btn-prev, .em-cal-btn-next {
    font-size: 1.35rem;
    padding: 4px 14px;
    line-height: 1;
}

.em-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #1e293b;
    border-bottom: 1px solid var(--em-border);
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #f8fafc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.em-cal-weekdays div {
    padding: 12px 6px;
    border-right: 1px solid #334155;
}

.em-cal-weekdays div:last-child {
    border-right: none;
}

.em-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--em-surface);
}

.em-cal-cell {
    min-height: 110px;
    padding: 8px;
    border-right: 1px solid var(--em-border);
    border-bottom: 1px solid var(--em-border);
    position: relative;
    background: #ffffff;
    transition: background 0.15s ease;
}

.em-cal-cell:nth-child(7n) {
    border-right: none;
}

.em-cal-cell.em-other-month {
    background: #fafafc;
    opacity: 0.45;
}

.em-cal-cell.em-today {
    background: #fffbeb;
}

.em-day-num {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--em-text);
    display: inline-block;
    margin-bottom: 6px;
}

.em-cal-cell.em-today .em-day-num {
    background: var(--em-primary);
    color: var(--em-primary-contrast);
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    font-weight: 800;
}

.em-cell-events {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.em-event-chip {
    display: block;
    padding: 4px 8px;
    border-radius: 6px;
    background-color: var(--em-primary);
    color: var(--em-primary-contrast);
    font-size: 0.8125rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: transform 0.15s ease, filter 0.15s ease;
}

.em-event-chip:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    color: var(--em-primary-contrast);
    text-decoration: none;
}

.em-chip-time {
    font-weight: 600;
    opacity: 0.85;
    margin-right: 4px;
}

.em-cal-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    font-size: 1.05rem;
    color: var(--em-text-muted);
}

/* ==========================================================================
   2. Listenansicht ([event_list])
   ========================================================================== */
.em-event-list-wrap {
    margin: 30px 0;
}

.em-event-list-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.em-list-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--em-surface);
    border: 1px solid var(--em-border);
    border-left: 6px solid var(--em-primary);
    border-radius: var(--em-radius);
    padding: 20px;
    box-shadow: var(--em-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.em-list-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.1);
}

.em-list-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 10px;
    background-color: var(--em-primary);
    color: var(--em-primary-contrast);
    flex-shrink: 0;
    text-align: center;
    padding: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
}

.em-badge-day {
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1;
}

.em-badge-month {
    font-size: 0.825rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.em-list-body {
    flex-grow: 1;
    min-width: 0;
}

.em-list-title {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.3;
}

.em-list-title a {
    color: var(--em-text);
    text-decoration: none;
    transition: color 0.15s ease;
}

.em-list-title a:hover {
    color: var(--em-primary-hover);
}

.em-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.95rem;
    color: var(--em-text-muted);
    font-weight: 500;
}

.em-list-excerpt {
    margin-top: 10px;
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
}

.em-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid var(--em-border);
    text-decoration: none;
    font-size: 1.3rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.em-btn-icon:hover {
    background: var(--em-primary);
    border-color: var(--em-primary);
    transform: scale(1.05);
}

/* ==========================================================================
   3. Single Event Meta Card
   ========================================================================== */
.em-single-meta-card {
    background: #ffffff;
    border: 1px solid var(--em-border);
    border-top: 5px solid var(--em-primary);
    border-radius: var(--em-radius);
    padding: 26px;
    margin: 25px 0 35px 0;
    box-shadow: var(--em-shadow);
}

.em-single-meta-heading {
    margin: 0 0 20px 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--em-text);
    border-bottom: 1px solid var(--em-border);
    padding-bottom: 12px;
}

.em-single-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.em-item-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--em-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.em-item-value {
    font-size: 1.05rem;
    color: var(--em-text);
    font-weight: 500;
}

.em-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: 6px;
    background: #e2e8f0;
    color: #1e293b;
}

.em-badge-allday {
    background: #fef08a;
    color: #854d0e;
}

.em-badge-recurring {
    background: #fed7aa;
    color: #9a3412;
}

.em-single-meta-footer {
    border-top: 1px solid var(--em-border);
    padding-top: 20px;
}

/* ==========================================================================
   4. Buttons & Modal
   ========================================================================== */
.em-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.em-btn-primary {
    background: var(--em-primary);
    color: var(--em-primary-contrast) !important;
    box-shadow: 0 2px 4px rgba(245, 184, 0, 0.25);
}

.em-btn-primary:hover {
    background: var(--em-primary-hover);
    color: var(--em-primary-contrast) !important;
    box-shadow: 0 4px 10px rgba(245, 184, 0, 0.4);
    transform: translateY(-1px);
}

.em-btn-outline {
    background: transparent;
    border-color: #cbd5e1;
    color: var(--em-text) !important;
}

.em-btn-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* Frontend Modal */
.em-frontend-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.em-frontend-modal.em-hidden {
    display: none !important;
}

.em-frontend-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(3px);
}

.em-frontend-modal-card {
    position: relative;
    background: #ffffff;
    border-radius: 14px;
    border-top: 5px solid var(--em-primary);
    width: 100%;
    max-width: 540px;
    padding: 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    z-index: 2;
    max-height: 90vh;
    overflow-y: auto;
}

.em-modal-close-btn {
    position: absolute;
    top: 14px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: #64748b;
    line-height: 1;
}

.em-modal-close-btn:hover {
    color: #0f172a;
}

.em-quickview-title {
    margin: 0 0 14px 0;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--em-text);
}

.em-quickview-meta {
    background: #f8fafc;
    border-left: 4px solid var(--em-primary);
    padding: 14px 16px;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 0.95rem;
}

.em-quickview-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .em-cal-cell {
        min-height: 80px;
        padding: 4px;
    }

    .em-event-chip {
        font-size: 0.7rem;
        padding: 3px 5px;
    }

    .em-list-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }

    .em-list-date-badge {
        width: 100%;
        height: 42px;
        flex-direction: row;
        gap: 10px;
    }

    .em-badge-day {
        font-size: 1.3rem;
    }
}
