/* =========================================================
   1. RESET GLOBAL ANTIVAZAMENTO (PREVINE ROLAGEM HORIZONTAL)
   ========================================================= */
html, body {
    max-width: 100% !important;
    overflow-x: hidden !important;
    margin: 0;
    padding: 0;
    background-color: #0b0f19;
    color: #f8fafc;
    font-family: 'Exo 2', sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* SEGURANÇA CONTRA IMAGENS GIGANTES EM TODO O SITE */
img {
    max-width: 100%;
    height: auto;
}

/* =========================================================
   2. SIDEBAR DESKTOP (FIXO NA ESQUERDA)
   ========================================================= */
.sidebar-desktop {
    display: flex !important;
    flex-direction: column;
    width: 260px !important;
    height: 100vh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    background-color: #0f172a !important;
    border-right: 1px solid #1e293b;
    padding: 16px;
    z-index: 9999 !important;
    overflow-y: hidden !important;
}

.brand-logo {
    width: 100%;
    margin-bottom: 12px;
}

.main-logo {
    max-width: 130px;
    height: auto;
    display: block;
    margin: 10px auto;
}

/* CARTÃO DE DESTAQUE DO USER */
.user-brand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    padding: 14px 12px;
    border-radius: 12px;
    border: 1px solid #0284c7;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    width: 100%;
}

.user-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    width: 100%;
}

.avatar-wrapper {
    margin-bottom: 6px;
}

.brand-avatar-lg {
    width: 68px !important;
    height: 68px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 3px solid #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.brand-username {
    color: #f8fafc;
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 8px;
}

.trainer-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    margin-bottom: 10px;
}

.stat-item {
    background: #090d16;
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid #1e293b;
}

