/* CSS Específico para Mobile - Cripto Investments */

/* Melhorias para touch targets */
.btn-primary,
.btn-secondary,
.btn-danger,
.payment-method-btn {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Cards de criptomoedas - 1 card por tela */
@media (max-width: 768px) {
    .crypto-scroll-container {
        padding-bottom: 0 !important;
    }
    
    .crypto-scroll-container .stat-card {
        width: calc(100vw - 2rem) !important;
        min-width: calc(100vw - 2rem) !important;
        padding: 1rem !important;
        margin-right: 1rem;
        height: auto !important;
    }
}

/* Cards de estatísticas mobile */
@media (max-width: 480px) {
    .stat-card {
        padding: 0.75rem !important;
    }
    
    /* Cards de resumo - 2 por linha */
    .grid.grid-cols-2 .stat-card {
        padding: 0.5rem !important;
    }
    
    .grid.grid-cols-2 .stat-card .stat-icon {
        padding: 0.5rem !important;
    }
    
    .grid.grid-cols-2 .stat-card .stat-icon i {
        font-size: 1rem !important;
    }
    
    .grid.grid-cols-2 .stat-card .stat-value {
        font-size: 0.9rem !important;
    }
    
    .grid.grid-cols-2 .stat-card .stat-label {
        font-size: 0.75rem !important;
    }
    
    /* Card de indicação - layout horizontal simples */
    .flex.items-center.gap-2 {
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }
    
    .flex.items-center.gap-2 .flex-1 {
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    .flex.items-center.gap-2 button {
        flex-shrink: 0 !important;
        padding: 0.25rem 0.5rem !important;
        font-size: 0.7rem !important;
        height: auto !important;
        min-height: 2rem !important;
    }
    
    /* Texto do link de indicação */
    #referralLink {
        font-size: 0.75rem !important;
        line-height: 1.3 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    /* Garantir que o botão fique dentro do card */
    .dark-card .flex.items-center.gap-2 {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .dark-card .flex.items-center.gap-2 button {
        margin: 0 !important;
        position: relative !important;
        padding: 0.25rem 0.5rem !important;
        font-size: 0.7rem !important;
        height: 2rem !important;
        min-height: 2rem !important;
        max-height: 2rem !important;
    }
    
    
    .stat-card .flex {
        text-align: center;
        gap: 0.5rem;
    }
    
    
    .stat-card .p-4 {
        padding: 0.5rem !important;
        margin: 0 auto;
    }
    
    /* Forçar espaçamento apenas nos cards principais (não nos de estatísticas) */
    main > .dark-card.mb-6 {
        margin-bottom: 2rem !important;
    }
    
    main > .dark-card.mb-6.md\\:mb-8 {
        margin-bottom: 2rem !important;
    }
    
    @media (min-width: 768px) {
        main > .dark-card.mb-6.md\\:mb-8 {
            margin-bottom: 3rem !important;
        }
    }
    
    /* Remover espaçamento dos cards de estatísticas */
    .grid .stat-card {
        margin-bottom: 0 !important;
    }
    
    .grid .dark-card {
        margin-bottom: 0 !important;
    }
    
    /* Centralizar conteúdo dos cards de estatísticas */
    .grid .stat-card .flex {
        flex-direction: column !important;
        text-align: center !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .grid .stat-card .ml-4 {
        margin-left: 0 !important;
        text-align: center !important;
    }
    
    .grid .stat-card .stat-icon {
        margin: 0 auto !important;
        margin-bottom: 0.5rem !important;
    }
    
    .stat-value {
        font-size: 1rem;
        line-height: 1.2;
    }
    
    /* Header redesenhado - mobile otimizado */
    .header-primary {
        background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(42, 42, 42, 0.95) 100%) !important;
        backdrop-filter: blur(10px) !important;
        border-bottom: 1px solid rgba(255, 215, 0, 0.2) !important;
    }
    
    .header-primary .container {
        padding: 0.75rem 1rem !important;
    }
    
    .header-primary h1 {
        font-size: 1rem !important;
        line-height: 1.2 !important;
    }
    
    .header-primary .w-10 {
        width: 2rem !important;
        height: 2rem !important;
    }
    
    .header-primary .w-10 i {
        font-size: 0.875rem !important;
    }
    
    .header-primary .text-lg {
        font-size: 0.875rem !important;
    }
    
    .header-primary .text-xs {
        font-size: 0.625rem !important;
    }
    
    .header-primary .text-sm {
        font-size: 0.75rem !important;
    }
    
    .header-primary .space-x-3 > * + * {
        margin-left: 0.5rem !important;
    }
    
    .header-primary .space-x-2 > * + * {
        margin-left: 0.25rem !important;
    }
    
    /* Botões do histórico - mobile otimizado */
    .btn-primary.px-3.py-2 {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.75rem !important;
        min-height: 2rem !important;
    }
    
    .btn-primary.px-3.py-2 i {
        font-size: 0.625rem !important;
    }
    
    /* Títulos das seções - mobile otimizado */
    .w-8.h-8 {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
    
    .w-8.h-8 i {
        font-size: 0.75rem !important;
    }
    
    .text-lg.font-semibold {
        font-size: 1rem !important;
    }
    
    /* Corrigir alinhamento dos botões das tabs */
    .tab-button {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 2.5rem !important;
        font-size: 0.75rem !important;
        padding: 0.5rem 0.75rem !important;
    }
    
    .tab-button i {
        font-size: 0.75rem !important;
        margin-right: 0.5rem !important;
    }
    
    .tab-button.whitespace-nowrap {
        white-space: nowrap !important;
    }
    
    /* Scroll horizontal para tabs no mobile */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }
    
    .overflow-x-auto::-webkit-scrollbar {
        display: none !important;
    }
    
    /* Corrigir cor do texto Valor nas tabelas */
    .dark-table th {
        color: var(--accent-yellow) !important;
        background: rgba(10, 10, 10, 0.9) !important;
    }
    
    .dark-table td {
        color: var(--text-white) !important;
    }
    
    .dark-table th.text-xs {
        color: var(--accent-yellow) !important;
    }
    
    .dark-table th.font-medium {
        color: var(--accent-yellow) !important;
    }
    
    .stat-label {
        font-size: 0.7rem;
        margin-bottom: 0.25rem;
    }
    
    /* Indicadores de criptomoedas */
    .crypto-indicator {
        width: 0.5rem !important;
        height: 0.5rem !important;
        transition: all 0.3s ease !important;
    }
    
    .crypto-indicator:hover {
        transform: scale(1.2) !important;
    }
    
    .crypto-indicator.bg-yellow-400 {
        background-color: #fbbf24 !important;
        box-shadow: 0 0 8px rgba(251, 191, 36, 0.5) !important;
    }
    
    .crypto-indicator.bg-gray-600 {
        background-color: #4b5563 !important;
        opacity: 0.6 !important;
    }
    
    #crypto-indicators {
        margin-top: -0.25rem !important;
        padding: 0 !important;
    }
}

/* Modais mobile */
@media (max-width: 768px) {
    .modal-content {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
        border-radius: 0.75rem;
    }
    
    .modal-header {
        padding: 1rem;
        border-bottom: 1px solid var(--border-yellow);
    }
    
    .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-footer {
        padding: 1rem;
        border-top: 1px solid var(--border-yellow);
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
}

/* Tabelas responsivas */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 0.5rem;
    }
    
    .dark-table {
        min-width: 600px;
        font-size: 0.8rem;
    }
    
    .dark-table th,
    .dark-table td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }
    
    .dark-table th:first-child,
    .dark-table td:first-child {
        position: sticky;
        left: 0;
        background: var(--secondary-black);
        z-index: 1;
    }
}

