/* --- POKEMON WORLD: MODERN NINTENDO STYLE (BULLETPROOF EDITION) --- */

/* 1. IMPORTS & VARIABLES */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;700&family=Press+Start+2P&display=swap');

:root {
    /* Nintendo / Pokemon Palette */
    --pk-red: #E3350D;
    --pk-red-dark: #cc2800;
    --pk-blue: #3B4CCA;
    --pk-yellow: #FFDE00;
    --pk-gold: #B3A125;

    /* UI Colors (Modern Dark Pokedex Theme) */
    --ui-bg: #1C1C24;
    /* Deep Blue-Black Background */
    --ui-card-bg: #292932;
    /* Slightly Lighter Card Background */
    --ui-card-border: #3E3E4A;
    --ui-text-main: #FFFFFF;
    --ui-text-muted: #A0A0B0;
    --ui-accent: #4CD137;
    /* Game Boy Green Accent */

    /* Layout Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* 2. RESET & BASE STYLES */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #0F0F13;
    color: var(--ui-text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(59, 76, 202, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(227, 53, 13, 0.1) 0%, transparent 20%);
}

h1,
h2,
h3,
h4 {
    margin: 0 0 1rem 0;
    font-weight: 700;
}

/* Retro Font for Locations */
h2.location-title {
    font-family: 'Press Start 2P', cursive;
    color: var(--pk-yellow);
    font-size: 1.1rem;
    text-shadow: 2px 2px 0px #000;
    line-height: 1.8;
}

/* 3. ROBUST LAYOUT SYSTEM (MOBILE FIRST) */

/* The Main Container: Default is Vertical Stack (Mobile) */
.game-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* On mobile, everything stacks: Header -> Nav -> Main -> Actions */
}

