/**
 * DexTracker — Stylesheet
 * Mobile-First, Pokémon-themed bunt & verspielt
 */

/* =========================================
   CSS Variables
   ========================================= */
:root {
    --poke-red: #EE1515;
    --poke-red-dark: #C41010;
    --poke-blue: #3B4CCA;
    --poke-yellow: #FFDE00;
    --poke-yellow-dark: #B3A125;
    --poke-gold: #DAA520;
    --bg-light: #F0F4F8;
    --bg-card: #FFFFFF;
    --bg-header: #EE1515;
    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --text-light: #FFFFFF;
    --border-color: #DFE6E9;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: 0.25s ease;
    --font: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    --caught-bg: #E8F8E8;
    --uncaught-border: #FFD700;
    --unavailable-bg: #F0F0F0;
}

/* =========================================
   Reset & Base
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--poke-blue);
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================
   App Header
   ========================================= */
.app-header {
    background: linear-gradient(135deg, var(--poke-red), var(--poke-red-dark));
    color: var(--text-light);
    padding: 0 16px;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(238, 21, 21, 0.3);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.logo-pokeball {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(180deg, #FFF 0%, #FFF 42%, #333 42%, #333 58%, var(--poke-red) 58%, var(--poke-red) 100%);
    border: 2px solid #333;
    position: relative;
    flex-shrink: 0;
}

.logo-pokeball::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #FFF;
    border: 2px solid #333;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-greeting {
    font-size: 0.85rem;
    opacity: 0.9;
    display: none;
}

@media (min-width: 480px) {
    .user-greeting {
        display: inline;
    }
}

/* Burger Menu Toggle */
.nav-toggle {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    transition: background var(--transition);
}

.nav-toggle:hover {
    background: rgba(255,255,255,0.25);
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: white;
    border-radius: 1px;
}

/* =========================================
   Navigation Drawer
   ========================================= */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.nav-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.nav-drawer {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: var(--bg-card);
    z-index: 201;
    transition: right 0.3s ease;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
}

.nav-drawer.open {
    right: 0;
}

.nav-drawer-header {
    background: linear-gradient(135deg, var(--poke-red), var(--poke-blue));
    padding: 24px 20px;
    color: white;
}

.trainer-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.trainer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: white;
    border: 2px solid rgba(255,255,255,0.4);
}

.trainer-info strong {
    display: block;
    font-size: 1rem;
}

.trainer-info small {
    opacity: 0.85;
    font-size: 0.8rem;
}

.nav-drawer-links {
    padding: 12px 0;
}

.nav-drawer-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-primary);
    font-weight: 600;
    transition: background var(--transition);
}

.nav-drawer-links a:hover,
.nav-drawer-links a.active {
    background: #F5F5FF;
    color: var(--poke-blue);
}

.nav-icon {
    font-size: 1.2rem;
    width: 28px;
    text-align: center;
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 20px;
}

.nav-label {
    display: block;
    padding: 8px 20px 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.nav-logout {
    color: var(--poke-red) !important;
}

/* =========================================
   Bottom Navigation (Mobile)
   ========================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 99;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: color var(--transition);
}

.bottom-nav-item.active {
    color: var(--poke-red);
}

.bottom-nav-icon {
    font-size: 1.4rem;
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
}

/* =========================================
   Main Content
   ========================================= */
.app-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px 16px 80px;
}

@media (min-width: 768px) {
    .app-main {
        padding-bottom: 32px;
    }
}

/* =========================================
   Auth Pages (Login / Register)
   ========================================= */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.pokeball-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--poke-red) 0%, var(--poke-red) 42%, #333 42%, #333 58%, #FFF 58%, #FFF 100%);
    border: 3px solid #333;
    position: relative;
    margin: 0 auto 16px;
}

.pokeball-large::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FFF;
    border: 3px solid #333;
}

.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--poke-red);
}

.auth-logo p {
    color: var(--text-secondary);
    margin-top: 4px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.form-group input {
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 1rem;
    transition: border-color var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--poke-blue);
}

.auth-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-switch a {
    font-weight: 700;
    color: var(--poke-red);
}

/* =========================================
   Buttons
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--poke-red), var(--poke-red-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(238, 21, 21, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(238, 21, 21, 0.4);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
}

.btn-danger {
    background: #E74C3C;
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* =========================================
   Alerts
   ========================================= */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 0.9rem;
}

