/* ============================================
   ESTILOS PARA VELAS - 100% IGUAL AO EXEMPLO
   ============================================ */

/* Container de Modas - 3 boxes horizontais */
#modas-container {
    display: flex;
    gap: 8px;
    width: 100%;
    align-items: stretch;
}

/* Boxes de Modas - EXATO COMO NO EXEMPLO */
.moda-box {
    flex: 1;
    min-width: 0;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: #1E1E1E;
    transition: all 0.2s ease-in-out;
    text-align: center;
    line-height: 1;
}

/* Cores do texto das modas */
.moda-blue {
    color: rgb(59, 130, 246) !important; /* Azul */
}

.moda-purple {
    color: rgb(162, 35, 152) !important; /* Roxo */
}

.moda-pink {
    color: rgb(236, 72, 153) !important; /* Rosa */
}

.moda-box:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Boxes de Estatísticas - EXATO COMO NO EXEMPLO */
.stats-box {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: #1E1E1E;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 36px;
}

/* Grid de 5 colunas fixas para FEED AO VIVO */
.candles-grid-feed {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 7px;
    padding: 0;
    max-height: 720px;
    overflow-y: auto;
    width: 100%;
}

/* Estilos para as velas do feed - ESTRUTURA EXATA DO EXEMPLO */
.candle-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px; /* space-y-1 equivalente */
    border-radius: 12px; /* rounded-xl */
    border: 1px solid #191919;
    padding: 4px 8px 4px 8px; /* px-2 pt-1 (0.5rem horizontal, 0.25rem top) */
    width: 100%;
    aspect-ratio: 1;
    min-height: 70px;
    height: 70px;
    max-height: 70px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
}

.candle-item:hover {
    transform: translateY(-2px) scale(1.02);
}

/* Container interno para o valor - EXATO DO EXEMPLO */
.candle-value-container {
    width: 100%;
    border-radius: 24px; /* rounded-3xl */
    border: 1px solid #303030;
    background-color: #1E1E1E;
    text-align: center;
    padding: 3px 2px;
}

/* Valor da vela - EXATO DO EXEMPLO */
.candle-value {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    padding: 0;
}

/* Timestamp - EXATO DO EXEMPLO */
.candle-time {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    color: #ffffff;
    margin: 0;
    padding: 0;
}

/* Cores de fundo para o container externo (com transparência) - EXATAS DO EXEMPLO */
.candle-bg-blue {
    background-color: rgba(59, 130, 246, 0.25) !important; /* Azul transparente */
}

.candle-bg-purple {
    background-color: rgba(162, 35, 152, 0.25) !important; /* Roxo transparente - EXATO */
}

.candle-bg-pink {
    background-color: rgba(236, 72, 153, 0.25) !important; /* Rosa transparente */
}

.candle-bg-gray {
    background-color: rgba(75, 85, 99, 0.25) !important; /* Cinza transparente */
}

/* Cores do texto do valor - EXATAS DO EXEMPLO */
.candle-value-blue {
    color: rgb(59, 130, 246) !important; /* Azul */
}

.candle-value-purple {
    color: rgb(162, 35, 152) !important; /* Roxo - EXATO DO EXEMPLO */
}

.candle-value-pink {
    color: rgb(236, 72, 153) !important; /* Rosa */
}

.candle-value-gray {
    color: rgb(156, 163, 175) !important; /* Cinza */
}

/* Scrollbar personalizada */
.candles-grid-feed::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.candles-grid-feed::-webkit-scrollbar-track {
    background: #1B1C1D;
    border-radius: 10px;
}

.candles-grid-feed::-webkit-scrollbar-thumb {
    background-color: #a855f7;
    border-radius: 10px;
    border: 1px solid #1B1C1D;
}

.candles-grid-feed::-webkit-scrollbar-thumb:hover {
    background-color: #9333ea;
}

/* ============================================
   RESPONSIVO
   ============================================ */

/* Mobile: 2 colunas */
@media (max-width: 640px) {
    .candles-grid-feed {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .moda-box {
        height: 45px;
        font-size: 14px;
    }
    
    #modas-container {
        gap: 6px;
    }
    
    .candle-item {
        min-height: 65px;
        height: 65px;
        max-height: 65px;
        padding: 6px 6px 3px 6px;
    }
    
    .candle-value {
        font-size: 12px;
    }
    
    .candle-time {
        font-size: 10px;
    }
    
    .stats-box {
        padding: 6px 10px;
        min-height: 32px;
    }
}