/* Header */
.header {
    background-color: rgba(28, 28, 36, 0.95);
    padding: 15px 20px;
    border-bottom: 1px solid var(--ui-card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header h1 {
    margin: 0;
    font-size: 1.1rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Currency Badge */
.currency-badge {
    background: #333;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--pk-yellow);
    border: 1px solid #555;
}

/* Logout Link */
.logout-link {
    color: var(--ui-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.logout-link:hover {
    background: var(--pk-red);
    color: white;
}

/* SIDEBAR NAVIGATION (Menu) */
.left-sidebar {
    display: block;
    background: var(--ui-card-bg);
    padding: 10px;
    width: 100%;
    order: 2;
    border-bottom: 2px solid var(--ui-card-border);
    position: relative;
    /* Ensure z-index context */
    z-index: 50;
}

/* Main Menu Container */
.main-menu-wrapper {
    position: relative;
    width: 100%;
}

/* Main Toggle Button */
/* Main Toggle Button (Summary) */
.main-menu-summary {
    width: 100%;
    justify-content: center;
    background: var(--pk-blue);
    color: white;
    font-size: 1.1rem;
    border: 2px solid #5c6bc0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    list-style: none;
    /* Hide default triangle */
}

/* Hide webkit marker */
.main-menu-summary::-webkit-details-marker {
    display: none;
}

.main-menu-summary:hover {
    background: #303f9f;
    transform: translateY(-2px);
}

/* Dropdown Content */
/* Dropdown Content within Details */
.nav-dropdown-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    background: var(--ui-card-bg);
    border: 1px solid var(--ui-card-border);
    border-radius: var(--radius-md);
    padding: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);

    /* Animation origin */
    transform-origin: top center;
    animation: slideDown 0.3s ease-out forwards;
}

/* Ensure animation works when details opens */
details[open] .nav-dropdown-content {
    animation: slideDown 0.3s ease-out forwards;
}

/* Individual Buttons inside Dropdown */
.nav-btn {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.05);
    /* Slightly darker in menu */
    color: var(--ui-text-muted);
    border: 1px solid var(--ui-card-border);
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    text-align: left;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.2s;
    width: 100%;
    /* Full width in list */
}

.nav-btn i {
    font-size: 1.2rem;
    width: 25px;
    text-align: center;
}

.nav-btn:hover {
    background: #444;
    color: white;
    transform: translateX(5px);
    /* Slide right interaction */
    border-color: var(--pk-yellow);
}

/* Main Content Area */
.main-screen {
    background: var(--ui-card-bg);
    flex: 1;
    /* Take remaining space */
    order: 3;
    /* Below menu */
    min-height: 400px;
}

/* Location Header Image */
.location-header {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
    border-bottom: 4px solid var(--pk-red);
}

.location-header-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 60px 20px 15px;
}

.content-body {
    padding: 20px;
}

/* Actions Panel (Controls) */
.actions-wrapper {
    background: var(--ui-bg);
    border-top: 2px solid var(--ui-card-border);
    padding: 15px;
    order: 4;
    /* At the bottom */
}


/* 4. DESKTOP GRID LAYOUT (Min-Width 900px) */
/* This kicks in only on larger screens */
@media (min-width: 900px) {
    .game-container {
        display: grid;
        grid-template-columns: 280px 1fr 350px;
        grid-template-rows: auto 1fr;
        grid-template-areas:
            "header header header"
            "nav main actions";
        gap: 15px;
        padding: 15px;
        height: 100vh;
        overflow: hidden;
        /* Prevent body scroll, utilize internal scroll */
    }

    .header {
        grid-area: header;
        border-radius: var(--radius-md);
    }

    .header h1 {
        font-size: 1.2rem;
    }

    /* Sidebar becomes a vertical column */
    .left-sidebar {
        grid-area: nav;
        width: auto;
        border: none;
        background: transparent;
        padding: 0;
        display: flex;
        flex-direction: column;
        overflow-y: visible;
        /* Allow dropdown to overflow if needed */
        order: unset;
    }

    /* On Desktop, we might want to keep the "Main Menu" button concept, 
       or auto-expand it. 
       Let's stick to the User's request for LESS CLUTTER, so we keep the toggle 
       behavior even on desktop, just styled nicely in the column. 
    */
    .main-menu-wrapper {
        width: 100%;
    }

    .nav-dropdown-content {
        /* Ensure it sits on top if absolute, or pushes down if relative. 
           Relative (default) is better for the grid layout so it doesn't overlap content below.
        */
        position: relative;
        box-shadow: none;
        /* Blend in better on desktop */
        margin-top: 15px;
    }

    .main-screen {
        grid-area: main;
        border: 1px solid var(--ui-card-border);
        border-radius: var(--radius-lg);
        overflow-y: auto;
        margin-bottom: 0;
    }

    .actions-wrapper {
        grid-area: actions;
        background: transparent;
        border: none;
        padding: 0;
        overflow-y: auto;
    }
}

/* 5. UI COMPONENTS (Buttons, NPCs, Modals) */

/* NPC Cards */
.npc-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--ui-card-border);
    border-radius: var(--radius-md);
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.npc-card:hover {
    border-color: var(--ui-accent);
    background: rgba(76, 209, 55, 0.05);
}

.npc-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.npc-avatar {
    width: 40px;
    height: 40px;
    background: #444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
}

.npc-name {
    font-weight: bold;
    color: white;
}

.npc-action-btn {
    background: var(--ui-accent);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85rem;
}

.npc-action-btn:hover {
    filter: brightness(1.1);
}

