/* --- DIAMOND PRO EXTENSION (v1.7 - Dual Glow & Polish) --- */

/* 1. ANIMAÇÃO 3D (TERRA) */
.diamond-wrapper { 
    perspective: 800px; 
    transform-style: preserve-3d; 
}
.diamond-icon.spinning { 
    animation: spinEarth 2.5s linear infinite !important; 
}
@keyframes spinEarth { 
    0% { transform: rotateY(0deg); } 
    100% { transform: rotateY(360deg); } 
}

/* 2. CARD CAIXINHA DE INVESTIMENTO (DUAL GLOW) */
.invest-card {
    /* Estrutura para a Borda Animada */
    position: relative;
    z-index: 0;
    overflow: hidden; 
    
    /* Dimensões */
    width: 100%;
    max-height: 110px;
    padding: 15px;
    border-radius: 24px;
    margin-bottom: 20px;
    
    /* Fundo base transparente */
    background: transparent; 
    box-shadow: 0 8px 20px rgba(0,0,0,0.1); 
    color: var(--text); 
    
    animation: slideUp 0.4s ease-out backwards;
    /* display: none; REMOVIDO NA VERSÃO MODULAR (Agora é nativo) */
    display: block; 
    
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* O BRILHO DOURADO DUPLO (::before) */
.invest-card::before {
    content: '';
    position: absolute;
    z-index: -2;
    left: -50%;
    top: -50%;
    width: 200%;
    height: 200%;
    /* DOIS FEIXES OPOSTOS */
    background-image: conic-gradient(
        transparent 0deg, 
        #f1c40f 40deg, 
        transparent 80deg, 
        transparent 180deg, 
        #f1c40f 220deg, 
        transparent 260deg
    );
    animation: rotateBorder 4s linear infinite;
}

/* O FUNDO DO CARD (MÁSCARA) (::after) */
.invest-card::after {
    content: '';
    position: absolute;
    z-index: -1;
    /* Inset 4px = Borda grossa */
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    background: var(--card-bg); 
    border-radius: 20px; /* 24px - 4px */
    transition: opacity 0.3s;
}

/* Ajuste Dark Mode */
body.dark-mode .invest-card {
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* --- CONTEÚDO INTERNO --- */
.invest-header, .invest-value {
    position: relative;
    z-index: 2;
    transition: opacity 0.3s;
}

/* ESTADO RETRÁTIL (PERFEITO) */
.invest-card.collapsed {
    max-height: 48px !important; /* Altura ajustada para borda + botões */
    padding: 0 !important;
    margin-bottom: 5px !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Remove borda e fundo ao colapsar para ficar "invisível" */
.invest-card.collapsed::before,
.invest-card.collapsed::after {
    opacity: 0;
}

.invest-card.collapsed .invest-label,
.invest-card.collapsed .invest-value {
    display: none !important;
}

.invest-card.collapsed .invest-header {
    width: 100%;
    margin: 0;
    justify-content: flex-end;
    padding-right: 15px; 
    padding-top: 4px; 
    display: flex;
}

/* --- ESTILOS INTERNOS DO CARD --- */
.invest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px; 
}

.invest-label {
    font-size: 0.8rem; 
    opacity: 0.8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray); 
}

.invest-actions { display: flex; gap: 8px; }

.btn-invest-tool {
    background: var(--input-bg); 
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    color: var(--primary); 
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.btn-invest-tool:active { transform: scale(0.95); background: rgba(108,99,255,0.1); }

.invest-value {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-top: 0;
    color: #f1c40f; 
    line-height: 1.2;
}

/* Borrão Híbrido */
.invest-card.invest-blur .invest-value {
    filter: blur(8px);
    user-select: none;
    color: var(--text); 
}

/* 3. NOVOS CONTROLES DE TRANSAÇÃO */
.type-btn.t-inv { border-color: transparent; color: var(--gray); }
.type-btn.t-inv.selected { background: rgba(243, 156, 18, 0.15); color: #f39c12; border: 1px solid #f39c12; }

.invest-options { display: flex; gap: 10px; margin-bottom: 15px; animation: slideUp 0.2s ease-out; }

.btn-sub-opt {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: var(--input-bg);
    color: var(--text);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0.7;
    transition: 0.2s;
}

.btn-sub-opt.opt-in.active { background: #f1c40f; color: #2d3436; opacity: 1; box-shadow: 0 4px 10px rgba(241, 196, 15, 0.3); font-weight: 700; }
.btn-sub-opt.opt-out.active { background: var(--text); color: var(--card-bg); opacity: 1; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }

/* 4. CAMPO CRÉDITO */
.credit-due-box {
    background: rgba(108, 99, 255, 0.08);
    padding: 12px;
    border-radius: 14px;
    margin-bottom: 15px;
    border: 1px dashed var(--primary);
    animation: slideUp 0.2s;
    display: flex;
    flex-direction: column;
}

.due-label { font-size: 0.75rem; color: var(--primary); font-weight: 700; margin-bottom: 5px; display: flex; align-items: center; gap: 5px; }

/* 5. RECIBO EVOLUÍDO */
.receipt-nav {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
    background: var(--bg); padding: 8px 12px; border-radius: 12px; border: 1px solid rgba(0,0,0,0.05);
}
.receipt-btn-nav { background: none; border: none; font-size: 1.2rem; color: var(--primary); cursor: pointer; padding: 5px; }

.receipt-text {
    font-family: 'Poppins', sans-serif;
    background: var(--input-bg);
    padding: 15px;
    border-radius: 16px;
    font-size: 0.85rem;
    color: var(--text);
    border: none;
    max-height: 350px;
    overflow-y: auto;
}

.rec-row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.rec-date { font-size: 0.7rem; color: var(--gray); opacity: 0.8; }
.rec-in { color: #00b894; font-weight: 600; } 
.rec-out { color: #ff7675; font-weight: 600; } 

.receipt-total-acc {
    margin-top: 15px; padding-top: 15px; border-top: 2px dashed var(--gray);
    display: flex; justify-content: space-between; align-items: center;
}

/* 6. FILTRO GUARDAR */
.filter-chip.f-invest.active { background: #f1c40f; color: #2d3436; border-color: #f1c40f; box-shadow: 0 4px 10px rgba(241, 196, 15, 0.3); }

/* 7. RANKING SCROLL */
#report-ranking { 
    max-height: 300px; 
    overflow-y: auto; 
    padding-right: 5px; 
    scrollbar-width: thin; 
    scrollbar-color: var(--primary) var(--input-bg); 
}

/* 8. DATA COMPRA CRÉDITO */
.purchase-date {
    display: inline-block;
    background: var(--input-bg);
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 0.7rem;
    color: var(--text);
    margin-left: 5px;
    border: 1px solid rgba(0,0,0,0.1);
}