/* Formulários mobile */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-label {
        font-size: 0.875rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        display: block;
    }
    
    .dark-input {
        width: 100%;
        padding: 0.875rem;
        font-size: 16px; /* Evita zoom no iOS */
        border-radius: 0.5rem;
        min-height: 44px;
    }
    
    .dark-input:focus {
        outline: none;
        box-shadow: 0 0 0 3px var(--shadow-yellow);
    }
}

/* Botões de pagamento mobile */
@media (max-width: 768px) {
    .payment-method-btn {
        padding: 0.75rem;
        font-size: 0.875rem;
        min-height: 50px;
        border-radius: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .payment-method-btn.active {
        background: var(--accent-yellow);
        color: var(--primary-black);
        font-weight: 700;
    }
}

/* QR Code mobile */
@media (max-width: 768px) {
    #qr-code-image {
        max-width: 200px;
        width: 100%;
        height: auto;
        padding: 1rem;
        background: white;
        border-radius: 0.5rem;
        margin: 0 auto;
        display: block;
    }
    
    .qr-code-container {
        text-align: center;
        padding: 1rem;
    }
}

/* Status de pagamento mobile */
@media (max-width: 768px) {
    .payment-status {
        padding: 0.75rem;
        font-size: 0.875rem;
        text-align: center;
        border-radius: 0.5rem;
        margin: 0.5rem 0;
    }
}