/* D-Pad / Controls */
.dpad-container {
    background: var(--ui-card-bg);
    border: 1px solid var(--ui-card-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.dpad-grid {
    display: inline-grid;
    grid-template-areas: ". up ." "left center right" ". down .";
    gap: 10px;
}

.dpad-btn {
    width: 60px;
    height: 60px;
    background: #333;
    border: 2px solid #555;
    border-radius: 12px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dpad-btn:active {
    background: var(--pk-yellow);
    color: black;
}

/* Party Preview */
.party-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.party-slot {
    background: #222;
    border: 1px solid #444;
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
}

.party-slot img {
    width: 60px;
}

/* Modals (Fullscreen) */
.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(28, 28, 36, 0.95);
    /* Slightly transparent specific BG */
    z-index: 9999;
    display: none;
    /* Controlled by JS */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.fullscreen-modal-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.fullscreen-modal-header {
    background: var(--ui-card-bg);
    border-bottom: 2px solid var(--ui-card-border);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close-btn {
    background: var(--pk-red);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: bold;
    cursor: pointer;
}

/* Feedback Messages */
.feedback-message {
    background: rgba(76, 209, 55, 0.1);
    border: 1px solid var(--ui-accent);
    color: #a5d6a7;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Utility */
.spacer {
    height: 20px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* POKEDEX DETAILS MODAL */
.dex-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.dex-modal {
    background: #2e2e2e;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    border: 2px solid #555;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    padding: 20px;
    position: relative;
    animation: zoomIn 0.2s ease-out;
    color: #eee;
}

.dex-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.dex-modal-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #AED581;
}

.dex-modal-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.dex-modal-close:hover,
.dex-modal-close:focus {
    color: #fff;
    outline: 2px solid #AED581;
    border-radius: 4px;
}

.dex-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 200px;
}

.modal-img {
    width: 150px;
    height: 150px;
    image-rendering: pixelated;
}

.flavor-text {
    background: #222;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-style: italic;
    border-left: 4px solid #AED581;
    text-align: left;
    width: 100%;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
}

.stat-item {
    background: #444;
    padding: 8px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.stat-label {
    color: #aaa;
    font-size: 0.8rem;
    display: block;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* =========================================
   6. SHOP MODULE (Credits & Items)
   Shared styles for credit_shop.php & doneren.php
   ========================================= */

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.shop-category {
    margin-bottom: 40px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--ui-card-border);
    padding-bottom: 10px;
}

.category-header h2 {
    margin: 0;
    color: var(--pk-yellow);
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    letter-spacing: 1px;
}

/* Card Design */
.shop-card {
    background: linear-gradient(145deg, rgba(41, 41, 50, 0.9), rgba(30, 30, 38, 0.95));
    border: 1px solid var(--ui-card-border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
    backdrop-filter: blur(5px);
}

.shop-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    border-color: var(--ui-accent);
}

.shop-card.featured {
    border-color: var(--pk-gold);
    background: linear-gradient(145deg, rgba(60, 60, 70, 0.9), rgba(40, 40, 50, 0.95));
}

.card-icon {
    font-size: 2.5rem;
    color: var(--ui-text-muted);
    margin-bottom: 15px;
    text-align: center;
}

.shop-card:hover .card-icon {
    color: var(--ui-accent);
    animation: bounce 0.5s ease;
}

.card-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--ui-text-main);
    margin-bottom: 10px;
    text-align: center;
}

.card-desc {
    font-size: 0.9rem;
    color: var(--ui-text-muted);
    margin-bottom: 20px;
    flex-grow: 1;
    text-align: center;
    line-height: 1.4;
}

.card-price {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 15px;
    border-radius: 20px;
    text-align: center;
    font-weight: bold;
    color: var(--pk-gold);
    margin-bottom: 15px;
    border: 1px solid #444;
}

.btn-buy {
    width: 100%;
    padding: 12px;
    background: var(--ui-accent);
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: bold;
    cursor: pointer;
    transition: filter 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.btn-buy:hover {
    filter: brightness(1.15);
}

.btn-buy:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
    transform: none;
}

/* Confirmation Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

/* =========================================
   7. TOURNAMENT UI
   Modern styles for Brackets, Timeline, and Selection
   ========================================= */

/* Timeline / Bracket Container */
.tournament-bracket {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    position: relative;
    padding-left: 20px;
}

/* Timeline vertical line */
.tournament-bracket::before {
    content: '';
    position: absolute;
    left: 29px;
    /* Aligns with circle center */
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: #444;
    z-index: 0;
}

.bracket-round {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--ui-card-bg);
    border: 1px solid var(--ui-card-border);
    padding: 15px;
    border-radius: var(--radius-md);
    position: relative;
    z-index: 1;
    transition: all 0.2s;
}

.bracket-round.completed {
    border-color: #555;
    opacity: 0.7;
}

.bracket-round.active {
    border-color: var(--pk-yellow);
    background: rgba(255, 222, 0, 0.05);
    box-shadow: 0 0 15px rgba(255, 222, 0, 0.1);
    transform: scale(1.02);
}

.bracket-round.future {
    opacity: 0.5;
    background: transparent;
    border-style: dashed;
}

/* Round Indicator Circle */
.round-number {
    width: 40px;
    height: 40px;
    background: #333;
    border: 2px solid #555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #888;
    flex-shrink: 0;
    font-family: 'Outfit', sans-serif;
}

.bracket-round.completed .round-number {
    background: var(--ui-accent);
    color: #111;
    border-color: var(--ui-accent);
}

.bracket-round.active .round-number {
    background: var(--pk-yellow);
    color: #111;
    border-color: var(--pk-yellow);
    box-shadow: 0 0 10px var(--pk-yellow);
}

.opponent-info {
    flex-grow: 1;
}

.opponent-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--ui-text-main);
}