.alert-error {
    background: #FFF0F0;
    color: #E74C3C;
    border: 1px solid #FFCDD2;
}

.text-success { color: #27AE60; }
.text-error { color: #E74C3C; }

/* =========================================
   Total Progress Card
   ========================================= */
.total-progress-card {
    background: linear-gradient(135deg, var(--poke-blue), #5C6BC0);
    color: white;
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(59, 76, 202, 0.3);
}

.total-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.total-progress-label {
    font-weight: 700;
    font-size: 1rem;
}

.total-progress-count {
    font-size: 0.9rem;
}

.total-progress-count strong {
    font-size: 1.1rem;
}

/* =========================================
   Progress Bar
   ========================================= */
.progress-bar {
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
    flex: 1;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--poke-yellow), #FFA500);
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 0;
}

.progress-bar-total {
    height: 10px;
    background: rgba(255,255,255,0.25);
}

.progress-bar-total .progress-fill {
    background: linear-gradient(90deg, var(--poke-yellow), #FF6B6B);
}

/* =========================================
   Search
   ========================================= */
.search-container {
    position: relative;
    margin-bottom: 16px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    font-size: 1.1rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 44px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-family: var(--font);
    font-size: 1rem;
    background: var(--bg-card);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input:focus {
    border-color: var(--poke-blue);
    box-shadow: 0 0 0 3px rgba(59, 76, 202, 0.15);
}

.search-clear {
    position: absolute;
    right: 12px;
    width: 28px;
    height: 28px;
    border: none;
    background: var(--border-color);
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 4px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #F8F9FA;
}

.search-result-unavailable {
    opacity: 0.4;
}

.search-result-sprite {
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
}

.search-result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.search-result-number {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.search-result-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

/* =========================================
   Home Page
   ========================================= */
.home-page {
    padding-top: 8px;
}

.home-greeting {
    margin-bottom: 20px;
}

.home-greeting h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
}

.home-greeting p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 2px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 600px) {
    .module-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (min-width: 900px) {
    .module-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.module-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 14px;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--card-color);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    aspect-ratio: 1 / 1;
    justify-content: center;
}

@media (min-width: 600px) {
    .module-card {
        padding: 20px;
        aspect-ratio: auto;
    }
}

.module-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--card-color);
    opacity: 0.08;
    transition: all 0.3s ease;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.module-card:hover::before {
    transform: scale(1.5);
    opacity: 0.12;
}

.module-card:active {
    transform: translateY(0);
}

.module-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.module-icon {
    font-size: 1.3rem;
}

.module-name {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--card-color);
    line-height: 1.2;
}

@media (min-width: 600px) {
    .module-card-header { gap: 10px; margin-bottom: 12px; }
    .module-icon { font-size: 1.6rem; }
    .module-name { font-size: 1.15rem; }
}

.module-card-stats {
    margin-bottom: 6px;
}

.module-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.module-count strong {
    font-size: 1rem;
    color: var(--text-primary);
}

@media (min-width: 600px) {
    .module-card-stats { margin-bottom: 10px; }
    .module-count { font-size: 0.9rem; }
    .module-count strong { font-size: 1.2rem; }
}

.module-progress-bar {
    height: 6px;
    background: var(--bg-light);
    border-radius: 3px;
    overflow: hidden;
}

@media (min-width: 600px) {
    .module-progress-bar { height: 8px; border-radius: 4px; }
}

.module-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--card-color), var(--card-color-light));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.module-badge-complete {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--poke-gold);
}

.module-badge-empty {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
}

@media (min-width: 600px) {
    .module-badge-complete, .module-badge-empty { font-size: 0.8rem; margin-top: 10px; }
}

/* =========================================
   Back Link & Empty State
   ========================================= */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding: 4px 0;
    transition: color var(--transition);
}

.back-link:hover {
    color: var(--poke-red);
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.empty-state p {
    margin-bottom: 16px;
    font-weight: 600;
}

/* =========================================
   Regions Accordion
   ========================================= */
.regions-accordion {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.region-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.region-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font);
    text-align: left;
    transition: background var(--transition);
}

.region-header:hover {
    background: #F8F9FA;
}

.region-header[aria-expanded="true"] {
    background: #F0F4FF;
    border-bottom: 1px solid var(--border-color);
}

.region-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.region-name {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-primary);
}

.region-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.region-header .progress-bar {
    width: 80px;
    height: 6px;
    background: var(--border-color);
    flex-shrink: 0;
}