/* Alertas mobile */
@media (max-width: 768px) {
    .alert {
        padding: 1rem;
        font-size: 0.875rem;
        border-radius: 0.5rem;
        margin-bottom: 1rem;
        line-height: 1.4;
    }
    
    .alert i {
        margin-right: 0.5rem;
    }
}

/* Tabs mobile */
@media (max-width: 768px) {
    .tab-button {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        min-height: 44px;
        text-align: center;
        flex: 1;
    }
    
    .tab-content {
        padding: 1rem 0;
    }
}

/* Progress bars mobile */
@media (max-width: 768px) {
    .progress-bar {
        height: 16px;
        border-radius: 8px;
    }
    
    .progress-fill {
        border-radius: 8px;
    }
}

/* Links mobile */
@media (max-width: 768px) {
    .link-primary {
        font-size: 0.875rem;
        padding: 0.5rem;
        display: inline-block;
        min-height: 44px;
        line-height: 2;
    }
}

/* Notificações mobile */
@media (max-width: 768px) {
    #notification-popup {
        position: fixed;
        top: 1rem;
        left: 0.5rem;
        right: 0.5rem;
        max-width: calc(100vw - 1rem);
        z-index: 9999;
        border-radius: 0.5rem;
    }
    
    .notification-content {
        padding: 1rem;
        font-size: 0.875rem;
    }
}

/* Scroll suave para mobile - SEM SETAS */
@media (max-width: 768px) {
    .crypto-scroll-container {
        scroll-behavior: smooth;
        scroll-snap-type: x mandatory;
        /* Remover indicadores de scroll */
    }
    
    .crypto-scroll-container .stat-card {
        scroll-snap-align: start;
    }
    
    /* Esconder indicadores de scroll se existirem */
    .scroll-indicator {
        display: none !important;
    }
}

/* Melhorias de acessibilidade mobile */
@media (max-width: 768px) {
    /* Garantir que elementos interativos sejam grandes o suficiente */
    button, 
    .btn, 
    .payment-method-btn,
    .tab-button,
    .link-primary {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Melhor contraste para textos pequenos */
    .text-xs {
        font-size: 0.75rem;
        line-height: 1.3;
    }
    
    .text-sm {
        font-size: 0.875rem;
        line-height: 1.4;
    }
}

/* Otimizações para telas muito pequenas */
@media (max-width: 360px) {
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.65rem;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-danger {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    
    .crypto-scroll-container .stat-card {
        width: calc(100vw - 1.5rem) !important;
        min-width: calc(100vw - 1.5rem) !important;
        padding: 0.75rem !important;
        height: auto !important;
    }
}

/* Melhorias para orientação landscape em mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: calc(100vh - 2rem);
    }
    
    .modal-body {
        max-height: calc(100vh - 150px);
    }
    
    .crypto-scroll-container .stat-card {
        width: 150px !important;
        min-width: 150px !important;
    }
}

/* Remover efeitos visuais indesejados dos cards */
.stat-card {
    outline: none !important;
    border: none !important;
}

.stat-card:focus {
    outline: none !important;
    box-shadow: none !important;
}

.stat-card:hover {
    transform: none !important;
    scale: 1 !important;
}

.stat-card:active {
    transform: none !important;
    scale: 1 !important;
}

/* Scroll para modais mobile */
@media (max-width: 768px) {
    #simplePixModal {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    #simplePixModal .dark-card {
        max-height: 85vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin !important;
    }
    
    #simplePixModal .dark-card::-webkit-scrollbar {
        width: 6px !important;
    }
    
    #simplePixModal .dark-card::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1) !important;
        border-radius: 3px !important;
    }
    
    #simplePixModal .dark-card::-webkit-scrollbar-thumb {
        background: var(--accent-yellow) !important;
        border-radius: 3px !important;
    }
    
    #simplePixModal .dark-card::-webkit-scrollbar-thumb:hover {
        background: #f59e0b !important;
    }
}

