/* TT Liga Manager - Public Frontend Styles */

/* Container */
.ttlm-tabelle-container,
.ttlm-spielplan-container,
.ttlm-naechste-spiele,
.ttlm-mannschaft-spiele,
.ttlm-dashboard {
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Titel */
.ttlm-tabelle-titel,
.ttlm-spielplan-titel {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1e293b;
    border-bottom: 3px solid #2271b1;
    padding-bottom: 10px;
}

/* Tabelle */
.ttlm-table-responsive {
    overflow-x: auto;
    margin: 20px 0;
}

.ttlm-tabelle {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ttlm-tabelle thead {
    background: #2271b1;
    color: #fff;
}

.ttlm-tabelle th,
.ttlm-tabelle td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.ttlm-tabelle th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.ttlm-tabelle tbody tr:hover {
    background: #f8fafc;
}

.ttlm-tabelle .ttlm-pos {
    width: 50px;
    text-align: center;
    font-weight: 700;
    color: #2271b1;
}

.ttlm-tabelle .ttlm-team {
    font-weight: 600;
}

.ttlm-tabelle .ttlm-number {
    text-align: center;
    width: 80px;
}

.ttlm-tabelle .ttlm-points {
    text-align: center;
    width: 80px;
    font-size: 18px;
    font-weight: 700;
    color: #2271b1;
}

/* Platzierungen */
.ttlm-tabelle .ttlm-position-1 {
    background: #ecfdf5;
}

.ttlm-tabelle .ttlm-position-1 .ttlm-pos {
    color: #059669;
}

/* Legende */
.ttlm-table-legend {
    margin-top: 15px;
    padding: 10px 15px;
    background: #f8fafc;
    border-radius: 4px;
    font-size: 13px;
    color: #64748b;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.ttlm-table-legend span {
    display: inline-block;
}

/* Spielplan */
.ttlm-spieltage-liste {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ttlm-spieltag {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.ttlm-spieltag:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ttlm-spieltag-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 10px;
}

.ttlm-spieltag-nummer {
    background: #2271b1;
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
}

.ttlm-spieltag-datum {
    font-size: 14px;
    color: #64748b;
}

.ttlm-spieltag-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.ttlm-status-geplant .ttlm-spieltag-status {
    background: #dbeafe;
    color: #1e40af;
}

.ttlm-status-bestaetigt .ttlm-spieltag-status {
    background: #d1fae5;
    color: #065f46;
}

.ttlm-status-gespielt .ttlm-spieltag-status {
    background: #f3f4f6;
    color: #374151;
}

.ttlm-status-abgesagt .ttlm-spieltag-status {
    background: #fee2e2;
    color: #991b1b;
}

.ttlm-spieltag-begegnung {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
    margin: 15px 0;
}

.ttlm-team {
    font-weight: 600;
    font-size: 16px;
}

.ttlm-team-heim {
    text-align: right;
}

.ttlm-team-gast {
    text-align: left;
}

.ttlm-ergebnis {
    text-align: center;
}

.ttlm-score {
    font-size: 24px;
    font-weight: 700;
    color: #2271b1;
}

.ttlm-vs {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 600;
}

.ttlm-spielort {
    margin-top: 10px;
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ttlm-spielort .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Nächste Spiele */
.ttlm-spiele-liste {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ttlm-spiel-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 10px;
    align-items: center;
}

.ttlm-spiel-datum {
    text-align: left;
    font-weight: 700;
    color: #2271b1;
    min-width: 60px;
}

.ttlm-spiel-datum small {
    display: block;
    font-size: 11px;
    color: #64748b;
    font-weight: 400;
}

.ttlm-spiel-info {
    flex: 1;
}

/* Dashboard */
.ttlm-dashboard {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 30px;
}

.ttlm-dashboard-header {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.ttlm-dashboard-header h2 {
    margin: 0 0 5px;
    font-size: 28px;
    color: #1e293b;
}

.ttlm-dashboard-header h3 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #2271b1;
}

.ttlm-user-info {
    color: #64748b;
    font-size: 14px;
}

.ttlm-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.ttlm-stat-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.ttlm-stat-box h4 {
    margin: 0 0 10px;
    font-size: 14px;
    opacity: 0.9;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ttlm-stat-number {
    font-size: 36px;
    font-weight: 700;
    margin: 10px 0;
}

.ttlm-stat-box small {
    opacity: 0.8;
    font-size: 13px;
}

.ttlm-dashboard-section {
    margin: 30px 0;
    padding: 25px;
    background: #f8fafc;
    border-radius: 8px;
}

.ttlm-dashboard-section h3 {
    margin-top: 0;
    font-size: 20px;
    color: #1e293b;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 10px;
}

.ttlm-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
}

.ttlm-table th,
.ttlm-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.ttlm-table thead {
    background: #f1f5f9;
}

.ttlm-table th {
    font-weight: 600;
    color: #475569;
}

.ttlm-table tbody tr:hover {
    background: #f8fafc;
}

/* Ergebniseingabe */
.ttlm-ergebniseingabe {
    max-width: 1200px;
    margin: 0 auto;
}

.ttlm-ergebniseingabe-header {
    text-align: center;
    margin-bottom: 30px;
}

.ttlm-ergebnis-container {
    display: grid;
    gap: 20px;
    margin: 30px 0;
}

.ttlm-einzelspiel {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}

.ttlm-spiel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.ttlm-badge {
    background: #fbbf24;
    color: #92400e;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.ttlm-spiel-paarung {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: center;
    margin: 15px 0;
    padding: 15px;
    background: #f8fafc;
    border-radius: 6px;
}

.ttlm-spieler-heim {
    text-align: right;
    font-weight: 600;
}

.ttlm-spieler-gast {
    font-weight: 600;
}

.ttlm-saetze-eingabe {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.ttlm-satz {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ttlm-satz label {
    width: 80px;
    font-weight: 600;
}

.ttlm-satz input[type="number"] {
    width: 60px;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

.ttlm-satz span {
    font-weight: 700;
    color: #64748b;
}

.ttlm-gesamtergebnis {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 30px;
    border-radius: 12px;
    margin: 30px 0;
    text-align: center;
}

.ttlm-gesamtergebnis h3 {
    margin: 0 0 20px;
    font-size: 24px;
}

.ttlm-score-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.ttlm-team-score {
    text-align: center;
}

.ttlm-team-score .ttlm-team-name {
    display: block;
    font-size: 16px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.ttlm-team-score .ttlm-score {
    display: block;
    font-size: 60px;
    font-weight: 700;
}

.ttlm-score-separator {
    font-size: 48px;
    font-weight: 700;
    opacity: 0.7;
}

.ttlm-finalize-section {
    text-align: center;
    margin: 40px 0;
    padding: 30px;
    background: #f0fdf4;
    border: 2px dashed #22c55e;
    border-radius: 8px;
}

/* Buttons */
.button.ttlm-save-spiel {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.button.ttlm-save-spiel:hover {
    background: #135e96;
}

/* Notices */
.ttlm-notice,
.ttlm-error {
    padding: 15px 20px;
    border-radius: 6px;
    margin: 20px 0;
}

.ttlm-notice {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #2563eb;
}

.ttlm-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.ttlm-no-data {
    text-align: center;
    padding: 30px;
    color: #64748b;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .ttlm-spieltag-begegnung {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 10px;
    }

    .ttlm-team-heim,
    .ttlm-team-gast {
        text-align: center;
    }

    .ttlm-spiel-paarung {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .ttlm-spieler-heim {
        text-align: center;
    }

    /* Dashboard: weniger Padding auf kleinen Screens */
    .ttlm-dashboard {
        padding: 15px;
    }

    .ttlm-dashboard-header h2 {
        font-size: 20px;
    }

    .ttlm-dashboard-header h3 {
        font-size: 16px;
    }

    /* Stat-Boxen: 3 nebeneinander, kompakt */
    .ttlm-dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin: 15px 0;
    }

    .ttlm-stat-box {
        padding: 12px 8px;
    }

    .ttlm-stat-box h4 {
        font-size: 10px;
        margin-bottom: 5px;
    }

    .ttlm-stat-number {
        font-size: 24px;
        margin: 4px 0;
    }

    /* Dashboard-Sections: weniger Padding, Tabelle scrollbar */
    .ttlm-dashboard-section {
        padding: 15px;
        overflow-x: auto;
    }

    .ttlm-dashboard-section h3 {
        font-size: 16px;
    }

    /* Tabellen scrollbar machen statt überlaufen */
    .ttlm-table {
        min-width: 420px;
    }

    .ttlm-score-display {
        flex-direction: column;
        gap: 20px;
    }

    .ttlm-team-score .ttlm-score {
        font-size: 48px;
    }
}

/* Login / Registrierung */
.ttlm-login-container {
    max-width: 400px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ttlm-login-container h3 {
    margin-top: 0;
    text-align: center;
    color: #1e293b;
}

.ttlm-auth-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 24px;
}

.ttlm-auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}

.ttlm-auth-tab.active {
    color: #2271b1;
    border-bottom-color: #2271b1;
}

.ttlm-auth-tab:hover:not(.active) {
    color: #1e293b;
}

.ttlm-auth-panel .input {
    width: 100%;
    box-sizing: border-box;
}

.ttlm-auth-panel p {
    margin: 0 0 14px;
}

.ttlm-auth-panel label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

/* ── Kalender-Export ─────────────────────────────────────── */
.ttlm-cal-wrap {
    margin-top: 10px;
    position: relative;
}

.ttlm-cal-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f6ff;
    color: #2271b1;
    border: 1px solid #b3d0f5;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.ttlm-cal-toggle:hover {
    background: #dbeafe;
    border-color: #2271b1;
}

.ttlm-cal-dropdown {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 100;
    background: #fff;
    border: 1px solid #dde3ec;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    padding: 6px;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.ttlm-cal-dropdown[hidden] { display: none; }

.ttlm-cal-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    color: #1e293b;
    transition: background .12s;
}
.ttlm-cal-btn:hover { background: #f0f6ff; color: #2271b1; text-decoration: none; }

.ttlm-cal-icon { font-size: 16px; width: 20px; text-align: center; }

.ttlm-cal-ios    { border-left: 3px solid #555; }
.ttlm-cal-google { border-left: 3px solid #4285f4; }
.ttlm-cal-outlook{ border-left: 3px solid #0078d4; }
.ttlm-cal-ics    { border-left: 3px solid #00a32a; }

@media (max-width: 480px) {
    .ttlm-cal-dropdown { position: static; box-shadow: none; border: 1px solid #dde3ec; margin-top: 4px; }
}
