/**
 * CODEX Token Marketplace - Professional Exchange Style
 * Inspirado em: Binance, Uniswap, PancakeSwap
 * Design: Tabela compacta + Painel de detalhes expansível
 */

/* ============================================
   VARIÁVEIS CSS - PALETA PROFISSIONAL
   ============================================ */
:root {
    /* Backgrounds */
    --bg-primary: #0B0E11;
    --bg-secondary: #1E2329;
    --bg-tertiary: #2B3139;
    --bg-hover: #2E3541;

    /* Text */
    --text-primary: #EAECEF;
    --text-secondary: #848E9C;
    --text-tertiary: #5E6673;

    /* Accents */
    --accent-primary: #F0B90B;
    --accent-success: #0ECB81;
    --accent-danger: #F6465D;
    --accent-info: #3861FB;
    --accent-warning: #FFA800;

    /* Borders */
    --border-primary: #2B3139;
    --border-hover: #474D57;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* ============================================
   RESET E BASE
   ============================================ */
.codex-marketplace-page {
    background: transparent;
    min-height: 100vh;
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.codex-marketplace-page * {
    box-sizing: border-box;
}

/* ============================================
   HERO SECTION - MINIMALISTA
   ============================================ */
.marketplace-hero {
    background: transparent;
    padding: 120px 0 40px 0;
    border-bottom: none;
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
}

.marketplace-hero .container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.marketplace-hero h1 {
    display: block !important;
    font-size: 48px;
    font-weight: 300;
    font-family: inherit;
    color: var(--text-primary);
    margin: 0 auto 40px auto;
    text-align: center;
    letter-spacing: 0.5px;
}

.marketplace-hero .lead {
    display: none; /* Ocultar lead duplicado */
}

/* Stats Grid - Centralized */
.marketplace-stats-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 0;
}

.marketplace-stats {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 0 20px;
}

.marketplace-stats .stat {
    background: rgba(30, 35, 41, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid #2B3139;
    border-radius: 20px;
    padding: 20px 40px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 1200px) {
    .marketplace-stats {
        justify-content: center;
        padding: 0 10px;
    }

    .marketplace-stats .stat {
        padding: 15px 25px;
    }
}

@media (max-width: 600px) {
    .marketplace-stats {
        flex-direction: column;
        align-items: center;
    }

    .marketplace-stats .stat {
        width: 90%;
        max-width: 300px;
    }
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 4px;
    font-family: 'Courier New', monospace;
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   FILTROS E CONTROLES
   ============================================ */
.marketplace-filters {
    background: rgba(30, 35, 41, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid #2B3139;
    border-radius: 20px;
    padding: 20px;
    margin: 0 auto 30px auto;
    max-width: 1400px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.filters-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-search {
    flex: 1;
    min-width: 250px;
    display: flex;
    gap: 8px;
}

.filter-search input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.filter-search input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.filter-search input::placeholder {
    color: var(--text-tertiary);
}

.quick-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 8px 16px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.filter-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #000;
}

/* Sort Dropdown */
select.filter-btn {
    padding: 8px 12px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23848E9C' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* ============================================
   TABELA DE TOKENS - ESTILO EXCHANGE
   ============================================ */
.marketplace-tokens {
    padding: 0 0 30px 0;
    max-width: 1400px;
    margin: 0 auto;
}

.tokens-table-container {
    overflow-x: auto;
    background: rgba(30, 35, 41, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 2px solid #1a1d21; /* Borda cinza bem escuro */
    outline: none;
}

/* Remove qualquer borda branca/clara herdada */
.tokens-table-container * {
    outline: none;
}

.tokens-table-container table {
    border: none !important;
    outline: none !important;
}

.tokens-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border: none;
    outline: none;
}

/* Header da Tabela */
.tokens-table thead {
    background: transparent;
    border-bottom: 1px solid #2B3139;
    border-top: none;
}

.tokens-table thead tr {
    border: none;
    border-top: none;
    outline: none;
}

.tokens-table th {
    padding: 20px 20px 16px 20px;
    text-align: left;
    color: #0ECB81;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #2B3139;
    border: none;
}

.tokens-table th:first-child {
    padding-left: 0;
}

.tokens-table th:last-child {
    padding-right: 0;
}

.tokens-table th.text-right {
    text-align: right;
}

.tokens-table th.text-center {
    text-align: center;
}

/* Linhas da Tabela */
.tokens-table tbody tr {
    border-bottom: 1px solid #2B3139;
    border-top: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tokens-table tbody tr:first-child {
    border-top: none !important;
}

.tokens-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.tokens-table tbody tr.selected {
    background: rgba(240, 185, 11, 0.08);
    border-left: 3px solid #2B3139;
}

.tokens-table td {
    padding: 16px 20px;
    color: var(--text-primary);
    vertical-align: middle;
    border: none;
}

.tokens-table td:first-child {
    padding-left: 0;
}

.tokens-table td:last-child {
    padding-right: 0;
}

.tokens-table td.text-right {
    text-align: right;
}

.tokens-table td.text-center {
    text-align: center;
}

/* Coluna Token (Logo + Name + Symbol) */
.token-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
}

.token-logo-small {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-tertiary);
    flex-shrink: 0;
    border: 2px solid #2B3139;
}

.token-names {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.token-name-text {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
}

.token-symbol-text {
    color: #FFD700;  /* Amarelo dourado */
    font-size: 12px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* Token Logo e Info Container */
.token-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.token-logo {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    display: block;
}

.token-logo-placeholder {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 14px;
    text-transform: uppercase;
}

.token-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.token-details .token-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
}

.token-details .token-symbol-text {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
}

/* Badge do Plano */
.plan-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 6px;
}

.plan-badge.basic {
    background: rgba(255, 215, 0, 0.2);  /* Fundo amarelo translúcido */
    color: #FFD700;  /* Texto amarelo dourado */
    border: 1px solid rgba(255, 215, 0, 0.5);
}

.plan-badge.shield {
    background: rgba(56, 97, 251, 0.2);
    color: var(--accent-info);
}

.plan-badge.pro {
    background: rgba(240, 185, 11, 0.2);
    color: var(--accent-primary);
}

/* Coluna Price */
.price-cell {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

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

.price-usd,
.price-usdt {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.price-bnb {
    color: var(--accent-primary);
    font-size: 11px;
    font-weight: 500;
    opacity: 0.9;
}

/* Coluna Available */
.available-cell {
    font-family: 'Courier New', monospace;
}

.available-amount {
    color: #FFD700;  /* Amarelo dourado para quantidade disponível */
    font-weight: 600;
    font-size: 14px;
}

/* Coluna Liquidity */
.liquidity-cell {
    font-family: 'Courier New', monospace;
    color: var(--accent-success);
    font-weight: 600;
}

/* Coluna Payment Methods */
.payment-cell {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.payment-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    opacity: 0.7;
    border: 2px solid #2B3139;
}

/* Coluna Buy Button */
.buy-cell {
    text-align: center;
}

.btn-buy,
.buy-btn-compact {
    background: var(--accent-success);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-buy:hover,
.buy-btn-compact:hover {
    background: #0BB871;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-buy:active,
.buy-btn-compact:active {
    transform: translateY(0);
}

/* ============================================
   PAINEL DE DETALHES EXPANSÍVEL
   ============================================ */
.token-details-panel {
    display: none;
    background: transparent;
    border-top: 2px solid #2B3139;
    border-bottom: 1px solid var(--border-primary);
}

.token-details-panel.active {
    display: table-row;
}

.token-details-content {
    padding: 30px;
    background: rgba(30, 35, 41, 0.6);
    backdrop-filter: blur(20px);
    margin: 20px;
    border-radius: 12px;
    border: 1px solid #2B3139; /* Dark gray border instead of white */
}

.details-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-primary);
}

.token-logo-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-tertiary);
    flex-shrink: 0;
    border: 3px solid #2B3139;
}

.details-header-info {
    flex: 1;
}

.details-token-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.details-contract {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.contract-label {
    color: var(--text-tertiary);
    font-size: 12px;
}

.contract-address {
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.copy-btn-small {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    padding: 4px 10px;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn-small:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Grid 2 Colunas */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.details-section {
    background: var(--bg-secondary);
    border: 1px solid #1a1d21; /* Very dark gray, almost black */
    border-radius: 8px;
    padding: 20px;
}

.details-section h4 {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-primary);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #2B3139;
}

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

.detail-label {
    color: var(--text-tertiary);
    font-size: 13px;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.detail-value.mono {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.detail-value.success {
    color: var(--accent-success);
}

.detail-value.warning {
    color: var(--accent-warning);
}

/* Payment Badges */
.payment-badges {
    display: flex;
    gap: 8px;
}

.payment-badge {
    background: rgba(14, 203, 129, 0.15);
    color: var(--accent-success);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 2px;
}

.payment-badge.bnb {
    background: rgba(240, 185, 11, 0.15);
    color: var(--accent-primary);
}

.payment-badge.usdt {
    background: rgba(38, 161, 123, 0.15);
    color: #26a17b;
}

.payment-badge img {
    width: 16px;
    height: 16px;
}

/* Botões de Compra no Painel */
.buy-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.buy-btn-large {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.buy-btn-large img {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

/* Special styling for PIX icon to improve visibility */
.buy-pix img {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.buy-metamask {
    background: linear-gradient(135deg, #F6851B 0%, #E2761B 100%);
    color: #fff;
}

.buy-metamask:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.buy-pix {
    background: linear-gradient(135deg, #1a5f42 0%, #0d3625 100%); /* Much darker green */
    color: #fff;
}

.buy-pix:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Fee Info */
.fee-info-text {
    color: var(--text-tertiary);
    font-size: 11px;
    text-align: center;
    margin-top: 10px;
}

/* ============================================
   LOADING E EMPTY STATES
   ============================================ */
.loading-spinner {
    text-align: center;
    padding: 60px 30px;
}

.loading-spinner p {
    color: var(--text-secondary);
    margin-top: 20px;
}

.spinner {
    border: 4px solid #2B3139;
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-tokens {
    text-align: center;
    color: var(--text-secondary);
    padding: 60px 30px;
    font-size: 16px;
}

/* ============================================
   PAGINAÇÃO
   ============================================ */
.marketplace-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 30px 20px;
    background: transparent;
    max-width: 1400px;
    margin: 0 auto;
}

.page-btn, .page-number {
    background: rgba(30, 35, 41, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid #2B3139;
    border-radius: 0;
    padding: 8px 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.page-btn:hover:not(:disabled), .page-number:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.page-number.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #000;
    font-weight: 600;
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============================================
   CENTER MESSAGE ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* ============================================
   RESPONSIVO
   ============================================ */
@media (max-width: 1200px) {
    .details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .marketplace-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .marketplace-hero h1 {
        font-size: 22px;
    }

    .marketplace-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-search {
        min-width: 100%;
    }

    /* Ocultar colunas menos importantes em mobile */
    .tokens-table th:nth-child(4),
    .tokens-table td:nth-child(4),
    .tokens-table th:nth-child(5),
    .tokens-table td:nth-child(5) {
        display: none;
    }

    .token-cell {
        min-width: 140px;
    }

    .token-logo-small {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
    }

    .buy-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .marketplace-stats {
        grid-template-columns: 1fr;
    }

    .tokens-table {
        font-size: 12px;
    }

    .tokens-table th,
    .tokens-table td {
        padding: 10px 8px;
    }
}

/* ============================================
   CORREÇÕES ADICIONAIS
   ============================================ */

/* Garantir que todos os botões de compra tenham a cor verde */
.codex-marketplace-page .buy-btn-compact,
.codex-marketplace-page .buy-btn-large,
.codex-marketplace-page button[onclick*="buy"] {
    background: var(--accent-success) !important;
    color: #fff !important;
    border: none !important;
}

/* Botões específicos MetaMask e PIX */
.codex-marketplace-page .buy-metamask {
    background: linear-gradient(135deg, #F6851B 0%, #E2761B 100%) !important;
}

.codex-marketplace-page .buy-pix {
    background: linear-gradient(135deg, #00D09C 0%, #00A878 100%) !important;
}

/* Botões de registro/login */
.codex-marketplace-page .login-btn {
    background: var(--accent-info) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 600 !important;
}

.codex-marketplace-page .register-btn {
    background: var(--accent-primary) !important;
    color: #000 !important;
    border: none !important;
    font-weight: 600 !important;
}

.codex-marketplace-page .login-btn:hover {
    background: #2E4FD9 !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.codex-marketplace-page .register-btn:hover {
    background: #D9A50A !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   MODAL DE ESCOLHA LOGIN/REGISTER
   ============================================ */
.btn-auth-choice {
    transition: all 0.3s ease;
}

.btn-auth-choice:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-auth-choice.login:hover {
    background: #0BB871 !important;
}

.btn-auth-choice.register:hover {
    background: #D4A408 !important;
}

#auth-choice-modal .modal-header {
    text-align: center;
    padding: 20px 20px 10px 20px;
}

#auth-choice-modal .modal-header h2 {
    color: var(--text-primary);
    font-size: 24px;
    margin-bottom: 8px;
}

#auth-choice-modal .modal-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Garantir que imagens de ícones sejam redondas */
.codex-marketplace-page img[src*="icon"],
.codex-marketplace-page img[src*="logo"],
.codex-marketplace-page .icon,
.codex-marketplace-page .logo {
    border-radius: 50% !important;
}

/* ============================================
   MODAL DE LOGIN/REGISTRO
   ============================================ */
.codex-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    justify-content: center;
    align-items: center;
}

/* Removido .modal-content pois usamos .modal-container diretamente */

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 30px;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

/* Tabs */
.modal-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid #2B3139;
    padding-bottom: 10px;
}

.modal-tabs .tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.modal-tabs .tab-btn.active {
    color: var(--accent-primary);
}

.modal-tabs .tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -11px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
}

/* Form Styles */
.tab-content h3 {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 25px 0;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid #2B3139;
    border-radius: 10px;
    padding: 14px 18px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

/* Submit Button */
.btn-submit {
    width: 100%;
    background: var(--accent-primary);
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.btn-submit:hover:not(:disabled) {
    background: #D9A50A;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(240, 185, 11, 0.3);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-submit .spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Messages */
.form-message {
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
}

.form-message.success {
    background: rgba(14, 203, 129, 0.2);
    color: var(--accent-success);
    border: 1px solid rgba(14, 203, 129, 0.3);
}

.form-message.error {
    background: rgba(246, 70, 93, 0.2);
    color: var(--accent-danger);
    border: 1px solid rgba(246, 70, 93, 0.3);
}

/* Responsive */
@media (max-width: 480px) {
    .codex-modal .modal-content {
        padding: 30px 20px;
        width: 95%;
    }

    .modal-tabs .tab-btn {
        font-size: 14px;
        padding: 10px;
    }
}


/* ============================================
   SEARCH SECTION - ALINHADO COM GRID
   ============================================ */
.search-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 30px;
    margin: 0 auto 40px auto;
    border: 1px solid var(--border-primary);
    max-width: 100%;
    width: 100%;
}

.search-box {
    display: flex;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.search-box input {
    flex: 1;
    padding: 14px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
}

.search-btn {
    padding: 0 20px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-btn:hover {
    background: #f5c842;
    transform: translateY(-1px);
}

/* ============================================
   MODAL DE LOGIN - CORES PADRÃO EXFAIR
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #5a7491 0%, #2d3e50 100%) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(124, 50, 199, 0.2);
    border-radius: 16px;
    padding: 20px 25px !important;
    width: 320px !important;
    max-width: 320px !important;
    max-height: 420px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    z-index: 10001;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 28px;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #fff;
}

.modal-header {
    text-align: center;
    margin-bottom: 15px !important;
}

.logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 12px !important;
}

.modal-logo {
    height: 35px !important;
    width: auto;
}

.version-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #8b5cf6;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    z-index: 10002;
}

.modal-header h2 {
    color: white;
    font-size: 22px !important;
    font-weight: 600;
    margin: 6px 0 3px 0 !important;
}

.modal-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px !important;
    margin: 0;
}

.form-group {
    margin-bottom: 12px !important;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 8px 12px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid #2B3139 !important;
    border-radius: 8px;
    color: #333 !important;
    font-size: 13px !important;
    height: 38px !important;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    background: #fff !important;
    border-color: rgba(124, 50, 199, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(124, 50, 199, 0.1);
}

.btn-login {
    width: 100%;
    padding: 10px !important;
    background: linear-gradient(90deg, #7c32c7 0%, #9e44e8 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px !important;
}

.btn-login:hover {
    background: linear-gradient(90deg, #8b3aed 0%, #a955f7 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 50, 199, 0.4);
}

.modal-footer {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #2B3139;
}

.modal-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.modal-footer a:hover {
    color: white;
}

.separator {
    color: rgba(255, 255, 255, 0.5);
    margin: 0 10px;
}

/* ============================================
   PURCHASE MODAL - CONFIRMAÇÃO
   ============================================ */
.purchase-summary {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-primary);
}

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

.summary-row.total {
    margin-top: 10px;
    padding-top: 20px;
    border-top: 2px solid var(--border-primary);
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-primary);
}

#purchase-quantity {
    width: 120px;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    color: var(--text-primary);
    text-align: right;
}

.payment-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.payment-buttons .buy-btn-large {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.payment-buttons img {
    width: 28px;
    height: 28px;
}

/* ============================================
   PIX MODAL - PAGAMENTO
   ============================================ */
.pix-container {
    max-width: 550px;
}

.pix-logo {
    width: 80px;
    height: auto;
    margin-bottom: 15px;
}

.pix-instructions {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.pix-instructions h3 {
    color: var(--text-primary);
    font-size: 18px;
    margin: 0 0 15px 0;
}

.pix-instructions ol {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
}

.pix-instructions li {
    margin-bottom: 8px;
}

.pix-details {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.pix-row {
    margin-bottom: 15px;
}

.pix-row label {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.copy-container {
    display: flex;
    gap: 10px;
}

.copy-container input {
    flex: 1;
    padding: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: monospace;
}

.copy-btn {
    padding: 10px 20px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.amount-display, .reference-display {
    padding: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-success);
    border-radius: 4px;
    color: var(--accent-success);
    font-size: 20px;
    font-weight: 600;
}

.reference-display {
    font-size: 14px;
    font-family: monospace;
}

.pix-qrcode {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* PIX QR Code Section */
.pix-qr-section {
    text-align: center;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 20px;
}

.pix-qr-section canvas,
.pix-qr-section img {
    border: 3px solid #2B3139;
    border-radius: 8px;
    padding: 10px;
    background: white;
}

.pix-code-container {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.pix-code-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.pix-code-value {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pix-code-value input {
    flex: 1;
    padding: 8px;
    font-size: 11px;
    font-family: monospace;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.pix-amount-display {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.amount-brl {
    font-size: 24px;
    font-weight: bold;
    color: #0ECB81;
}

.amount-usd {
    font-size: 14px;
    color: #848E9C;
}

#qrcode-container {
    width: 200px;
    height: 200px;
    margin: 0 auto 10px auto;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.pix-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-primary);
}

.support-email {
    color: var(--accent-info);
    text-decoration: none;
    font-weight: 600;
}

/* ============================================
   CONTAINER ALINHAMENTO
   ============================================ */
.marketplace-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.marketplace-wrapper {
    width: 100%;
}

/* Stats container centralizado */
.stats-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

/* Hide seller login on mobile - prevents overflow */
@media (max-width: 768px) {
    .seller-login-text {
        display: none !important;
    }
}

/* Wallet browser extension note */
.wallet-browser-note {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-align: center;
    margin: 8px 0 0 0;
    padding: 0;
    font-style: italic;
}