.bracket-round.completed .opponent-name {
    text-decoration: line-through;
    color: #888;
}

.opponent-desc {
    font-size: 0.85rem;
    color: var(--ui-text-muted);
}

/* Pokemon Selection Cards (Replacement for basic grid) */
.pokemon-selection-card {
    background: var(--ui-card-bg);
    border: 1px solid var(--ui-card-border);
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.pokemon-selection-card:hover {
    border-color: var(--pk-yellow);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.pokemon-selection-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pokemon-selection-img {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.5));
}

.pokemon-selection-details h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--ui-text-main);
}

.pokemon-selection-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--ui-text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: var(--radius-sm);
}

.choose-btn {
    width: 100%;
    margin-top: auto;
    background: #333;
    color: white;
    border: 1px solid #555;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-weight: bold;
    transition: all 0.2s;
}

.pokemon-selection-card:hover .choose-btn {
    background: var(--pk-yellow);
    color: black;
    border-color: var(--pk-yellow);
}

/* Modal Confirmation for Tournament is just a simple overlay if needed, re-using .modal-overlay */

.confirm-modal {
    background: var(--ui-card-bg);
    border: 2px solid var(--ui-accent);
    width: 90%;
    max-width: 400px;
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 30px rgba(76, 209, 55, 0.2);
}

.modal-overlay.active .confirm-modal {
    transform: scale(1);
}

/* =========================================
   7. PLAYER LIST (COMMUNITY) STYLES
   ========================================= */

.player-list-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--ui-text-main);
    font-size: 0.95rem;
}

.player-list-table th {
    text-align: left;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 2px solid var(--ui-card-border);
    color: var(--ui-text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
}

.player-list-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.player-list-table tr:last-child td {
    border-bottom: none;
}

.player-list-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.player-name {
    font-weight: bold;
    color: white;
}

/* Role Badges */
.role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.7rem;
    margin-left: 5px;
    vertical-align: middle;
}

.badge-admin {
    background: #d32f2f;
    color: white;
    box-shadow: 0 0 5px rgba(211, 47, 47, 0.5);
}

.badge-elite {
    background: linear-gradient(135deg, #FFD700, #FFA000);
    color: #444;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    animation: pulse-gold 2s infinite;
}

@keyframes pulse-gold {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
    }

    70% {
        box-shadow: 0 0 0 5px rgba(255, 215, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.status-indicator.online {
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-indicator.offline {
    color: #777;
    border: 1px solid rgba(119, 119, 119, 0.3);
}

/* Tabs */
.modal-tabs .tab-btn {
    background: transparent;
    border: 1px solid var(--ui-card-border);
    color: var(--ui-text-muted);
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: bold;
    transition: all 0.2s;
}

.modal-tabs .tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.modal-tabs .tab-btn.active {
    background: var(--ui-accent);
    color: black;
    border-color: var(--ui-accent);
}

/* Profile Button */
.btn-profile {
    display: inline-block;
    padding: 5px 12px;
    background: #444;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.btn-profile:hover {
    background: var(--pk-blue);
}

/* Pagination */
.page-btn {
    background: #333;
    border: 1px solid #555;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
}

.page-btn:hover {
    background: #555;
}


.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.btn-cancel {
    background: transparent;
    border: 2px solid #555;
    color: #ccc;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: bold;
}

.btn-cancel:hover {
    border-color: #888;
    color: white;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--ui-card-bg);
    border-left: 5px solid var(--ui-accent);
    padding: 15px 25px;
    border-radius: 4px;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideInLeft 0.3s ease-out forwards;
    min-width: 300px;
}

.toast.error {
    border-left-color: var(--pk-red);
}

/* Animations */
@keyframes slideInLeft {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 222, 0, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 222, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 222, 0, 0);
    }
}

.btn-glow {
    animation: pulse-glow 2s infinite;
    border: 1px solid var(--pk-gold);
}

/* Battle Results Overlay Styles */
.battle-results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 5px;
    /* For scrollbar space */
}

