/* DATEI: assets/statistiken.css */

/* --- BASIS LAYOUT --- */
.stats-container {
    max-width: 90%;
    margin: 20px auto;
    margin-top: 7rem;
    margin-bottom: 7rem;
    padding: 0 15px;
}

/* --- DASHBOARD GRID (Kacheln Schritt 1) --- */
.grid-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 1%;
    margin-top: 20px;
}
.box {
    background: white;
    border: 1px solid #ddd;
    padding: 8%;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
    text-align: center;
    height: 25vh;
}
.box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: saddlebrown;
}
.box h4 { margin: 0; color: saddlebrown; font-size: 1.8rem; }

/* --- DASHBOARD LAYOUT (Schritt 2) --- */
.stats-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

/* Chart Header */
.chart-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
}
.year-controls button {
    background: #eee; border: none; padding: 5px 12px; cursor: pointer;
    font-weight: bold; border-radius: 4px; font-size: 1.2rem;
}
.year-controls button:hover { background: #ddd; }

/* Dropdowns */
.stat-select {
    padding: 5px 10px; border: 1px solid saddlebrown; border-radius: 12px;
    background: floralwhite; color: #333; font-family: inherit; font-size: 16px; cursor: pointer;
}

/* --- LISTEN & TABELLEN --- */
#top-songs-list, .simple-list { list-style: none; padding: 0; }
#top-songs-list li, .simple-list li {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; font-size: 1.1rem;
}
#top-songs-list li:hover, .interactable-list li:hover { background: #f9f9f9; }
.badge {
    background: #eee; padding: 4px 10px; border-radius: 6px; font-size: 0.9em; white-space: nowrap;
}

/* Tabellen */
.table-search-input { width: 100%; padding: 8px; margin-bottom: 10px; border: 1px solid #ccc; border-radius: 6px; }
table.song-table, table.history-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { padding: 10px; border-bottom: 1px solid #ddd; text-align: left; vertical-align: top; font-size: 1rem; }
th { background: #f4f4f4; cursor: pointer; user-select: none; font-weight:bold; }
th:hover { background: #e0e0e0; }
tr:hover { background-color: floralwhite; }
.holiday-text { color: #4682B4; font-style: italic; }

/* --- BUTTONS & TAGS --- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }

.tag-btn, .small-btn {
    padding: 10px 18px;
    background: floralwhite;
    border: 1px solid saddlebrown;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    /* Reset für Mobile */
    -webkit-appearance: none; appearance: none;
}
.tag-btn:hover, .small-btn:hover {
    background: saddlebrown;
    color: white;
}

.close-btn {
    background: transparent; color: #999; border: 1px solid #ddd; border-radius: 50%;
    width: 32px; height: 32px; cursor: pointer;
    font-weight: bold; font-size: 1.2rem;
    transition: all 0.2s;
    display: flex; justify-content: center; align-items: center;
}
.close-btn:hover { border-color: saddlebrown; color: saddlebrown; }

/* Logout Button Special Style */
.logout-btn {
    background-color: #dc3545 !important; /* Rot */
    border-color: #b02a37 !important;
    color: white !important;
    text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center;
}
.logout-btn:hover {
    background-color: #bb2d3b !important;
    border-color: #b02a37 !important;
}

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid #ddd; margin-bottom: 15px; }
.tab-btn {
    padding: 10px 20px; background: none; border: none; cursor: pointer;
    font-size: 1rem; color: #666; border-bottom: 3px solid transparent;
}
.tab-btn.active { color: saddlebrown; border-bottom: 3px solid saddlebrown; font-weight: bold; }
.tab-btn:hover { color: #333; }

/* --- MODAL --- */
.modal {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5); justify-content: center; align-items: center;
}
.modal-content {
    background: white; padding: 25px; border-radius: 12px; width: 90%; max-width: 700px;
    max-height: 80vh; overflow-y: auto; position: relative;
}
.close-modal { position: absolute; right: 20px; top: 15px; font-size: 32px; cursor: pointer; color:#666; }
.close-modal:hover { color: #000; }
.back-btn { background: none; border: none; color: #666; cursor: pointer; margin-bottom: 10px; font-size: 1.1rem; }

/* --- LOGIN MASKE (Anmeldung) --- */
.login-container {
    max-width: 400px;
    margin: 0 auto;
    margin-top: 20rem; /* Dein Wunsch: 20rem Abstand oben */
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* --- MEDIA QUERIES (Mobile / Tablet) --- */
@media (max-width: 800px) {
    .stats-layout { grid-template-columns: 1fr; }
    .stats-container { margin-bottom: 70%; }

    /* Login Maske auf Handy weiter oben, sonst muss man zu weit scrollen */
    .login-container {
        margin-top: 8rem;
    }

    /* SPEZIELL FÜR IPHONE/IPAD/TOUCH: Blaue Buttons */
    .tag-btn, .small-btn {
        background-color: #007AFF !important; /* iOS Blau */
        color: white !important;
        border: 1px solid #0051a8 !important;
        font-weight: 500;
    }

    /* Logout Button soll auf Mobile ROT bleiben (iOS Style Löschen/Exit) */
    .logout-btn {
        background-color: #ff3b30 !important; /* iOS Rot */
        border: 1px solid #ff3b30 !important;
    }

    /* Aktive Tabs mobil auch etwas deutlicher */
    .tab-btn.active {
        color: #007AFF;
        border-bottom-color: #007AFF;
    }

    .grid-buttons {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    .box {
      height: 20vh;
    }
    .box h4 {font-size: 1.3rem; }
}