.region-header .progress-fill {
    background: linear-gradient(90deg, #27AE60, #2ECC71);
}

.region-chevron {
    color: var(--text-secondary);
    font-size: 0.8rem;
    transition: transform var(--transition);
    flex-shrink: 0;
}

.region-content {
    padding: 8px;
}

/* =========================================
   Pokémon List Items
   ========================================= */
.pokemon-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    animation: listItemFadeIn 0.3s ease-out both;
}

/* Staggered entrance animation */
.pokemon-list-item:nth-child(1) { animation-delay: 0s; }
.pokemon-list-item:nth-child(2) { animation-delay: 0.02s; }
.pokemon-list-item:nth-child(3) { animation-delay: 0.04s; }
.pokemon-list-item:nth-child(4) { animation-delay: 0.06s; }
.pokemon-list-item:nth-child(5) { animation-delay: 0.08s; }
.pokemon-list-item:nth-child(n+6) { animation-delay: 0.1s; }

@keyframes listItemFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.pokemon-uncaught {
    border-color: var(--uncaught-border);
    background: #FFFEF5;
}

.pokemon-caught {
    background: var(--caught-bg);
}

.pokemon-unavailable {
    opacity: 0.35;
    filter: grayscale(1);
    pointer-events: none;
}

.pokemon-sprite-wrapper {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pokemon-sprite {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
}

.pokemon-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    min-width: 0;
}

.pokemon-number {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 700;
}