.stat-item small { color: #38bdf8; font-size: 9px; }

.trust-item { color: #4ade80; border-color: #166534; background: rgba(22, 101, 52, 0.2); }
.trust-item.trust-negative { color: #f87171; border-color: #991b1b; background: rgba(153, 27, 27, 0.2); }

.btn-card-logout {
    display: block;
    width: 100%;
    text-align: center;
    background: #ef4444;
    color: #ffffff;
    font-weight: 700;
    font-size: 12px;
    padding: 6px 0;
    border-radius: 6px;
    text-decoration: none;
}

.btn-card-logout:hover { background: #dc2626; }

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    margin-top: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-item:hover { background: #1e293b; color: #38bdf8; }
.poke-icon, .poke-icon-sm { width: 18px; height: 18px; flex-shrink: 0; }

.mobile-top-header, .mobile-bottom-bar, .mobile-menu-overlay { display: none !important; }

/* =========================================================
   3. LAYOUT NO DESKTOP (PC) - SEM EMPURRAR O FEED
   ========================================================= */
@media (min-width: 769px) {
    body {
        padding-left: 260px !important;
    }

    /* Permite que o feed e conteúdos centrem perfeitamente no espaço restante */
    main, .main-container, .feed-container, .container {
        width: 100% !important;
        max-width: 900px !important;
        margin: 0 auto !important;
        padding: 20px;
    }
}

/* =========================================================
   4. TELA DE LOGIN (MOBILE FIRST & RESPONSIVA)
   ========================================================= */
.login-page-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 100px);
    width: 100%;
    padding: 16px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-top: 3px solid #0284c7;
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.login-card input {
    width: 100%;
    height: 48px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #f8fafc;
    padding: 0 14px;
    font-size: 15px;
    margin-bottom: 14px;
}

.login-card button {
    width: 100%;
    height: 48px;
    background: #0284c7;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

/* =========================================================
   5. REGRAS EXCLUSIVAS MOBILE (CELULAR)
   ========================================================= */
@media (max-width: 768px) {
    .sidebar-desktop { display: none !important; }

    body {
        padding-top: 52px;
        padding-bottom: 65px;
        padding-left: 0 !important;
    }

    .mobile-top-header {
        display: flex !important;
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 52px;
        background: #0f172a;
        border-bottom: 1px solid #1e293b;
        z-index: 999;
        align-items: center; justify-content: center;
    }

    .mobile-bottom-bar {
        display: flex !important;
        position: fixed;
        bottom: 0; left: 0;
        width: 100%; height: 62px;
        background: #0f172a;
        border-top: 2px solid #0284c7;
        justify-content: space-around; align-items: center;
        z-index: 1000;
        padding: 0 4px;
    }

    .header-brand { display: flex; align-items: center; gap: 8px; }
    .header-logo-icon { width: 28px; height: 28px; }
    .header-title { font-family: 'Press Start 2P', cursive; font-size: 14px; color: #38bdf8; }

    .mobile-item { display: flex; flex-direction: column; align-items: center; color: #94a3b8; text-decoration: none; background: none; border: none; flex: 1; }
    .nav-icon { height: 22px; display: flex; align-items: center; }
    .nav-avatar-sm { width: 22px !important; height: 22px !important; border-radius: 50% !important; object-fit: cover !important; border: 1px solid #38bdf8; }
    .nav-label { font-size: 10px; font-weight: 700; text-transform: uppercase; margin-top: 2px; }
    .pokeball-btn { position: relative; top: -8px; }
    .pokeball-icon { width: 42px; height: 42px; }
    .pokeball-label { color: #38bdf8; }

    /* DRAWER MENU MOBILE */
    .mobile-menu-overlay.active { display: flex !important; }
    .mobile-menu-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.85); z-index: 1500; align-items: flex-end; }
    .mobile-menu-content { width: 100%; background: #1e293b; border-top: 3px solid #38bdf8; border-radius: 16px 16px 0 0; padding: 16px 16px 75px 16px; }
    .mobile-menu-header { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 800; color: #38bdf8; margin-bottom: 12px; border-bottom: 1px solid #334155; padding-bottom: 8px; }
    .close-mobile-menu { background: none; border: none; color: #94a3b8; font-size: 26px; cursor: pointer; }

    .mobile-user-card { display: flex; align-items: center; gap: 12px; background: #0f172a; border: 1px solid #0284c7; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
    .mobile-user-avatar { width: 48px !important; height: 48px !important; border-radius: 50% !important; object-fit: cover !important; border: 2px solid #38bdf8; }
    .mobile-user-info { display: flex; flex-direction: column; }
    .mobile-user-name { color: #f8fafc; font-weight: 800; font-size: 13px; text-transform: uppercase; }
    .mobile-user-stats { color: #38bdf8; font-size: 11px; font-weight: 600; margin-top: 2px; }
    .mobile-user-trust { color: #4ade80; font-size: 10px; font-weight: 700; margin-top: 2px; }

    .mobile-menu-links { display: flex; flex-direction: column; gap: 8px; }
    .mobile-menu-item { padding: 12px 14px; background: #0f172a; border: 1px solid #334155; border-radius: 10px; color: #f8fafc; text-decoration: none; font-weight: 700; font-size: 13px; display: block; }
    .mobile-menu-item.highlight-item { background: #0284c7; color: #fff; border-color: #38bdf8; }
    .mobile-menu-item.logout-item { background: #ef4444; color: #fff; border-color: #dc2626; text-align: center; }
}
/* =========================================================
   ESTILO PREMIUM DO CARD DO TREINADOR (HUD)
   ========================================================= */
.user-brand-card-premium {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.98));
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 16px;
    padding: 16px;
    margin: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 0 12px rgba(56, 189, 248, 0.05);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.user-brand-card-premium:hover {
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 10px 40px rgba(14, 165, 233, 0.2);
}

/* Header do Card */
.hud-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hud-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

.hud-avatar-wrapper {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.hud-avatar {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.hud-user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hud-username {
    color: #f8fafc;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.5px;
}

.hud-role {
    font-size: 10px;
    color: #38bdf8;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Grid de Estatísticas (2 Colunas Perfeitamente Encaixadas) */
.hud-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.hud-stat-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 60px; /* Altura fixa para padronizar todos os cards */
    box-sizing: border-box;
}

.hud-stat-box.full-width {
    grid-column: span 2;
    height: auto;
    padding: 8px 10px;
    flex-direction: row;
    justify-content: space-between;
}

.hud-stat-label {
    font-size: 9px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
}

.hud-stat-value {
    font-size: 13px;
    font-weight: 700;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Tamanho uniforme para ícones e insígnias */
.coin-icon-hud {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.badge-icon-hud {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.5));
}

.trust-positive { color: #4ade80; }
.trust-negative { color: #f87171; }

/* Item de Logout no Menu */
.nav-item.logout-menu-item {
    color: #ef4444 !important;
    border-top: 1px solid rgba(239, 68, 68, 0.15);
    margin-top: 15px;
    padding-top: 12px;
}

.nav-item.logout-menu-item:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #f87171 !important;
}