.battle-result-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ui-card-border);
    border-radius: var(--radius-sm);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.battle-result-icon {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.battle-result-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.battle-result-info {
    flex-grow: 1;
}

.battle-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.pokemon-name {
    font-weight: bold;
    color: var(--text-heading);
}

.level-indicator {
    font-size: 0.9em;
    color: var(--text-muted);
}

.level-up-badge {
    background: var(--pk-gold);
    color: black;
    font-weight: bold;
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    animation: bounce 1s infinite;
}

.xp-bar-container {
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin-top: 5px;
}

.xp-bar-fill {
    height: 100%;
    background: var(--pk-blue);
    /* Distinct from HP red/green */
    width: 0%;
    transition: width 1s ease-out;
}

.move-learn-badge {
    display: inline-block;
    font-size: 0.8em;
    color: #aaddff;
    margin-top: 4px;
}

/* =========================================
   MINICHAT STYLES
   Accessible chat component with WCAG AAA compliance
   ========================================= */

#minichat-container {
    background: var(--ui-card-bg);
    border: 1px solid var(--ui-card-border);
    border-radius: var(--radius-lg);
    padding: 15px;
    margin-top: 20px;
}

#minichat-container h3 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: var(--ui-text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

#minichat-container h3 i {
    color: var(--pk-blue);
}

/* Chat messages container */
#chat-messages {
    height: 150px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--ui-card-border);
    border-radius: var(--radius-sm);
    padding: 10px;
    margin-bottom: 10px;
    scroll-behavior: smooth;
}

/* Custom scrollbar for chat */
#chat-messages::-webkit-scrollbar {
    width: 8px;
}

#chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: var(--ui-card-border);
    border-radius: 4px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Individual chat message */
.chat-message {
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--ui-card-border);
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Own messages - distinct styling */
.chat-message-own {
    background: rgba(59, 76, 202, 0.15);
    border-left-color: var(--pk-blue);
}

/* Username styling */
.chat-username {
    font-weight: bold;
    color: var(--pk-yellow);
}

.chat-message-own .chat-username {
    color: var(--pk-blue);
}

/* Chat header row: username + timestamp */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

/* Message text */
.chat-text {
    color: var(--ui-text-main);
    margin: 3px 0 0 0;
}

/* Timestamp */
.chat-time {
    font-size: 0.7rem;
    color: var(--ui-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Chat input group */
.chat-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

#chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--ui-card-border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--ui-text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
}

#chat-input:focus {
    outline: 2px solid var(--pk-blue);
    outline-offset: 2px;
    border-color: var(--pk-blue);
}

#chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#chat-input::placeholder {
    color: var(--ui-text-muted);
}

/* Send button */
.chat-input-group button[type="submit"] {
    background: var(--ui-accent);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input-group button[type="submit"]:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.chat-input-group button[type="submit"]:active {
    transform: translateY(0);
}

.chat-input-group button[type="submit"]:focus {
    outline: 2px solid var(--pk-blue);
    outline-offset: 2px;
}



/* Empty state */
#chat-messages:empty::before {
    content: "No messages yet. Be the first to chat!";
    display: block;
    text-align: center;
    color: var(--ui-text-muted);
    padding: 20px;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    #minichat-container {
        margin-top: 15px;
    }

    #chat-messages {
        height: 120px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .chat-message {
        border-width: 2px;
    }

    #chat-input:focus,
    .chat-input-group button[type="submit"]:focus {
        outline-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    #chat-messages {
        scroll-behavior: auto;
    }

    .chat-input-group button[type="submit"]:hover {
        transform: none;
    }
}