/* Tablet: 3 colunas */
@media (min-width: 641px) and (max-width: 1024px) {
    .candles-grid-feed {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop: 5 colunas (já definido acima) */

/* ============================================
   UTILITÁRIOS
   ============================================ */

.text-white {
    color: #ffffff;
}

.text-gray-400 {
    color: #9ca3af;
}

.opacity-75 {
    opacity: 0.75;
}

/* ============================================
   NAVEGAÇÃO SPA (SINGLE PAGE APPLICATION)
   ============================================ */

.page-content {
    display: block;
}

.page-content.hidden {
    display: none;
}

/* ============================================
   PÁGINA CATÁLOGO
   ============================================ */

/* Filtros do Catálogo */
.catalog-filter-select {
    background-color: #1E1E1E;
    border: 1px solid #303030;
    border-radius: 8px;
    padding: 8px 12px;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 150px;
    height: 40px;
    flex-shrink: 0;
}

.catalog-filter-select option {
    background-color: #1E1E1E;
    color: #ffffff;
}

.catalog-filter-select:hover {
    border-color: #9333ea;
}

.catalog-filter-select:focus {
    outline: none;
    border-color: #9333ea;
    box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.2);
}

/* Dropdown de Padrões - ESTILO EXATO DO EXEMPLO */
#pattern-filter-btn {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px 12px 0 0 !important;
    padding: 8px 20px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    white-space: nowrap;
    height: 40px;
    position: relative;
    width: 100% !important;
}

#pattern-filter-btn:hover {
    background-color: rgba(239, 68, 68, 0.9) !important;
}

#pattern-filter-btn svg {
    transition: transform 0.2s;
    width: 20px;
    height: 20px;
}

#pattern-filter-btn svg.rotate-180 {
    transform: rotate(180deg);
}

/* Container do dropdown */
.relative.w-full.max-w-xs {
    position: relative;
    width: 100%;
    max-width: 300px;
}

/* Dropdown panel - FUNDO BRANCO/CLARO COMO NO EXEMPLO */
#pattern-filter-dropdown {
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0 0 12px 12px !important;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 50;
    margin-top: 0 !important;
}

#pattern-filter-dropdown.hidden {
    display: none !important;
}

/* Opções do dropdown - FUNDO ESCURO SOBRE BRANCO */
.pattern-filter-option {
    background-color: #2D1B1B !important;
    color: #ffffff !important;
    border: none !important;
    padding: 16px !important;
    text-align: left !important;
    width: 100% !important;
    cursor: pointer;
    transition: background-color 0.2s;
    display: block;
    margin: 0 !important;
}

.pattern-filter-option:hover {
    background-color: #3D2B2B !important;
}

.pattern-filter-option:first-child {
    border-radius: 0;
}

.pattern-filter-option .flex {
    display: flex;
}

.pattern-filter-option .flex-col {
    flex-direction: column;
}

.pattern-filter-option .gap-1 {
    gap: 4px;
}

.pattern-filter-option .gap-3 {
    gap: 12px;
}

.pattern-filter-option .items-center {
    align-items: center;
}

.pattern-filter-option .font-medium {
    font-weight: 500;
    color: #ffffff;
}

.pattern-filter-option .text-gray-400 {
    color: #9ca3af;
}

.pattern-filter-option .text-xs {
    font-size: 12px;
}

.pattern-filter-option .ml-7 {
    margin-left: 28px;
}

.pattern-filter-option svg {
    width: 16px;
    height: 16px;
    fill: #ffffff;
    stroke: currentColor;
    flex-shrink: 0;
}

/* Divisor de seções */
#pattern-filter-dropdown > div > div[class*="bg-"] {
    background-color: #1A1A1A !important;
    padding: 8px 16px;
    border: none;
}

#pattern-filter-dropdown > div > div[class*="bg-"] span {
    font-weight: 600;
    color: #d1d5db;
    font-size: 14px;
}

/* Dividers */
.divide-y {
    border-top-width: 1px;
}

/* Scrollbar do dropdown */
#pattern-filter-dropdown::-webkit-scrollbar {
    width: 8px;
}

#pattern-filter-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#pattern-filter-dropdown::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

#pattern-filter-dropdown::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

.bg-secondary {
    background-color: #1B1C1D;
}

.border-primary {
    border-color: #ef4444;
}

/* Botões de Filtro de Cor - ESTILO EXATO DO EXEMPLO */
.color-filter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background-color: #1E1E1E !important;
    border: 1px solid #303030 !important;
    border-radius: 8px;
    padding: 10px 16px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 70px;
    position: relative;
    flex: 0 0 auto;
}

.color-filter-btn:hover {
    border-color: #9333ea;
    background-color: #2a2a2a;
}

.color-filter-btn.active {
    background-color: #1E1E1E !important;
    border: 2px solid #9333ea !important;
    border-width: 2px !important;
}

/* Botão AZUL ativo - fundo azul claro */
.color-filter-btn[data-color="blue"].active {
    background-color: rgba(59, 130, 246, 0.15) !important;
    border-color: rgb(59, 130, 246) !important;
}

/* Botão ROXO ativo - fundo roxo claro */
.color-filter-btn[data-color="purple"].active {
    background-color: rgba(162, 35, 152, 0.15) !important;
    border-color: rgb(162, 35, 152) !important;
}

/* Botão ROSA ativo - fundo rosa claro */
.color-filter-btn[data-color="pink"].active {
    background-color: rgba(236, 72, 153, 0.15) !important;
    border-color: rgb(236, 72, 153) !important;
}

/* Botão TODOS ativo - borda branca */
.color-filter-btn[data-color="all"].active {
    background-color: #1E1E1E !important;
    border: 2px solid #ffffff !important;
    border-width: 2px !important;
}

