/* Fischtown Pinguins Hockey Stats - Verbesserte Styles mit Barrierefreiheit */

/* === GRUNDLEGENDE STYLES === */
.hockey-stats-wrapper {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    position: relative;
    color: white;
    
}

.hockey-stats-header {
    text-align: center;
    margin-bottom: 2rem;
}

.hockey-stats-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    margin: 0 0 0.5rem 0;
}

.hockey-stats-subtitle {
    color: #ccc;
    font-size: 0.9rem;
    margin: 0;
}

/* === LOADING UND ERROR STATES === */
.hockey-stats-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: #ccc;
    font-style: italic;
}

.hockey-stats-loading::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #EEE425;
    border-radius: 50%;
    animation: hockey-stats-spin 1s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

@keyframes hockey-stats-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hockey-stats-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    text-align: center;
}

.hockey-stats-error::before {
    content: "⚠ ";
    font-weight: bold;
}

/* === CONTROLS === */
.hockey-stats-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #fff;
}

.hockey-stats-search-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 250px;
}

.hockey-stats-search-label {
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

.hockey-stats-search-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
}

.hockey-stats-search-input:focus {
    outline: none;
    border-color: #EEE425;
    box-shadow: 0 0 0 3px rgba(238, 228, 37, 0.1);
}

.hockey-stats-refresh-btn {
    background: #EEE425;
    color: #000;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.hockey-stats-refresh-btn:hover:not(:disabled) {
    background: #d4c41f;
    transform: translateY(-1px);
}

.hockey-stats-refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.hockey-stats-info {
    font-size: 0.9rem;
    color: #ccc;
    white-space: nowrap;
}

/* === TABELLE === */
.hockey-stats-table {
    width: 100%;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: none;
    border: none;
}

.hockey-stats-table-header {
    display: grid;
    grid-template-columns: 80px 1fr 80px 80px 80px 80px 100px 80px;
    gap: 0 1rem;
    background: transparent;
    border-bottom: 2px solid #666;
    padding: 1rem 0.5rem;
    font-weight: 600;
    color: white;
    font-size: 1.1rem;
}

.hockey-stats-table-row {
    display: grid;
    grid-template-columns: 80px 1fr 80px 80px 80px 80px 100px 80px;
    gap: 0 1rem;
    padding: 1rem 0.5rem;
    border-bottom: 1px solid #444;
    transition: background-color 0.2s ease;
    align-items: center;
    background: transparent;
}

.hockey-stats-table-row:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hockey-stats-table-row:last-child {
    border-bottom: 1px solid #444;
}

.hockey-stats-table-cell {
    text-align: center;
    font-size: 1.1rem;
    color: white;
    padding: 0.25rem;
}

.hockey-stats-table-cell:nth-child(2) {
    text-align: left;
    font-weight: 500;
    color: white;
}

/* === SORTIERUNG === */
.hockey-stats-sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 0.5rem;
    position: relative;
}

.hockey-stats-sortable:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hockey-stats-sortable:focus {
    outline: 2px solid #EEE425;
    outline-offset: 2px;
}

.hockey-stats-sort-indicator {
    font-weight: bold;
    color: #EEE425;
    margin-left: 0.25rem;
    font-size: 0.8rem;
}

/* === PAGINATION === */
.hockey-stats-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.hockey-stats-pagination-btn {
    padding: 0.75rem 1rem;
    border: 1px solid #666;
    background: transparent;
    color: white;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 44px;
    text-align: center;
}

.hockey-stats-pagination-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: #999;
}

.hockey-stats-pagination-btn:focus {
    outline: 2px solid #EEE425;
    outline-offset: 2px;
}

.hockey-stats-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hockey-stats-pagination-btn.active {
    background: #EEE425;
    color: #000;
    border-color: #EEE425;
    font-weight: 600;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1024px) {
    .hockey-stats-table-header,
    .hockey-stats-table-row {
        grid-template-columns: 70px 1fr 70px 70px 70px 70px 90px 70px;
        gap: 0 0.5rem;
    }
    
    .hockey-stats-table-cell {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .hockey-stats-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hockey-stats-search-container {
        min-width: auto;
        flex-direction: column;
        align-items: stretch;
    }
    
    .hockey-stats-table-header {
        display: none;
    }
    
    .hockey-stats-table-row {
        display: block;
        margin-bottom: 1.5rem;
        padding: 1.5rem;
        border-radius: 8px;
        border: 1px solid #666;
        background: transparent;
    }
    
    .hockey-stats-table-row:hover {
        background: rgba(255, 255, 255, 0.1);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
    
    .hockey-stats-table-cell {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        text-align: left !important;
        border-bottom: 1px solid #555;
        font-size: 1.1rem;
        color: white;
    }
    
    .hockey-stats-table-cell:last-child {
        border-bottom: none;
    }
    
    .hockey-stats-table-cell::before {
        content: attr(data-label);
        font-weight: 600;
        color: #ccc;
        flex: 1;
        min-width: 120px;
    }
    
    .hockey-stats-table-cell:nth-child(1)::before { content: "Nummer:"; }
    .hockey-stats-table-cell:nth-child(2)::before { content: "Spieler:"; }
    .hockey-stats-table-cell:nth-child(3)::before { content: "Spiele:"; }
    .hockey-stats-table-cell:nth-child(4)::before { content: "Punkte:"; }
    .hockey-stats-table-cell:nth-child(5)::before { content: "Tore:"; }
    .hockey-stats-table-cell:nth-child(6)::before { content: "Vorlagen:"; }
    .hockey-stats-table-cell:nth-child(7)::before { content: "Strafzeiten:"; }
    .hockey-stats-table-cell:nth-child(8)::before { content: "+/-:"; }
    
    .hockey-stats-pagination {
        gap: 0.25rem;
    }
    
    .hockey-stats-pagination-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .hockey-stats-wrapper {
        margin: 0 -0.5rem;
    }
    
    .hockey-stats-controls {
        margin: 0 0.5rem 1rem 0.5rem;
    }
    
    .hockey-stats-table {
        margin: 0 0.5rem;
    }
    
    .hockey-stats-pagination {
        margin: 1rem 0.5rem 0 0.5rem;
        flex-wrap: wrap;
    }
}

/* === ACCESSIBILITY IMPROVEMENTS === */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.hockey-stats-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;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hockey-stats-table {
        border: 2px solid;
    }
    
    .hockey-stats-table-row {
        border-bottom: 1px solid;
    }
    
    .hockey-stats-refresh-btn {
        border: 2px solid;
    }
}

/* Focus indicators für bessere Keyboard-Navigation */
.hockey-stats-search-input:focus,
.hockey-stats-sortable:focus,
.hockey-stats-pagination-btn:focus,
.hockey-stats-refresh-btn:focus {
    outline: 2px solid #EEE425;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .hockey-stats-controls,
    .hockey-stats-pagination {
        display: none;
    }
    
    .hockey-stats-table {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .hockey-stats-table-row:hover {
        background: transparent;
    }
}