/* Layout das tabs - 2 por linha - Design simples */
@media (max-width: 768px) {
    .tab-button {
        width: 100% !important;
        min-height: 40px !important;
    }
    
    .grid.grid-cols-2 {
        gap: 0.25rem !important;
    }
    
    /* Estado ativo das tabs - Forçar amarelo */
    .tab-button.active {
        background: rgba(234, 179, 8, 0.2) !important;
        color: rgb(252, 211, 77) !important;
        border-color: rgba(234, 179, 8, 0.3) !important;
    }
    
    /* Hover simples - Forçar amarelo */
    .tab-button:hover {
        background: rgba(234, 179, 8, 0.1) !important;
        color: rgb(252, 211, 77) !important;
    }
    
    /* Forçar amarelo em todos os estados */
    .tab-button.bg-yellow-500\/20 {
        background: rgba(234, 179, 8, 0.2) !important;
    }
    
    .tab-button.text-yellow-300 {
        color: rgb(252, 211, 77) !important;
    }
    
    .tab-button.border-yellow-500\/30 {
        border-color: rgba(234, 179, 8, 0.3) !important;
    }
    
    /* Remover qualquer cor azul/cyan */
    .tab-button.bg-cyan-500\/20,
    .tab-button.text-cyan-300,
    .tab-button.border-cyan-500\/30 {
        background: rgba(234, 179, 8, 0.2) !important;
        color: rgb(252, 211, 77) !important;
        border-color: rgba(234, 179, 8, 0.3) !important;
    }
    
    /* Forçar amarelo em qualquer estado de foco/ativo */
    .tab-button:focus,
    .tab-button:active,
    .tab-button[class*="active"] {
        background: rgba(234, 179, 8, 0.2) !important;
        color: rgb(252, 211, 77) !important;
        border-color: rgba(234, 179, 8, 0.3) !important;
    }
    
    /* Estado de clique - Forçar amarelo */
    .tab-button:active {
        background: rgba(234, 179, 8, 0.3) !important;
        color: rgb(252, 211, 77) !important;
        border-color: rgba(234, 179, 8, 0.4) !important;
        transform: none !important;
    }
}

/* CSS global para forçar amarelo nas tabs */
.tab-button.active,
.tab-button[class*="active"] {
    background: rgba(234, 179, 8, 0.2) !important;
    color: rgb(252, 211, 77) !important;
    border-color: rgba(234, 179, 8, 0.3) !important;
}

/* Forçar amarelo no estado de clique global */
.tab-button:active {
    background: rgba(234, 179, 8, 0.3) !important;
    color: rgb(252, 211, 77) !important;
    border-color: rgba(234, 179, 8, 0.4) !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Remover qualquer cor padrão do navegador */
.tab-button:active:not(.active) {
    background: rgba(234, 179, 8, 0.1) !important;
    color: rgb(252, 211, 77) !important;
    border-color: rgba(234, 179, 8, 0.2) !important;
}

/* Remover cores padrão do navegador */
.tab-button {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Forçar amarelo em todos os estados possíveis */
.tab-button:active,
.tab-button:focus:active,
.tab-button:hover:active {
    background: rgba(234, 179, 8, 0.3) !important;
    color: rgb(252, 211, 77) !important;
    border-color: rgba(234, 179, 8, 0.4) !important;
    outline: none !important;
    box-shadow: none !important;
}


/* Modal de bloqueio centralizado */
#referralsBlockModal:not(.hidden) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Scroll personalizado para modal de bloqueio */
#referralsBlockModal .dark-card {
    scrollbar-width: thin;
    scrollbar-color: rgba(234, 179, 8, 0.5) rgba(26, 26, 26, 0.8);
}

#referralsBlockModal .dark-card::-webkit-scrollbar {
    width: 6px;
}

#referralsBlockModal .dark-card::-webkit-scrollbar-track {
    background: rgba(26, 26, 26, 0.8);
    border-radius: 3px;
}

#referralsBlockModal .dark-card::-webkit-scrollbar-thumb {
    background: rgba(234, 179, 8, 0.5);
    border-radius: 3px;
}

#referralsBlockModal .dark-card::-webkit-scrollbar-thumb:hover {
    background: rgba(234, 179, 8, 0.7);
}

