/**
 * SG KaKo Termine - Public Styles
 */

/* Container */
.sg-kako-termine-wrapper {
    margin: 20px 0;
}

.sg-kako-termine-list {
    display: grid;
    gap: 24px;
}

/* Termin Card */
.sg-kako-termin-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.sg-kako-termin-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Header */
.termin-header {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.termin-datum {
    flex-shrink: 0;
    width: 80px;
    text-align: center;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-radius: 8px;
    padding: 12px 8px;
}

.datum-tag {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

.datum-monat {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 4px;
}

.datum-jahr {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

/* Info */
.termin-info {
    flex: 1;
}

.termin-titel {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

.termin-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #6b7280;
}

.termin-meta > span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.termin-meta svg {
    flex-shrink: 0;
}

/* Termin Typen */
.termin-typ {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
}

.termin-typ-training {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.termin-typ-spiel {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.termin-typ-turnier {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.termin-typ-veranstaltung {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.termin-typ-ausflug {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.termin-typ-vereinstaetigkeit {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

/* Beschreibung */
.termin-beschreibung {
    margin-top: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    color: #4b5563;
    line-height: 1.6;
}

.termin-beschreibung p {
    margin: 0;
}

/* Footer */
.termin-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* Teilnehmer */
.termin-teilnehmer {
    flex: 1;
    order: -1;
}

.teilnehmer-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 8px;
}

.teilnehmer-liste {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.teilnehmer-name {
    display: inline-block;
    padding: 4px 10px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* Aktionen */
.termin-actions {
    flex-shrink: 0;
}

.sg-kako-btn-zusage {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sg-kako-btn-zusage:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.sg-kako-btn-zusage.zugesagt {
    background: #22c55e;
}

.sg-kako-btn-zusage.zugesagt:hover {
    background: #16a34a;
    box-shadow: 0 4px 6px rgba(34, 197, 94, 0.3);
}

.sg-kako-btn-zusage:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.login-hinweis {
    font-size: 13px;
    color: #9ca3af;
    font-style: italic;
}

/* Gesperrter Termin */
.termin-locked {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.termin-locked .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.termin-locked .status-badge.zugesagt {
    background: #dcfce7;
    color: #166534;
}

.termin-locked .locked-reason {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 4px;
}

.termin-locked .locked-reason svg {
    flex-shrink: 0;
}

/* Keine Termine */
.sg-kako-no-termine {
    text-align: center;
    padding: 60px 20px;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    color: #6b7280;
}

.sg-kako-no-termine p {
    font-size: 16px;
    margin: 0;
}

/* Loading State */
.sg-kako-termin-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .termin-header {
        flex-direction: column;
        gap: 16px;
    }

    .termin-datum {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 12px;
        padding: 16px;
    }

    .datum-tag,
    .datum-monat,
    .datum-jahr {
        display: inline;
        font-size: 18px;
    }

    .termin-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .termin-actions {
        width: 100%;
    }

    .termin-teilnehmer {
        order: 0;
    }

    .sg-kako-btn-zusage {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .sg-kako-termin-card {
        padding: 16px;
    }

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

    .termin-meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* ========== Begrüßungs-Widget ========== */
.sg-kako-begruessung {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.begruessung-name {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
}

.begruessung-punkte {
    flex-shrink: 0;
}

.sg-kako-punkte-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sg-kako-punkte-badge:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
    color: white;
    text-decoration: none;
}

.sg-kako-punkte-badge.static {
    cursor: default;
}

.sg-kako-punkte-badge.static:hover {
    transform: none;
    box-shadow: none;
}

.sg-kako-punkte-badge .punkte-zahl {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    color: white;
}

.sg-kako-punkte-badge .punkte-label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.sg-kako-punkte-badge .punkte-arrow {
    opacity: 0.8;
}

@media (max-width: 600px) {
    .sg-kako-begruessung {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }

    .begruessung-name {
        font-size: 18px;
    }

    .sg-kako-punkte-badge .punkte-zahl {
        font-size: 22px;
    }
}

/* ========== Aktueller Termin Highlight ========== */
.sg-kako-termin-card.aktueller-termin {
    border: 2px solid #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), 0 4px 12px rgba(59, 130, 246, 0.15);
    scroll-margin-top: 100px;
}

.aktueller-termin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #3b82f6;
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

/* Team-Badge (Mannschafts-Anzeige nach Freigabe) */
.sg-kako-team-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    border: 2px solid transparent;
}

.sg-kako-team-badge .team-badge-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sg-kako-team-badge.team-badge-rot {
    background: #fef2f2;
    color: #dc2626;
    border-color: #ef4444;
}
.sg-kako-team-badge.team-badge-rot .team-badge-dot {
    background: #ef4444;
}

.sg-kako-team-badge.team-badge-gruen {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #22c55e;
}
.sg-kako-team-badge.team-badge-gruen .team-badge-dot {
    background: #22c55e;
}

.sg-kako-team-badge.team-badge-gelb {
    background: #fefce8;
    color: #ca8a04;
    border-color: #eab308;
}
.sg-kako-team-badge.team-badge-gelb .team-badge-dot {
    background: #eab308;
}

.sg-kako-team-badge.team-badge-weiss {
    background: #f9fafb;
    color: #374151;
    border-color: #9ca3af;
}
.sg-kako-team-badge.team-badge-weiss .team-badge-dot {
    background: #9ca3af;
    border: 1px solid #6b7280;
}

.sg-kako-team-badge.team-badge-blau {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #3b82f6;
}
.sg-kako-team-badge.team-badge-blau .team-badge-dot {
    background: #3b82f6;
}

/* Teilnehmer Team-Gruppen (nach Team-Freigabe) */
.teilnehmer-liste.teilnehmer-mit-teams {
    flex-direction: column;
    gap: 10px;
}

.teilnehmer-team-gruppe {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.teilnehmer-team-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    min-width: 48px;
    color: white;
}

.team-label-rot   { background: #ef4444; }
.team-label-gruen { background: #22c55e; }
.team-label-blau  { background: #3b82f6; }
.team-label-gelb  { background: #eab308; }
.team-label-weiss { background: #9ca3af; }

.teilnehmer-name.teilnehmer-name-rot   { background: #fef2f2; color: #dc2626; }
.teilnehmer-name.teilnehmer-name-gruen { background: #f0fdf4; color: #16a34a; }
.teilnehmer-name.teilnehmer-name-blau  { background: #eff6ff; color: #1d4ed8; }
.teilnehmer-name.teilnehmer-name-gelb  { background: #fefce8; color: #ca8a04; }
.teilnehmer-name.teilnehmer-name-weiss { background: #f9fafb; color: #374151; }
