/**
 * Torrausch.net - Mobile Styles
 * 
 * Mobile-Optimierungen für alle Seiten
 * Breakpoint: 768px (Bootstrap Medium)
 * 
 * @author Wasserlasser
 * @version 1.1
 * @date 27.11.2024
 */

/* ============================================================================
   MEDIA QUERY: MOBILE & TABLET PORTRAIT (unter 768px)
   ========================================================================= */

@media (max-width: 767px) {
    
    /* ========================================================================
       ALLGEMEINE MOBILE-ANPASSUNGEN
       ======================================================================== */
    
    /* Base Font Size erhöhen für bessere Lesbarkeit */
    body {
        font-size: 16px;
    }
    
    /* Content Box Padding reduzieren */
    .content-box-body {
        padding: 15px;
    }
    
    .content-box-header {
        padding: 12px 15px;
        font-size: 1.1rem;
    }
    
    /* Alerts kompakter */
    .alert {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .alert-heading {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    /* Cards Spacing */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .card-header {
        padding: 10px 12px;
        font-size: 1rem;
    }
    
    /* ========================================================================
       TAB-NAVIGATION
       ======================================================================== */
    
    .nav-tabs {
        margin-bottom: 1rem;
        font-size: 0.85rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-tabs .nav-item {
        flex-shrink: 0;
    }
    
    .nav-tabs .nav-link {
        padding: 8px 10px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    /* Tab-Labels verkürzen */
    .tab-label-desktop {
        display: none;
    }
    
    .tab-label-mobile {
        display: inline;
    }
    
/* ========================================================================
   TABELLEN: SPALTEN VERSTECKEN (HOHE SPEZIFITÄT)
   ======================================================================== */

/* Nur essenzielle Spalten zeigen: Platz, Team, Punkte */
table th.hide-mobile,
table td.hide-mobile,
.table th.hide-mobile,
.table td.hide-mobile,
.table-responsive table th.hide-mobile,
.table-responsive table td.hide-mobile,
.table-responsive .table th.hide-mobile,
.table-responsive .table td.hide-mobile {
    display: none;
}

/* Tabellen-Layout ERZWINGEN */
.table-responsive {
    margin-bottom: 1rem;
    overflow-x: auto;
}

.table-responsive .table,
table.table {
    font-size: 0.85rem;
    table-layout: fixed;
    width: 100%;
    display: table;
}

.table-responsive .table thead,
table.table thead {
    display: table-header-group;
}

.table-responsive .table tbody,
table.table tbody {
    display: table-row-group;
}

.table-responsive .table tr,
table.table tr {
    display: table-row;
}

.table-responsive .table th,
.table-responsive .table td,
table.table th,
table.table td {
    display: table-cell;
    padding: 8px 4px;
    vertical-align: middle;
}

/* Tabellen-Header */
.table-responsive .table thead th,
table.table thead th {
    font-size: 0.8rem;
    font-weight: 600;
}

/* KRITISCH: Spaltenbreiten fest definieren */
.table-responsive .table th.standing-position,
.table-responsive .table td.standing-position,
table.table th.standing-position,
table.table td.standing-position {
    width: 15%;
    min-width: 50px;
    text-align: center;
}

.table-responsive .table th.team-name,
.table-responsive .table td.team-name,
table.table th.team-name,
table.table td.team-name {
    width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-responsive .table th.standing-points,
.table-responsive .table td.standing-points,
table.table th.standing-points,
table.table td.standing-points {
    width: 25%;
    min-width: 50px;
    text-align: center;
}

/* Logos */
.table-responsive .table td.team-name img,
table.table td.team-name img {
    width: 18px;
    height: 18px;
    margin-right: 6px;
    vertical-align: middle;
}

/* Links */
.table-responsive .table td.team-name a,
table.table td.team-name a {
    display: inline;
    padding: 0;
    vertical-align: middle;
}
    
    /* ========================================================================
       SPIELPLAN: ACCORDION + CARDS
       ======================================================================== */
    
/* Desktop-Tabelle verstecken - HÖHERE SPEZIFITÄT */
.tab-pane .spielplan-table-desktop,
div.spielplan-table-desktop {
    display: none;
}

/* Mobile Cards zeigen - HÖHERE SPEZIFITÄT */
.tab-pane .spielplan-mobile,
div.spielplan-mobile {
    display: block;
}
    
    /* ZAT Accordion */
    .zat-accordion {
        margin-bottom: 1rem;
    }
    
    .zat-accordion-header {
        background: linear-gradient(135deg, #198754 0%, #146c43 100%);
        color: white;
        padding: 12px 15px;
        border-radius: 8px 8px 0 0;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-weight: 600;
        font-size: 1rem;
    }
    
    .zat-accordion-header.abgeschlossen {
        background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    }
    
    .zat-accordion-header i.bi-chevron-down {
        transition: transform 0.3s ease;
    }
    
    .zat-accordion-header.active i.bi-chevron-down {
        transform: rotate(180deg);
    }
    
    .zat-accordion-body {
        display: none;
        padding: 12px;
        background: white;
        border: 1px solid #dee2e6;
        border-top: none;
        border-radius: 0 0 8px 8px;
    }
    
    .zat-accordion-body.active {
        display: block;
    }
    
    /* Match Cards */
    .match-card {
        background: white;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 12px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    .match-card:last-child {
        margin-bottom: 0;
    }
    
    /* Spieltag-Header innerhalb ZAT */
    .match-spieltag-header {
        font-weight: 600;
        color: #495057;
        margin-bottom: 10px;
        padding-bottom: 8px;
        border-bottom: 2px solid #198754;
        font-size: 0.9rem;
    }
    
    /* Team Rows */
    .match-team {
        display: flex;
        align-items: center;
        padding: 10px;
        border-radius: 6px;
        margin-bottom: 4px;
    }
    
    .match-team.home {
        background-color: #fff3cd;
    }
    
    .match-team.away {
        background-color: #f8f9fa;
    }
    
    .match-team img {
        width: 24px;
        height: 24px;
        margin-right: 10px;
        flex-shrink: 0;
    }
    
    .match-team-name {
        flex-grow: 1;
        font-weight: 600;
        font-size: 0.95rem;
    }
    
    .match-team-info {
        font-size: 0.8rem;
        color: #6c757d;
        margin-top: 2px;
    }
    
    .match-team-icon {
        margin-right: 8px;
        opacity: 0.7;
    }
    
    /* Ergebnis */
    .match-result {
        text-align: center;
        padding: 15px 0;
        font-size: 1.5rem;
        font-weight: bold;
        color: #198754;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    
    .match-result.pending {
        color: #6c757d;
        font-size: 1.2rem;
    }
    
    .match-result i {
        font-size: 1.2rem;
    }
    
    /* Hinrunde / Rückrunde Header */
    .runde-header {
        margin: 1.5rem 0 1rem 0;
        padding-bottom: 8px;
        border-bottom: 3px solid #198754;
    }
    
    .runde-header.rueckrunde {
        border-bottom-color: #ffc107;
    }
    
    .runde-header h4 {
        font-size: 1.2rem;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    /* ========================================================================
       SETZEN: MOBILE OPTIMIERUNG
       ======================================================================== */
    
    /* ZAT-Auswahl: Single Column */
    .setzen-zat-auswahl .row > div {
        margin-bottom: 1rem;
    }
    
    .setzen-zat-auswahl .form-check {
        padding: 12px;
        margin-bottom: 8px;
        background: #f8f9fa;
        border-radius: 6px;
        border: 2px solid transparent;
        transition: all 0.2s;
    }
    
    .setzen-zat-auswahl .form-check:has(input:checked) {
        background: #d1e7dd;
        border-color: #198754;
    }
    
    .setzen-zat-auswahl .form-check-input {
        width: 20px;
        height: 20px;
        margin-top: 0.15rem;
    }
    
    .setzen-zat-auswahl .form-check-label {
        font-size: 0.95rem;
        padding-left: 8px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Setzen-Formular: Desktop-Tabelle verstecken */
    .setzen-table-desktop {
        display: none;
    }
    
    /* Setzen-Formular: Mobile Cards zeigen */
    .setzen-mobile {
        display: block;
    }
    
    /* Setzen Match Card */
    .setzen-match-card {
        background: white;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 15px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    .setzen-match-header {
        font-weight: 600;
        color: #198754;
        margin-bottom: 12px;
        font-size: 1rem;
    }
    
    /* Gegner-Info */
    .setzen-opponent {
        background: #f8f9fa;
        padding: 12px;
        border-radius: 6px;
        margin-bottom: 12px;
    }
    
    .setzen-opponent.home {
        background: #fff3cd;
        border-left: 4px solid #ffc107;
    }
    
    .setzen-opponent-name {
        font-weight: 600;
        font-size: 1rem;
        margin-bottom: 6px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .setzen-opponent-name img {
        width: 24px;
        height: 24px;
    }
    
    .setzen-opponent-stats {
        font-size: 0.85rem;
        color: #6c757d;
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .setzen-opponent-badges {
        margin-top: 8px;
    }
    
    /* Einsatz Input */
    .setzen-input-group {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .setzen-input-group label {
        font-weight: 600;
        font-size: 0.95rem;
        margin: 0;
        flex-shrink: 0;
    }
    
    .setzen-input-group input {
        width: 120px;
        height: 48px;
        font-size: 1.2rem;
        font-weight: bold;
        text-align: center;
        border: 2px solid #198754;
        border-radius: 8px;
    }
    
    .setzen-input-group .input-unit {
        font-size: 0.9rem;
        color: #6c757d;
    }
    
    /* TK-Anzeige */
    .setzen-tk-display {
        background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
        color: white;
        padding: 15px;
        border-radius: 8px;
        margin-top: 15px;
        text-align: center;
    }
    
    .setzen-tk-display-label {
        font-size: 0.9rem;
        opacity: 0.9;
        margin-bottom: 5px;
    }
    
    .setzen-tk-display-value {
        font-size: 2rem;
        font-weight: bold;
    }
    
    /* Submit Button */
    .setzen-submit {
        margin-top: 20px;
    }
    
    .setzen-submit .btn {
        width: 100%;
        padding: 15px;
        font-size: 1.1rem;
        font-weight: 600;
    }
    
    /* Zufallsgeneratoren-Info */
    .randomizer-info {
        margin-top: 1rem;
    }
    
    .randomizer-info .card-body {
        padding: 15px;
    }
    
    .randomizer-info .row > div {
        margin-bottom: 15px;
    }
    
    .randomizer-info .badge {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
    
    /* ========================================================================
       BUTTONS & FORMS
       ======================================================================== */
    
    /* Buttons volle Breite auf Mobile */
    .btn-block-mobile {
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* Button Sizing */
    .btn-sm {
        font-size: 0.875rem;
        padding: 6px 12px;
    }
    
    .btn {
        font-size: 0.95rem;
        padding: 10px 16px;
    }
    
    .btn-lg {
        font-size: 1.1rem;
        padding: 12px 20px;
    }
    
    /* Touch Targets minimum 44px */
    .btn,
    .form-check-input,
    .form-control,
    a.btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* ========================================================================
       BADGES & SMALL ELEMENTS
       ======================================================================== */
    
    .badge {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    .badge.fs-6 {
        font-size: 0.9rem;
        padding: 6px 10px;
    }
    
    small,
    .small {
        font-size: 0.85rem;
    }
    
    /* ========================================================================
       UTILITIES
       ======================================================================== */
    
    /* Text Wrapping */
    .text-nowrap {
        white-space: normal;
    }
    
    /* Spacing Utilities für Mobile anpassen */
    .mb-4 {
        margin-bottom: 1.5rem;
    }
    
    .mb-3 {
        margin-bottom: 1rem;
    }
    
    .mt-4 {
        margin-top: 1.5rem;
    }
    
    .mt-5 {
        margin-top: 2rem;
    }
    
    /* Row Gaps */
    .row {
        margin-left: -8px;
        margin-right: -8px;
    }
    
    .row > * {
        padding-left: 8px;
        padding-right: 8px;
    }
    
}

/* ============================================================================
   ENDE MOBILE STYLES
   ========================================================================= */