/**
 * Termin-Übersicht Frontend Styles
 * Clean & Minimal Design
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ================================
   BASE STYLES
   ================================ */

.termin-liste,
.termin-kalender-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================
   LISTEN-ANSICHT
   ================================ */

.termin-liste {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Termin Card */
.termin-item {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
}

.termin-item:hover {
    background: #f8fafc;
}

/* Datum-Box */
.termin-datum-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 85px;
    padding: 14px 18px;
    background: var(--termin-datum-bg, #f8fafc);
    border-right: 1px solid #e2e8f0;
    text-align: center;
    border-top-left-radius: 19px;
    border-bottom-left-radius: 19px;
}

.termin-tag {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    color: var(--termin-datum-text, #1e293b);
}

.termin-monat {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--termin-datum-text-secondary, #64748b);
    margin-top: 3px;
}

.termin-jahr {
    font-size: 10px;
    color: var(--termin-datum-text-secondary, #94a3b8);
    margin-top: 2px;
}

/* Inhalt */
.termin-inhalt {
    flex: 1;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.termin-titel {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

/* Meta-Informationen */
.termin-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.termin-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #64748b;
}

.termin-meta-item svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    color: #94a3b8;
}

/* Trennzeichen zwischen Meta-Items */
.termin-meta-item:not(:last-child)::after {
    content: '·';
    margin-left: 4px;
    color: #cbd5e1;
}

/* Beschreibung */
.termin-beschreibung {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    margin-top: 6px;
}

.termin-beschreibung p {
    margin: 0;
}

/* Keine Termine */
.termin-keine {
    padding: 32px 20px;
    text-align: center;
    border: 1px dashed #e2e8f0;
    border-radius: 6px;
    background: transparent;
}

.termin-keine p {
    margin: 0;
    color: #94a3b8;
    font-size: 13px;
}

/* ================================
   KALENDER-ANSICHT
   ================================ */

.termin-kalender-wrapper {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
}

/* Kalender Header */
.termin-kalender-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.termin-kalender-monat-titel {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

/* Navigation Buttons */
.termin-kalender-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.termin-kalender-nav:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

.termin-kalender-nav svg {
    width: 14px;
    height: 14px;
}

/* Kalender Grid */
.termin-kalender-grid {
    padding: 8px;
    background: transparent;
}

/* Wochentage Header */
.termin-kalender-wochentage {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 2px;
}

.termin-kalender-wochentag {
    padding: 6px 2px;
    text-align: center;
    font-size: 10px;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Tage Grid */
.termin-kalender-tage {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

/* Einzelner Tag */
.termin-kalender-tag {
    position: relative;
    min-height: 48px;
    padding: 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.termin-kalender-tag:not(.termin-kalender-tag-leer):hover {
    background: #f1f5f9;
}

/* Leerer Tag */
.termin-kalender-tag-leer {
    background: transparent;
    border-color: transparent;
}

/* Heute */
.termin-kalender-tag.heute {
    background: #eff6ff;
    border-color: #93c5fd;
}

.termin-kalender-tag.heute .termin-tag-nummer {
    color: #3b82f6;
    font-weight: 600;
}

/* Vergangene Tage */
.termin-kalender-tag.vergangen {
    opacity: 0.4;
}

/* Tage mit Terminen */
.termin-kalender-tag.hat-termine {
    background: #fff;
    border-color: #cbd5e1;
}

/* Tag-Nummer */
.termin-tag-nummer {
    font-size: 11px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1;
}

/* Termine im Tag */
.termin-tag-termine {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 3px;
}

.termin-tag-termin {
    display: block;
    padding: 1px 4px;
    background: #475569;
    border-radius: 2px;
    font-size: 9px;
    font-weight: 500;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s ease;
}

.termin-tag-termin:hover {
    background: #334155;
    color: #fff;
    text-decoration: none;
}

/* Termin-Punkt (für Mobile) */
.termin-tag-dot {
    display: none;
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #64748b;
    border-radius: 50%;
}

/* Legende */
.termin-kalender-legende {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 8px 12px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.termin-legende-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #64748b;
}

.termin-legende-dot {
    width: 6px;
    height: 6px;
    background: #64748b;
    border-radius: 2px;
}

.termin-legende-dot.heute {
    background: #3b82f6;
}

/* ================================
   RESPONSIVE - TABLET
   ================================ */

@media (max-width: 768px) {
    /* Listen-Ansicht */
    .termin-item {
        flex-direction: column;
    }

    .termin-datum-box {
        flex-direction: row;
        min-width: 100%;
        padding: 14px 18px;
        gap: 10px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        justify-content: flex-start;
        align-items: center;
        border-radius: 0;
        border-top-left-radius: 19px;
        border-top-right-radius: 19px;
        border-bottom-left-radius: 0;
    }

    .termin-tag {
        font-size: 22px;
    }

    .termin-monat {
        margin-top: 0;
        font-size: 13px;
        font-weight: 600;
    }

    .termin-jahr {
        margin-top: 0;
        margin-left: 0;
        font-size: 13px;
    }

    .termin-inhalt {
        padding: 10px 12px;
    }

    .termin-titel {
        font-size: 13px;
    }

    .termin-meta-item {
        font-size: 11px;
    }

    /* Kalender-Ansicht */
    .termin-kalender-header {
        padding: 8px 12px;
    }

    .termin-kalender-monat-titel {
        font-size: 13px;
    }

    .termin-kalender-grid {
        padding: 6px;
    }

    .termin-kalender-tag {
        min-height: 36px;
        padding: 3px;
    }

    .termin-tag-termine {
        display: none;
    }

    .termin-kalender-tag.hat-termine .termin-tag-dot {
        display: block;
    }

    .termin-tag-nummer {
        font-size: 10px;
    }

    .termin-kalender-wochentag {
        font-size: 9px;
        padding: 4px 2px;
    }

    .termin-kalender-legende {
        gap: 12px;
        padding: 6px 10px;
    }

    .termin-legende-item {
        font-size: 10px;
    }
}

/* ================================
   RESPONSIVE - MOBILE
   ================================ */

@media (max-width: 480px) {
    .termin-datum-box {
        padding: 12px 16px;
        gap: 8px;
    }

    .termin-tag {
        font-size: 20px;
    }

    .termin-monat {
        font-size: 12px;
    }

    .termin-jahr {
        display: inline !important;
        font-size: 12px;
    }

    .termin-inhalt {
        padding: 12px 14px;
    }

    .termin-titel {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .termin-meta-item {
        font-size: 11px;
    }

    .termin-meta-item svg {
        width: 11px;
        height: 11px;
    }

    .termin-kalender-tag {
        min-height: 32px;
    }

    .termin-tag-nummer {
        font-size: 9px;
    }
}

/* ================================
   LOADING STATE
   ================================ */

.termin-kalender-wrapper.loading .termin-kalender-grid {
    opacity: 0.5;
    pointer-events: none;
}

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

.termin-kalender-nav:focus-visible,
.termin-tag-termin:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ================================
   FIX: Jahr IMMER anzeigen (alle Geräte)
   ================================ */
.termin-jahr {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
}
