/* =========================================================
   CONFIGURAÇÕES GLOBAIS E CORES
   ========================================================= */

body {
    background-color: #111;
    color: #f3f4f6;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}


/* =========================================================
   LAYOUT RESPONSIVO DO CONTAINER
   ========================================================= */

.portal-container {
    width: 94%;
    margin-left: auto;
    margin-right: auto;
    border-radius: 10px;
}

.custom-box-radius {
    border-radius: 10px;
}

@media (min-width: 768px) {
    .portal-container {
        width: 94%;
        max-width: 1400px;
    }
}


/* =========================================================
   BARRAS DE ROLAGEM GLOBAIS — 1PX
   Chrome / Edge / Opera / Safari
   ========================================================= */

/* Barra vertical e horizontal */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
    width: 1px !important;
    height: 1px !important;
}

/* Fundo da barra */
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
    width: 1px !important;
    height: 1px !important;
    background: rgba(255, 255, 255, 0.03) !important;
}

/* Parte que se movimenta */
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
    width: 1px !important;
    min-width: 1px !important;
    min-height: 1px !important;
    background: rgba(52, 211, 153, 0.6) !important;
    border-radius: 0 !important;
}

/* Hover */
html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 211, 153, 1) !important;
}

/* Botões da scrollbar */
html::-webkit-scrollbar-button,
body::-webkit-scrollbar-button,
*::-webkit-scrollbar-button {
    width: 1px !important;
    height: 1px !important;
    background: transparent !important;
}

/* Cantos */
html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner,
*::-webkit-scrollbar-corner {
    width: 1px !important;
    height: 1px !important;
    background: rgba(255, 255, 255, 0.03) !important;
}


/* =========================================================
   CABEÇALHO
   ========================================================= */

.main-header {
    background-color: #161616;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header-inner {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 768px) {
    .header-inner {
        padding: 16px 24px;
        gap: 14px;
    }
}


/* =========================================================
   LINHA SUPERIOR: LOGO, TÍTULO E PERFIL
   ========================================================= */

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-logo-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 6px;
}

.brand-text-container {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.025em;
    display: flex;
    gap: 6px;
}

.text-roxo {
    color: #a855f7;
}

.text-branco {
    color: #ffffff;
}

.text-verde {
    color: #34d399;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0;
}


/* =========================================================
   BOTÃO DE PERFIL NO TOPO
   ========================================================= */

.header-profile-btn {
    background: linear-gradient(
        135deg,
        rgba(76, 29, 149, 0.6),
        rgba(109, 40, 217, 0.6)
    );
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #d8b4fe;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(76, 29, 149, 0.3);
}

.header-profile-btn:hover {
    background: linear-gradient(
        135deg,
        rgba(76, 29, 149, 0.9),
        rgba(109, 40, 217, 0.9)
    );
    color: #ffffff;
    border-color: rgba(168, 85, 247, 0.8);
}


/* =========================================================
   LINHA DIVISÓRIA
   ========================================================= */

.header-divider {
    border: none;
    border-top: 1px solid rgba(168, 85, 247, 0.25);
    margin: 0;
    width: 100%;
}


/* =========================================================
   MENU DE ABAS
   ========================================================= */

.nav-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
    overflow-x: auto;
    width: 100%;
    justify-content: flex-start;
}

@media (min-width: 768px) {
    .nav-tabs {
        justify-content: center;
        overflow-x: visible;
    }
}

.tab-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #9ca3af;
    background: transparent;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.tab-btn:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    background-color: rgba(76, 29, 149, 0.8);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.4);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}


/* =========================================================
   CONTEÚDO PRINCIPAL
   ========================================================= */

.main-content {
    padding: 16px 4px;
    flex-grow: 1;
}

@media (min-width: 768px) {
    .main-content {
        padding: 32px 16px;
    }
}


/* =========================================================
   MODAL
   ========================================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

@media (min-width: 768px) {
    .modal-overlay {
        padding: 16px;
    }
}

.modal-box {
    background-color: #1b1b22;
    border: 1px solid rgba(168, 85, 247, 0.4);
    width: 100%;
    height: 100%;
    max-width: 1024px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    border-radius: 0px;
}

@media (min-width: 768px) {
    .modal-box {
        height: auto;
        max-height: 92vh;
        border-radius: 5px;
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #23232d;
}

.modal-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-img-box {
    width: 48px;
    height: 48px;
    background-color: #181820;
    border: 1px solid rgba(168, 85, 247, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    flex-shrink: 0;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    border-radius: 5px;
}

.modal-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 5px;
}

.modal-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-ticker {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    letter-spacing: 0.05em;
}

.modal-segmento {
    color: #d8b4fe;
    font-size: 0.75rem;
    font-weight: 500;
}

.modal-nome {
    font-size: 0.875rem;
    color: #d1d5db;
    margin: 2px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

@media (min-width: 640px) {
    .modal-nome {
        max-width: 500px;
    }
}


/* =========================================================
   BOTÃO FECHAR MODAL
   ========================================================= */

.modal-close-btn {
    color: #d1d5db;
    background-color: #181820;
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    color: #ffffff;
    background-color: rgba(147, 51, 234, 0.4);
    border-color: rgba(168, 85, 247, 0.6);
}

.modal-close-btn svg {
    width: 20px;
    height: 20px;
    display: block;
    stroke: currentColor;
}


/* =========================================================
   CORPO DO MODAL
   ========================================================= */

.modal-body {
    padding: 16px;
    overflow-y: auto;
    flex-grow: 1;
}

@media (min-width: 768px) {
    .modal-body {
        padding: 24px;
    }
}


/* =========================================================
   ELEMENTOS OCULTOS
   ========================================================= */

.hidden {
    display: none !important;
}


/* =========================================================
   ESTADOS DE CARREGAMENTO
   ========================================================= */

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    gap: 12px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #a855f7;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: #d1d5db;
    margin: 0;
}


/* =========================================================
   RODAPÉ
   ========================================================= */

.main-footer {
    background-color: #161616;
    border-top: 1px solid rgba(168, 85, 247, 0.2);
    padding: 16px;
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 48px;
}