/**
 * Eventkalender Stylesheet
 * Version: 1.5.0
 * Optimiert für PHP-Fusion v9 Themes
 */

/* ============================================
   WRAPPER & CONTAINER
   ============================================ */

.ek-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================
   KALENDER HEADER (Navigation)
   ============================================ */

.ek-cal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.ek-cal-head > div:first-child {
    display: flex;
    gap: 15px;
}

.ek-cal-head a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    font-weight: 500;
}

.ek-cal-head a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ek-cal-head strong {
    color: white;
    font-size: 1.3em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ============================================
   KALENDER GRID (Tabelle)
   ============================================ */

.ek-grid {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.ek-grid thead {
    background: linear-gradient(135deg, #2b7cff 0%, #1e5fcc 100%);
}

.ek-grid th {
    color: white;
    padding: 12px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95em;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ek-grid td {
    border: 1px solid #e0e0e0;
    padding: 12px 10px;
    vertical-align: top;
    min-height: 100px;
    width: 14.28%; /* 100% / 7 Tage */
    background: white;
    transition: background-color 0.2s ease;
}

.ek-grid td:hover {
    background: #f8f9fa;
}

/* Wochenend-Datum in rot */
.ek-grid td:nth-child(6) .ek-daynum,
.ek-grid td:nth-child(7) .ek-daynum {
    color: #dc3545; /* Rot für Wochenenden */
}

/* Leere Zellen (außerhalb des Monats) */
.ek-grid td:empty,
.ek-grid td:has(> :only-child:empty) {
    background: #f5f5f5;
}

/* ============================================
   TAGES-NUMMER
   ============================================ */

.ek-daynum {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 8px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================
   HEUTE-BADGE
   ============================================ */

.ek-today {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #333;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(255, 170, 0, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ============================================
   EVENT-BADGES
   ============================================ */

.ek-event {
    display: block;
    padding: 5px 8px;
    margin: 3px 0;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    font-weight: 500;
}

.ek-event:hover {
    opacity: 0.85;
    transform: translateX(3px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.ek-event:active {
    transform: translateX(1px);
}

/* ============================================
   MUTED TEXT (für "keine Events")
   ============================================ */

.ek-muted {
    color: #999;
    font-size: 0.85em;
    font-style: italic;
    padding: 3px 0;
}

/* ============================================
   MODAL / EVENT-DETAIL-VIEW
   ============================================ */

.ek-modal {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 2px solid #667eea;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.ek-modal h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #667eea;
    font-size: 1.5em;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.ek-modal > div {
    background: white;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.ek-modal > div:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.ek-modal > div > div:first-child {
    font-weight: 600;
    font-size: 1.1em;
    color: #ffffff; /* Event-Name in weiß */
    margin-bottom: 5px;
}

.ek-modal .ek-muted {
    color: #666;
    font-size: 0.9em;
    margin: 5px 0;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .ek-wrap {
        padding: 10px;
    }

    .ek-cal-head {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .ek-cal-head > div:first-child {
        width: 100%;
        justify-content: space-between;
    }

    .ek-cal-head a {
        padding: 6px 12px;
        font-size: 0.9em;
    }

    .ek-cal-head strong {
        font-size: 1.1em;
    }

    .ek-grid th,
    .ek-grid td {
        padding: 6px 4px;
        font-size: 0.85em;
    }

    .ek-daynum {
        font-size: 0.95em;
        margin-bottom: 4px;
    }

    .ek-event {
        font-size: 0.75em;
        padding: 3px 5px;
        margin: 2px 0;
    }

    .ek-today {
        font-size: 0.6em;
        padding: 2px 6px;
    }

    .ek-modal {
        padding: 15px;
        margin-top: 20px;
    }

    .ek-modal h4 {
        font-size: 1.2em;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .ek-cal-head a,
    .ek-modal {
        display: none;
    }

    .ek-grid {
        box-shadow: none;
        border: 2px solid #000;
    }

    .ek-grid th {
        background: #ccc !important;
        color: #000 !important;
    }

    .ek-event {
        box-shadow: none;
        border: 1px solid #333;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.ek-event:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.ek-cal-head a:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ek-grid td {
        border-color: #000;
    }

    .ek-event {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ek-event,
    .ek-cal-head a,
    .ek-modal > div {
        transition: none;
    }

    .ek-today {
        animation: none;
    }
}

/* ============================================
   DARK MODE (optional, falls Theme unterstützt)
   ============================================ */

@media (prefers-color-scheme: dark) {
    .ek-grid {
        background: #2d2d2d;
    }

    .ek-grid td {
        background: #333;
        border-color: #444;
        color: #e0e0e0;
    }

    .ek-grid td:hover {
        background: #3a3a3a;
    }

    .ek-daynum {
        color: #e0e0e0;
    }

    .ek-modal {
        background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
        border-color: #667eea;
    }

    .ek-modal > div {
        background: #333;
        color: #e0e0e0;
    }
}