.color-filter-btn span:first-child {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

.color-filter-btn span:last-child {
    font-size: 12px;
    opacity: 0.9;
    font-weight: 500;
}

/* Grid do Catálogo */
.candles-grid-catalog {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    padding: 0;
    max-height: 800px;
    overflow-y: auto;
    width: 100%;
}

/* Responsivo: ajustar colunas */
@media (max-width: 1920px) {
    .candles-grid-catalog {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (max-width: 1440px) {
    .candles-grid-catalog {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 1024px) {
    .candles-grid-catalog {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 768px) {
    .candles-grid-catalog {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 640px) {
    .candles-grid-catalog {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Scrollbar para catálogo */
.candles-grid-catalog::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.candles-grid-catalog::-webkit-scrollbar-track {
    background: #1B1C1D;
    border-radius: 10px;
}

.candles-grid-catalog::-webkit-scrollbar-thumb {
    background-color: #a855f7;
    border-radius: 10px;
    border: 1px solid #1B1C1D;
}

.candles-grid-catalog::-webkit-scrollbar-thumb:hover {
    background-color: #9333ea;
}

/* ============================================
   ANÁLISE PERSONALIZADA
   ============================================ */

.catalog-input {
    width: 100%;
    max-width: 300px;
    background-color: #1E1E1E;
    border: 2px solid #ef4444;
    border-radius: 8px;
    padding: 10px 16px;
    color: #ffffff;
    font-size: 14px;
    transition: all 0.2s;
}

.catalog-input:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.catalog-input::placeholder {
    color: #9ca3af;
}

.analysis-btn {
    background-color: #ef4444;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.analysis-btn:hover {
    background-color: #dc2626;
}

.analysis-btn.active {
    background-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

/* Tabela de Análise */
.analysis-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.analysis-table thead {
    background-color: #ef4444;
}

.analysis-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
    text-transform: uppercase;
}

.analysis-table tbody tr {
    background-color: #1E1E1E;
    border-bottom: 1px solid #303030;
}

.analysis-table tbody tr:hover {
    background-color: #2a2a2a;
}

.analysis-table tbody td {
    padding: 12px 16px;
    color: #ffffff;
    font-size: 14px;
}

.analysis-table tbody tr:nth-child(even) {
    background-color: #252525;
}

.analysis-table tbody tr:nth-child(even):hover {
    background-color: #2a2a2a;
}

/* ============================================
   PÁGINA MINUTAGEM
   ============================================ */

/* Grid de Final do Minuto (0-9) */
.minute-end-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    width: 100%;
}

.minute-end-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background-color: #1E1E1E;
    border: 1px solid #303030;
    border-radius: 8px;
    padding: 12px 8px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 70px;
}

.minute-end-btn:hover {
    border-color: #9333ea;
    background-color: #2a2a2a;
}

.minute-end-btn.active {
    background-color: rgba(239, 68, 68, 0.2) !important;
    border: 2px solid #ef4444 !important;
    border-width: 2px !important;
}

.minute-end-number {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

.minute-end-btn.active .minute-end-number {
    color: #ffffff;
}

.minute-end-count {
    font-size: 14px;
    font-weight: 500;
    color: #ec4899;
}

.minute-end-btn.active .minute-end-count {
    color: #ec4899;
}

/* Botão Limpar Filtros */
.clear-filters-btn {
    background-color: #1E1E1E;
    border: 1px solid #303030;
    border-radius: 8px;
    padding: 10px 24px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.clear-filters-btn:hover {
    border-color: #9333ea;
    background-color: #2a2a2a;
}

/* Grid de Resultados da Minutagem */
.candles-grid-timing {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    padding: 0;
    max-height: 800px;
    overflow-y: auto;
    width: 100%;
}

/* Responsivo para grid de minutagem */
@media (max-width: 1920px) {
    .candles-grid-timing {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (max-width: 1440px) {
    .candles-grid-timing {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 1024px) {
    .candles-grid-timing {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 768px) {
    .candles-grid-timing {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .minute-end-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }
}

@media (max-width: 640px) {
    .candles-grid-timing {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .minute-end-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }
    
    .minute-end-btn {
        min-height: 60px;
        padding: 8px 4px;
    }
    
    .minute-end-number {
        font-size: 20px;
    }
    
    .minute-end-count {
        font-size: 12px;
    }
}

/* Scrollbar para grid de minutagem */
.candles-grid-timing::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.candles-grid-timing::-webkit-scrollbar-track {
    background: #1B1C1D;
    border-radius: 10px;
}

.candles-grid-timing::-webkit-scrollbar-thumb {
    background-color: #a855f7;
    border-radius: 10px;
    border: 1px solid #1B1C1D;
}

.candles-grid-timing::-webkit-scrollbar-thumb:hover {
    background-color: #9333ea;
}

/* Destaque apenas do último dígito em rosa - SEM BORDA */
.minute-digit-highlight {
    color: #ec4899 !important;
    font-weight: 500;
}
