/* Pokemon Go Battle Log — Modern Theme */
:root {
    --poke-navy:       #001f3f;
    --poke-dark-blue:  #003366;
    --poke-mid-blue:   #00509e;
    --poke-light-blue: #517bad;
    --poke-pale-blue:  #9bb7d4;
    --poke-sprite-bg:  #dce8f5;
    --poke-gold:       #ffd700;
    --poke-red:        #bf0a0d;
    --poke-red-hover:  #a3090b;
    --poke-win:        #198754;
    --poke-bg:         #001428;
}

/* ── Page ─────────────────────────────────────────── */
body {
    background: linear-gradient(160deg, #000812 0%, #000f24 40%, #001a3d 100%);
    min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────── */
#sidebar {
    background: linear-gradient(180deg, #001f3f 0%, #003566 100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.18);
    min-height: 100vh;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-title {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 6px;
}

.sidebar-section-label {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0 4px;
    margin-bottom: 6px;
}

.sidebar-welcome {
    background: rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 16px;
}

.sidebar-welcome-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-welcome-name {
    color: var(--poke-gold);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    margin-top: 2px;
}

#sidebar .nav-link {
    color: rgba(255, 255, 255, 0.75) !important;
    border-radius: 50px;
    padding: 10px 16px;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.15s ease, color 0.15s ease;
}

#sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
}

#sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
}

/* ── Cards ────────────────────────────────────────── */
.card {
    --bs-card-border-width: 0;
    border: none !important;
    outline: none !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45) !important;
    background-color: #fff !important;
    transform: translateZ(0);
    isolation: isolate;
}

.card-header {
    border-radius: 14px 14px 0 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* ── Login form inline title ──────────────────────── */
.form-card-title {
    color: var(--poke-mid-blue);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
}

/* ── Buttons ──────────────────────────────────────── */
.btn-poke-red {
    background: linear-gradient(135deg, #d40f12, #bf0a0d);
    border: none;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(191, 10, 13, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-poke-red:hover,
.btn-poke-red:focus {
    background: linear-gradient(135deg, #bf0a0d, #a3090b);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(191, 10, 13, 0.4);
}

.btn-premium {
    background: linear-gradient(135deg, #f5c400, #ffd700);
    border: none;
    color: #3d2b00;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 18px;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    letter-spacing: 0.03em;
}

.btn-premium:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.5);
    color: #3d2b00;
}

.btn-premium.active {
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.4), 0 4px 16px rgba(255, 215, 0, 0.45);
    color: #3d2b00;
}

/* ── Badges ───────────────────────────────────────── */
.badge-league {
    background-color: var(--poke-mid-blue) !important;
    color: #fff !important;
    font-weight: 600;
}

/* ── Battle Cards ─────────────────────────────────── */
.battle-card-win {
    border-left: 4px solid var(--poke-win) !important;
}

.battle-card-loss {
    border-left: 4px solid #dc3545 !important;
}

.battle-header-win {
    background-color: rgba(25, 135, 84, 0.06) !important;
}

.battle-header-loss {
    background-color: rgba(220, 53, 69, 0.06) !important;
}

/* ── Pokemon Sprites ──────────────────────────────── */
.pokemon-sprite {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background-color: var(--poke-sprite-bg);
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 31, 63, 0.15));
    padding: 4px;
}

/* ── VS Divider ───────────────────────────────────── */
.vs-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    flex-shrink: 0;
}

.vs-divider::before,
.vs-divider::after {
    content: '';
    flex: 1;
    width: 2px;
    background: #dee2e6;
    border-radius: 2px;
    min-height: 20px;
}

.vs-divider span {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--poke-mid-blue);
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 50px;
    padding: 4px 8px;
    margin: 6px 0;
    letter-spacing: 0.05em;
}

/* ── Team Sections (Battle Form) ─────────────────── */
.team-section {
    border-radius: 12px;
    background: #f8fafc;
    padding: 16px;
    height: 100%;
    border: 1px solid #e9ecef;
}

.team-header {
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-left: 10px;
    margin-bottom: 12px;
}

.team-player .team-header {
    color: var(--poke-mid-blue);
    border-left: 3px solid var(--poke-mid-blue);
}

.team-opponent .team-header {
    color: var(--poke-red);
    border-left: 3px solid var(--poke-red);
}

/* ── Battle Log Section ───────────────────────────── */
.battle-log-section {
    margin-top: 24px;
}

.battle-log-section .card {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 3rem);
}

.battle-log-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 2px solid #e9ecef;
    padding: 0 8px;
    flex-shrink: 0;
}

.battle-log-entries {
    overflow-y: auto;
    padding: 12px;
    flex: 1;
}

.battle-tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.battle-tab-btn:hover {
    color: var(--poke-mid-blue);
}

.battle-tab-btn.active {
    color: var(--poke-mid-blue);
    border-bottom-color: var(--poke-mid-blue);
}

/* ── KPI Cards (Stats Page) ───────────────────────── */
.kpi-card {
    background: #fff;
    border-radius: 14px;
    border-top: 3px solid var(--poke-mid-blue);
    box-shadow: 0 2px 12px rgba(0, 31, 63, 0.08);
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--poke-navy);
    line-height: 1.1;
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}

/* ── Table ────────────────────────────────────────── */
.table thead th {
    background-color: var(--poke-mid-blue) !important;
    color: #fff !important;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none !important;
}

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

/* ── Typography ───────────────────────────────────── */
.stats-heading {
    color: var(--poke-gold);
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sub-heading {
    color: var(--poke-mid-blue);
    font-weight: 700;
}

.login-title-text {
    color: var(--poke-gold);
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: 0.03em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ── Dropdown Typeahead ───────────────────────────── */
.pokemon-dropdown-menu {
    position: absolute;
    z-index: 1050;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    margin-top: 2px;
}

.pokemon-dropdown-item {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.1s;
}

.pokemon-dropdown-item:hover {
    background-color: #eef4ff;
    color: var(--poke-mid-blue);
}

/* ── Error Popup ──────────────────────────────────── */
#errorPopup {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #fff;
    color: #212529;
    padding: 12px 18px;
    border-radius: 12px;
    border-left: 4px solid #dc3545;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1060;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
}

#errorPopup.hidden {
    display: none !important;
}

#errorIcon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
