/* Globale Box-Sizing-Einstellung für korrekte Breitenberechnung */
* {
    box-sizing: border-box; 
}

/* --- Globale Einstellungen (Dark Mode) --- */
body {
    font-family: 'TASA Explorer', sans-serif; 
    background-color: #1e1e1e; 
    color: #f0f0f0; 
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

header {
    background-color: #0056b3; 
    color: white;
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

main {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    background: #252526; 
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

h2 {
    color: #4da6ff; 
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

hr {
    border: 0;
    border-top: 1px solid #444;
    margin: 20px 0;
}

/* --- Eingabeformular (Suchleiste) Styling --- */
#tracker-form {
    display: flex;
    gap: 10px;
}

#tracker-form input[type="text"] {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 1em;
    background-color: #333; 
    color: #f0f0f0;
    font-family: 'TASA Explorer', sans-serif; 
}

#tracker-form button {
    padding: 10px 15px;
    /* OUTLINE STYLING */
    background-color: transparent; 
    color: #007bff; 
    border: 2px solid #007bff; 
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'TASA Explorer', sans-serif; 
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2); 
}

#tracker-form button:hover {
    background-color: #007bff;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
}

#message {
    margin-top: 10px;
    padding: 8px;
    background-color: #58411d; 
    color: #ffc107;
    border: 1px solid #725b39;
    border-radius: 4px;
}

.hidden {
    display: none !important;
}

/* --- Sortierung Styling (AKTUALISIERT) --- */
#sort-controls select {
    padding: 8px 10px;
    
    /* OUTLINE STYLING */
    border: 2px solid #007bff; 
    background-color: transparent; 
    color: #007bff; 
    
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    margin-left: 5px;
    
    /* Font und Schatten */
    font-family: 'TASA Explorer', sans-serif; 
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2); 
    
    /* Optional: Einheitliche Höhe mit den Buttons sicherstellen */
    height: 42px; 
}

/* Optionale Anpassung der Option-Farben im Dropdown (funktioniert nicht überall) */
#sort-controls select option {
    background-color: #252526; 
    color: #f0f0f0;
}

/* --- Account-Karten Styling --- */
#account-cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px; 
    margin-top: 20px;
}

.account-card {
    background: #2d2d30; 
    border: 1px solid #333;
    padding: 15px;
    border-radius: 6px;
    
    width: calc(33.333% - 13.333333px); 

    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}


/* --- NEU: Profilbild und Kartenstruktur --- */

.card-header {
    display: flex;
    align-items: center;
    gap: 15px; 
    margin-bottom: 15px;
}

.profile-icon {
    width: 50px; /* Kleinere Größe für die Karte */
    height: 50px;
    border-radius: 50%;
    border: 3px solid #4da6ff; /* Blauer Rand */
    flex-shrink: 0; 
}

.header-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header-info h3 {
    margin: 0; 
    color: #f0f0f0;
}

.region-tag { 
    font-size: 0.8em; 
    font-weight: bold; 
    background-color: #444; 
    padding: 5px 8px; 
    border-radius: 4px; 
    color: #e0e0e0;
    white-space: nowrap; 
}

.winrate-display {
    margin-bottom: 15px;
    text-align: center;
}

.winrate-display .winrate-percent {
    font-size: 2.5em;
    font-weight: bold;
    display: block;
}

.winrate-percent.win {
    color: #2ecc71; 
}

.winrate-percent.loss {
    color: #e74c3c; 
}

.winrate-display p {
    font-size: 0.9em;
    color: #bbb;
    margin-top: 5px;
}

.show-history-btn {
    /* OUTLINE STYLING */
    width: 100%;
    padding: 8px;
    background-color: transparent; 
    color: #007bff; 
    border: 2px solid #007bff; 
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: auto;
    font-family: 'TASA Explorer', sans-serif; 
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2); 
}

.show-history-btn:hover {
    background-color: #007bff;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
}

/* --- Media Queries für Responsivität --- */
@media (max-width: 900px) {
    .account-card {
        width: calc(50% - 10px); 
    }
}
@media (max-width: 600px) {
    .account-card {
        width: 100%; 
    }
}

/* --- Match History Modal Styling --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #252526; 
    color: #f0f0f0;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2em;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    border: none;
    background: none;
}

.close-btn:hover {
    color: #fff;
}

/* --- Match History Tabelle Styling --- */
#match-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

#match-history-table th, #match-history-table td {
    padding: 10px;
    border: 1px solid #444; 
    text-align: left;
}

#match-history-table th {
    background-color: #333;
    color: #c7c7c7;
    font-weight: bold;
}

.match-win {
    background-color: #1f3a2c; 
    font-weight: bold;
    color: #2ecc71;
}

.match-loss {
    background-color: #4a1f1f; 
    font-weight: bold;
    color: #e74c3c;
}


/* --- Footer --- */
footer {
    text-align: center;
    padding: 10px;
    margin-top: 20px;
    color: #888;
    border-top: 1px solid #444;
}

/* --- Champion Icon Styling --- */

/* Sorgt dafür, dass Champion Icon und Name nebeneinander stehen */
.champion-cell {
    display: flex;
    align-items: center;
    gap: 8px; 
    text-align: left;
    white-space: nowrap; 
}

.champion-icon {
    width: 32px; 
    height: 32px;
    border-radius: 50%; 
    border: 1px solid #4da6ff; 
    flex-shrink: 0; 
}

.champion-name {
    white-space: normal; 
    overflow: visible; 
    text-overflow: clip; 
    font-weight: bold;
}

/* B. Entfernung der festen Spaltenbreite */
/* WICHTIG: Dies gibt der Champion-Spalte den benötigten Platz */
#match-history-table th:nth-child(2),
#match-history-table td:nth-child(2) {
    width: auto; 
}