.pokemon-name {
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Custom Checkbox */
.pokemon-checkbox-wrapper {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.pokemon-checkbox {
    display: none;
}

.pokemon-checkmark {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    position: relative;
}

.pokemon-checkbox:checked + .pokemon-checkmark {
    background: linear-gradient(135deg, #27AE60, #2ECC71);
    border-color: #27AE60;
    animation: checkPop 0.35s ease;
}

@keyframes checkPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.pokemon-checkbox:checked + .pokemon-checkmark::after {
    content: '✓';
    color: white;
    font-weight: 800;
    font-size: 0.9rem;
}

.pokemon-list-loading {
    text-align: center;
    padding: 32px;
    color: var(--text-secondary);
    font-weight: 600;
}

.pokemon-list-loading::before {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    margin: 0 auto 10px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    border-top-color: var(--poke-red);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.modal-loading {
    text-align: center;
    padding: 48px;
    color: var(--text-secondary);
    font-weight: 700;
}

.modal-loading::before {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    border-top-color: var(--poke-red);
    animation: spin 0.8s linear infinite;
}

/* =========================================
   Pokémon Detail Modal
   ========================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
}

@media (min-width: 600px) {
    .modal-overlay {
        padding: 20px;
    }
}

.modal-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: var(--radius-xl);
    position: relative;
    animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0,0,0,0.15);
    color: white;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   Pokémon Card (Sammelkarten-Stil)
   ========================================= */
.pokemon-card {
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, var(--type-color), var(--type2-color));
    padding: 20px 24px 16px;
    text-align: center;
    color: white;
}

.card-number {
    font-size: 0.85rem;
    opacity: 0.8;
    font-weight: 700;
}

.card-name {
    font-size: 1.6rem;
    font-weight: 800;
    margin-top: 4px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.card-artwork {
    background: linear-gradient(180deg, var(--type-color) 0%, transparent 40%);
    padding: 16px 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* .card-artwork img is defined below in Swipe section with animation */

.card-types {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0 24px 16px;
}

.type-badge {
    padding: 4px 14px;
    border-radius: 20px;
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.type-badge-sm {
    padding: 2px 10px;
    font-size: 0.7rem;
}

.card-info {
    padding: 0 24px 12px;
}

.card-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.card-info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
}

.info-value {
    font-weight: 700;
    font-size: 0.85rem;
    text-align: right;
    max-width: 60%;
}

.card-description {
    padding: 12px 24px;
    background: #F8F9FA;
    margin: 0 16px;
    border-radius: var(--radius-sm);
}

.card-description p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-style: italic;
}

.card-trainer-status {
    padding: 12px 24px;
}

.trainer-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #F0F4FF;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--poke-blue);
}

.trainer-status-icon {
    font-size: 1.1rem;
}

.card-catch-toggle {
    padding: 16px 24px 24px;
    text-align: center;
}

/* =========================================
   Pokédex Badges (Detail Card)
   ========================================= */
.card-dex-badges {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 4px 24px 16px;
    flex-wrap: wrap;
}

.dex-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid;
    transition: all 0.3s ease;
}

.dex-badge-caught {
    background: linear-gradient(135deg, #27AE60, #2ECC71);
    border-color: #27AE60;
    color: white;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.dex-badge-missing {
    background: transparent;
    border-color: var(--border-color);
    color: #BDC3C7;
}

/* =========================================
   Swipe Hint & Card Animations
   ========================================= */
.card-swipe-hint {
    padding: 8px 24px 20px;
    text-align: center;
}

.card-swipe-hint span {
    font-size: 0.75rem;
    color: #BDC3C7;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Swipe entry/exit animations */
.card-enter-left {
    animation: cardEnterLeft 0.25s ease-out;
}
.card-enter-right {
    animation: cardEnterRight 0.25s ease-out;
}
.card-enter-fade {
    animation: cardFadeIn 0.2s ease-out;
}
.card-exit-left {
    animation: cardExitLeft 0.15s ease-in forwards;
}
.card-exit-right {
    animation: cardExitRight 0.15s ease-in forwards;
}

@keyframes cardEnterLeft {
    from { transform: translateX(80px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes cardEnterRight {
    from { transform: translateX(-80px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes cardFadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes cardExitLeft {
    to { transform: translateX(-60px); opacity: 0; }
}
@keyframes cardExitRight {
    to { transform: translateX(60px); opacity: 0; }
}

/* Artwork hover/entrance animation */
.card-artwork img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.2));
    animation: artworkBounce 0.5s ease-out;
}

@keyframes artworkBounce {
    0% { transform: scale(0.8) translateY(10px); opacity: 0; }
    60% { transform: scale(1.05) translateY(-4px); opacity: 1; }
    100% { transform: scale(1) translateY(0); }
}

/* =========================================
   Statistik-Dashboard
   ========================================= */
.stats-page {
    padding-top: 8px;
}

.page-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.stats-section {
    margin-bottom: 28px;
}

.stats-section-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* Trainer Leaderboard */
.trainer-leaderboard {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leaderboard-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.leaderboard-me {
    border-left: 4px solid var(--poke-red);
    background: #FFF8F8;
}

.leaderboard-rank {
    font-size: 1.3rem;
    width: 36px;
    text-align: center;
    font-weight: 800;
    flex-shrink: 0;
    padding-top: 2px;
}

.leaderboard-info {
    flex: 1;
    min-width: 0;
}

.leaderboard-name {
    font-weight: 800;
    font-size: 1rem;
    display: block;
    margin-bottom: 8px;
}

.leaderboard-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.leaderboard-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.leaderboard-stat-icon {
    font-size: 0.85rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.leaderboard-progress {
    flex: 1;
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.leaderboard-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.leaderboard-stat-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    width: 65px;
    text-align: right;
    flex-shrink: 0;
}

/* Regionen-Fortschritt Grid */
.region-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 600px) {
    .region-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.region-stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: var(--shadow-sm);
}

.region-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.region-stat-name {
    font-weight: 800;
    font-size: 0.85rem;
}

.region-stat-pct {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.region-complete {
    color: #27AE60;
}

.region-stat-bar {
    height: 6px;
    background: var(--bg-light);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.region-stat-fill {
    height: 100%;
    background: linear-gradient(90deg, #27AE60, #2ECC71);
    border-radius: 3px;
    transition: width 0.8s ease;
}

.region-stat-count {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Typ-Statistiken */
.type-stats-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
}

.type-stat-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.type-stat-row .type-badge-sm {
    width: 65px;
    text-align: center;
    flex-shrink: 0;
}

.type-stat-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.type-stat-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.type-stat-count {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    width: 32px;
    text-align: right;
    flex-shrink: 0;
}

/* =========================================
   Admin Pages
   ========================================= */
.admin-page {
    padding-bottom: 32px;
}

.admin-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.admin-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (min-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-icon {
    font-size: 1.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--poke-red);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Trainer Ranking */
.trainer-ranking {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trainer-rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.rank-pos {
    width: 32px;
    text-align: center;
    font-weight: 800;
}

.rank-name {
    flex: 1;
    font-weight: 700;
}

.rank-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Admin Forms */
.admin-form-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 16px 0;
    box-shadow: var(--shadow-sm);
}

.admin-form-card h3 {
    margin-bottom: 16px;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.form-message {
    margin-top: 12px;
    font-weight: 600;
}

/* User Cards */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.user-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.user-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--poke-red), var(--poke-blue));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.user-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.role-select {
    padding: 6px 10px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

/* Admin Pokémon Table */
.admin-pokemon-table {
    overflow-x: auto;
}

.admin-table-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #F0F4FF;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.admin-pokemon-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.admin-pokemon-row:hover {
    background: #F8F9FA;
}

.admin-col-id {
    width: 50px;
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.admin-col-name {
    flex: 1;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-col-flag {
    width: 50px;
    text-align: center;
    flex-shrink: 0;
    cursor: pointer;
}

.admin-col-flag input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--poke-red);
}

/* Toggle-All Header Links */
.admin-toggle {
    cursor: pointer;
    user-select: none;
    color: var(--poke-blue);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    transition: all 0.2s ease;
}

.admin-toggle:hover {
    color: var(--poke-red);
    text-decoration-style: solid;
}

.admin-toggle-flash {
    animation: toggleFlash 0.4s ease;
}

@keyframes toggleFlash {
    0% { color: var(--poke-blue); }
    50% { color: var(--poke-red); transform: scale(1.15); }
    100% { color: var(--poke-blue); transform: scale(1); }
}

.admin-save-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0 8px;
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
}

.admin-section {
    margin-top: 24px;
}

.admin-section h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

/* =========================================
   Error & Utility
   ========================================= */
.error-msg {
    text-align: center;
    padding: 20px;
    color: var(--poke-red);
    font-weight: 600;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* =========================================
   Home Section Title & Card Hint
   ========================================= */
/* =========================================
   Home Switch (Segmented Control)
   ========================================= */
.home-switch {
    display: flex;
    position: relative;
    background: var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3px;
    margin-bottom: 16px;
    overflow: hidden;
}

.home-switch-btn {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: transparent;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.home-switch-btn.active {
    color: white;
}

.home-switch-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    background: linear-gradient(135deg, var(--poke-red), var(--poke-red-dark));
    border-radius: calc(var(--radius-xl) - 2px);
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(238, 21, 21, 0.3);
}

.home-section {
    animation: sectionFadeIn 0.25s ease;
}

@keyframes sectionFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.module-card-hint {
    margin-top: 6px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
    display: none;
}

@media (min-width: 600px) {
    .module-card-hint {
        display: block;
        font-size: 0.8rem;
        margin-top: 8px;
    }
}

/* =========================================
   Catch All Button (per Region)
   ========================================= */
.catch-all-bar {
    padding: 8px 4px 12px;
    text-align: center;
}

.btn-catch-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: linear-gradient(135deg, #27AE60, #2ECC71);
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.25);
}

.btn-catch-all:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.35);
}

.btn-catch-all:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-catch-all-done {
    background: linear-gradient(135deg, #2ECC71, #58D68D) !important;
}

/* =========================================
   Fehlende Pokémon — Seite
   ========================================= */
.missing-page {
    padding-top: 8px;
}

.missing-header {
    margin-bottom: 16px;
}

.missing-title {
    font-size: 1.3rem;
    font-weight: 800;
}

.missing-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 4px;
}

/* Tabs */
.missing-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.missing-tabs::-webkit-scrollbar {
    display: none;
}

.missing-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition);
}

.missing-tab:hover {
    border-color: var(--tab-color);
    color: var(--tab-color);
}

.missing-tab.active {
    background: var(--tab-color);
    color: white;
    border-color: var(--tab-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.missing-tab .tab-icon {
    font-size: 1rem;
}

.missing-tab .tab-name {
    font-size: 0.85rem;
}

/* Missing List */
.missing-list {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.missing-region-group {
    border-bottom: 2px solid var(--border-color);
}

.missing-region-group:last-child {
    border-bottom: none;
}

.missing-region-title {
    padding: 12px 16px 4px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--poke-red);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #FFF8F8;
}

.missing-complete {
    text-align: center;
    padding: 48px 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #27AE60;
}

/* =========================================
   Formen-Pokédex
   ========================================= */
.form-species-sprite {
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
    flex-shrink: 0;
    margin-right: 4px;
}

.form-no-sprite {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: 50%;
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 800;
}

.form-type-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================
   Navigation Badge
   ========================================= */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--poke-red);
    color: white;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 800;
    margin-left: auto;
}

.nav-drawer-links a {
    position: relative;
}

/* =========================================
   Page Subtitle
   ========================================= */
.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* =========================================
   Form Row (inline groups)
   ========================================= */
.form-row {
    display: flex;
    gap: 12px;
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
    }
}

/* =========================================
   Feedback
   ========================================= */
.feedback-page {
    padding-top: 8px;
}

.feedback-form-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.feedback-form-card textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.95rem;
    resize: vertical;
    outline: none;
    transition: border-color var(--transition);
}

.feedback-form-card textarea:focus {
    border-color: var(--poke-blue);
}

.feedback-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--border-color);
    transition: all var(--transition);
}

.feedback-unread {
    border-left-color: var(--poke-red);
    background: #FFF8F8;
}

.feedback-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.feedback-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.feedback-meta strong {
    font-size: 0.9rem;
}

.feedback-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.feedback-badge-new {
    display: inline-block;
    padding: 2px 8px;
    background: var(--poke-red);
    color: white;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feedback-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.feedback-subject {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.feedback-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* =========================================
   Changelog
   ========================================= */
.changelog-page {
    padding-top: 8px;
}

.changelog-form-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 16px 0;
    box-shadow: var(--shadow-sm);
}

.changelog-form-card h3 {
    margin-bottom: 16px;
    font-size: 1rem;
}

.changelog-form-card textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    resize: vertical;
    outline: none;
}

.changelog-form-card textarea:focus {
    border-color: var(--poke-blue);
}

.changelog-list {
    margin-top: 16px;
}

.changelog-entry {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--poke-blue);
}

.changelog-entry-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.changelog-version {
    display: inline-block;
    padding: 3px 10px;
    background: var(--poke-blue);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 800;
}

.changelog-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.changelog-entry-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.changelog-entry-content {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.changelog-entry-actions {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

/* Changelog Load More */
.changelog-load-more {
    text-align: center;
    padding: 16px 0 8px;
}

/* =========================================
   User Status Badges & Pending Card
   ========================================= */
.user-badge-active {
    display: inline-block;
    padding: 2px 8px;
    background: #27AE60;
    color: white;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    margin-left: 4px;
}

.user-badge-pending {
    display: inline-block;
    padding: 2px 8px;
    background: #E67E22;
    color: white;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    margin-left: 4px;
}

.user-card-pending {
    border-left: 4px solid #E67E22;
    background: #FFF8F0;
}

/* Registration Success Alert */
.alert-success {
    background: #F0FFF0;
    color: #27AE60;
    border: 1px solid #C8E6C9;
}

/* =========================================
   Medaillen-Tracker
   ========================================= */
.medal-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.medal-item:last-child {
    border-bottom: none;
}

.medal-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.medal-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.medal-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.medal-tiers {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.medal-tier {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 2px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.medal-tier:active {
    transform: scale(0.93);
}

.medal-tier-active {
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 0 2px var(--poke-gold);
}

.medal-tier-locked {
    opacity: 0.3;
    filter: grayscale(100%);
}

.medal-tier-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.medal-tier-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.medal-tier-locked .medal-tier-placeholder {
    background: var(--border-color);
    color: var(--text-secondary);
    text-shadow: none;
}

.medal-tier-value {
    font-size: 0.6rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;
    line-height: 1.1;
    word-break: break-word;
}

/* ===== Events / Terminübersicht ===== */

.events-page {
    padding-bottom: 20px;
}

.events-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px 0;
}

.events-month-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    flex: 1;
}

.events-section {
    margin-bottom: 20px;
}

.events-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.events-table {
    display: flex;
    flex-direction: column;
}

.events-row {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    align-items: flex-start;
}

.events-row:last-child {
    border-bottom: none;
}

.events-date {
    flex: 0 0 110px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    padding-top: 1px;
}

@media (max-width: 400px) {
    .events-date {
        flex: 0 0 90px;
        font-size: 0.72rem;
    }
}

.events-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.events-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.events-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.events-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.events-admin-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.events-admin-actions .btn {
    flex: 0 0 auto;
}


/* ===== Remember-Me Checkbox ===== */

.form-group-remember {
    flex-direction: row !important;
    align-items: center;
    gap: 0 !important;
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400 !important;
    font-size: 0.88rem;
    color: var(--text-secondary);
    user-select: none;
}

.remember-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    padding: 0;
    accent-color: var(--poke-red);
    cursor: pointer;
    flex-shrink: 0;
}
