/* assets/css/download-links.css - VISUAL PROFISSIONAL & PRECISO */

/* --- Variáveis --- */
:root {
    --magic-primary: #10b981;
    --magic-secondary: #3b82f6;
    --magic-accent: #8b5cf6;
    --magic-dark: #0f172a;
}

.magic-text-gradient {
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #34d399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.glass-panel {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

/* =========================================
   BADGE MÁGICO DE CONTADOR
   ========================================= */
.magic-count-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 12px;
    padding: 2px 14px;
    margin-left: 12px;
    min-width: 60px;
    height: 46px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 0 15px rgba(59, 130, 246, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Brilho rotativo sutil */
.magic-count-badge::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 60%);
    animation: rotateGlow 6s linear infinite;
    pointer-events: none;
}

@keyframes rotateGlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.count-val {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: 800;
    color: #60a5fa;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
    z-index: 1;
    line-height: 1;
}

.count-label {
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #94a3b8;
    z-index: 1;
    margin-top: 2px;
    font-weight: 700;
}

/* Animação de "Pop" quando atualiza */
.pop-animation {
    animation: popScale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popScale {
    0% { transform: scale(0.9); opacity: 0.7; filter: brightness(1); }
    50% { transform: scale(1.1); opacity: 1; filter: brightness(1.5); }
    100% { transform: scale(1); opacity: 1; filter: brightness(1); }
}

/* =========================================
   HEADER & LAYOUT
   ========================================= */
.manager-header-card {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 1.5rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}
.manager-header-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.5), transparent);
}

.manager-title-fixed {
    font-size: 1.5rem !important; /* DIMINUIDO de 1.75rem */
    line-height: 1.2;
    font-weight: 800;
}

.manager-product-thumb {
    width: 160px; height: 90px; border-radius: 1rem; overflow: hidden; position: relative;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 10px 30px rgba(0, 0, 0, 0.4); flex-shrink: 0;
}
.manager-product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s; }
.manager-product-thumb:hover img { transform: scale(1.15); }

/* Inputs de Pesquisa */
.search-container-wide { width: 100%; transition: all 0.3s ease; }
@media (min-width: 1024px) { .search-container-wide { width: 420px !important; } }

#search-requests {
    background-color: rgba(15, 23, 42, 0.8);
    border-color: rgba(71, 85, 105, 0.5); transition: all 0.3s;
}
#search-requests:focus {
    background-color: rgba(15, 23, 42, 0.95);
    border-color: var(--magic-secondary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* =========================================
   TABLEMANAGER - ESTILOS MÁGICOS & MOBILE
   ========================================= */

/* Container para rolagem suave no mobile sem barra de rolagem */
.mobile-scroll-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Rolagem suave no iOS */
    
    /* Esconde barra de rolagem padrão mas permite scroll */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE 10+ */
}
.mobile-scroll-container::-webkit-scrollbar { 
    display: none; /* Chrome/Safari/Webkit */
}

/* Estilos da Tabela - Usando ID para garantir especificidade e funcionar com TableManager */
#table-manager-container table { 
    border-collapse: separate; 
    border-spacing: 0; 
    width: 100%;
}

/* Cabeçalho MAGICO */
#table-manager-container table thead tr th {
    background: rgba(30, 41, 59, 0.95);
    /* Borda Inferior Magica estilo Gradiente */
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(to right, transparent, rgba(59, 130, 246, 0.5), transparent) 1;
    
    /* Box Shadow interno suave */
    box-shadow: inset 0 -2px 10px rgba(0, 0, 0, 0.2);

    border-right: 1px solid rgba(255, 255, 255, 0.03); 
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    padding: 1rem 1.25rem;
    
    /* IMPORTANTE: Evita quebra de linha e esmagamento no mobile */
    white-space: nowrap; 
    min-width: max-content; /* Garante largura baseada no conteúdo */
}
#table-manager-container table thead tr th:last-child {
    border-right: none;
}

/* Linhas e Células */
#table-manager-container table tbody tr {
    transition: background-color 0.2s;
}
#table-manager-container table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.08) !important;
}

/* Separador Magico Levemente Visível */
#table-manager-container table tbody td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    /* Linha mágica de separação solicitada */
    border-right: 1px solid rgba(96, 165, 250, 0.08); 
    
    vertical-align: middle;
    color: #cbd5e1;
    padding: 0.85rem 1.25rem;
    
    /* IMPORTANTE: Evita quebra de linha no mobile */
    white-space: nowrap; 
}
#table-manager-container table tbody tr:last-child td {
    border-bottom: none;
}
#table-manager-container table tbody td:last-child {
    border-right: none;
}

/* Resize Handle (TableManager) */
.resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    cursor: col-resize;
    background: transparent;
    transition: background 0.2s;
    z-index: 10;
}
.resize-handle:hover {
    background: rgba(59, 130, 246, 0.5);
}

/* =========================================
   COMPONENTES VISUAIS
   ========================================= */
/* Status Badges */
.status-badge {
    padding: 0.35rem 0.8rem; border-radius: 999px; font-size: 0.65rem;
    font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
    display: inline-flex; align-items: center; gap: 5px;
}
.status-analise { background: rgba(234, 179, 8, 0.15); color: #facc15; border: 1px solid rgba(234, 179, 8, 0.3); }
.status-aprovado { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-rejeitado { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.status-cancelado { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Cost Badges */
.cost-badge { font-size: 0.65rem; font-weight: 800; padding: 2px 8px; border-radius: 99px; letter-spacing: 0.02em; display: inline-flex; align-items: center; gap: 4px; }
.cost-badge.paid { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.2); }
.cost-badge.free { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.2); }

/* =========================================
   MODAL WIZARD & CARDS
   ========================================= */
.wizard-modal-overlay { background: rgba(5, 10, 20, 0.85); backdrop-filter: blur(8px); }

.wizard-content {
    background: linear-gradient(160deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(139, 92, 246, 0.1);
    border-radius: 1.5rem; overflow: hidden; position: relative;
}
.wizard-header { background: rgba(15, 23, 42, 0.8); border-bottom: 1px solid rgba(255, 255, 255, 0.05); padding: 1.5rem 2rem; }

.wizard-step-indicator { display: flex; justify-content: space-between; position: relative; margin-bottom: 2.5rem; padding: 0 1.5rem; }
.wizard-step-indicator::before { content: ''; position: absolute; top: 50%; left: 1.5rem; right: 1.5rem; height: 2px; background: #334155; z-index: 0; transform: translateY(-50%); }
.step-dot { width: 36px; height: 36px; background: #1e293b; border: 2px solid #475569; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-weight: bold; z-index: 1; position: relative; transition: all 0.4s; }
.step-dot.active { border-color: #3b82f6; background: #0f172a; color: #3b82f6; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2); transform: scale(1.2); }
.step-dot.completed { background: #10b981; border-color: #10b981; color: white; box-shadow: 0 0 10px rgba(16, 185, 129, 0.4); }

.grid-services-wrapper { padding-top: 20px; padding-bottom: 10px; margin-top: -10px; }

.service-card {
    display: flex; align-items: center; padding: 1rem;
    background: rgba(30, 41, 59, 0.5); border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    cursor: pointer; z-index: 1; position: relative; overflow: hidden;
}
.service-card:hover:not(.selected) {
    background: rgba(30, 41, 59, 0.8); border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px); box-shadow: 0 10px 20px -5px rgba(0,0,0,0.5); z-index: 10;
}
.service-card.selected {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, rgba(30, 41, 59, 0.6) 100%);
    border-color: #3b82f6; box-shadow: 0 0 0 1px #3b82f6, 0 10px 25px -5px rgba(59, 130, 246, 0.25); z-index: 2;
}
.service-icon-box { width: 40px; height: 40px; border-radius: 10px; background: rgba(15, 23, 42, 0.6); border: 1px solid rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-right: 0.75rem; flex-shrink: 0; }
.service-info { flex: 1; min-width: 0; }
.service-name { font-weight: 700; color: #f1f5f9; font-size: 0.95rem; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selection-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.1); margin-left: 1rem; display: flex; align-items: center; justify-content: center; transition: all 0.3s; }
.service-card.selected .selection-check { background: #3b82f6; border-color: #3b82f6; color: white; transform: scale(1.1); }
.selection-check i { font-size: 0.75rem; opacity: 0; transform: scale(0); transition: all 0.2s; }
.service-card.selected .selection-check i { opacity: 1; transform: scale(1); }

/* Botão Vivido */
.btn-vivid-action {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%); color: white; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
    border: none; position: relative; overflow: hidden; box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.5); transition: all 0.3s;
}
.btn-vivid-action:hover { transform: translateY(-2px); box-shadow: 0 15px 30px -5px rgba(139, 92, 246, 0.6); }
.btn-vivid-action::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); transition: 0.5s;
}
.btn-vivid-action:hover::after { left: 100%; }

/* Detalhes de Pontos */
.points-summary-card { background: rgba(15, 23, 42, 0.6); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 1rem; padding: 1.5rem; position: relative; overflow: hidden; }
.points-row { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.1); }
.points-row:last-child { border-bottom: none; }
.points-highlight { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.2); border-radius: 0.75rem; padding: 1rem; margin: 1rem 0; }

/* Partículas e Animações */
.magic-particles-bg {
    position: absolute; inset: 0; z-index: 0; opacity: 0; pointer-events: none;
    background-image: radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.15) 0%, transparent 20%), radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.15) 0%, transparent 20%);
    transition: opacity 1s;
}
.step-success-active .magic-particles-bg { opacity: 1; }

@keyframes slideUpFade { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate-slide-up { animation: slideUpFade 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.animate-delay-100 { animation-delay: 0.1s; }

/* Preloader */
.loader-manager-wrapper { width: 100px; height: 100px; position: relative; }
.hex-brick { background: #8b5cf6; width: 30px; height: 17px; position: absolute; top: 5px; animation: fade 2s infinite; }
.h2 { transform: rotate(60deg); } .h3 { transform: rotate(-60deg); }
.gel { height: 30px; width: 30px; transition: all .3s; position: absolute; top: 50%; left: 50%; }
.center-gel { margin-left: -15px; margin-top: -15px; animation: pulse 2s infinite; }
.c1 { margin-left: -47px; margin-top: -15px; } .c2 { margin-left: -31px; margin-top: -43px; } .c3 { margin-left: 1px; margin-top: -43px; }
.c4 { margin-left: 17px; margin-top: -15px; } .c5 { margin-left: -31px; margin-top: 13px; } .c6 { margin-left: 1px; margin-top: 13px; }
.r1 { animation: pulse 2s infinite .2s; } .r2 { animation: pulse 2s infinite .4s; } .r3 { animation: pulse 2s infinite .6s; }
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.8); opacity: 0.7; } 100% { transform: scale(1); opacity: 1; } }
@keyframes fade { 0% { background: #8b5cf6; } 50% { background: #3b82f6; } 100% { background: #8b5cf6; } }

/* =========================================
   MOBILE RESPONSIVE: CARD VIEW (MAGIC SOLUTION)
   ========================================= */
@media (max-width: 768px) {
    /* Remover comportamento de tabela */
    #table-manager-container table, 
    #table-manager-container table thead, 
    #table-manager-container table tbody, 
    #table-manager-container table th, 
    #table-manager-container table td, 
    #table-manager-container table tr {
        display: block;
    }

    /* Esconder cabeçalho */
    #table-manager-container table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    /* Estilizar Linha como Card */
    #table-manager-container table tbody tr {
        background: rgba(30, 41, 59, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 16px;
        margin-bottom: 16px;
        padding: 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
        position: relative;
        overflow: hidden;
    }
    
    /* Efeito de borda lateral colorida MÁGICA (Verde -> Azul -> Amarelo) */
    #table-manager-container table tbody tr::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 5px;
        /* Gradiente Mágico: Verde Claro -> Azul Claro -> Amarelo Claro */
        background: linear-gradient(to bottom, #6ee7b7, #93c5fd, #fde047);
        box-shadow: 0 0 15px rgba(110, 231, 183, 0.6);
        opacity: 1;
        z-index: 5;
    }

    /* Estilizar Células */
    #table-manager-container table tbody td {
        border: none;
        border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
        position: relative;
        padding: 12px 0;
        padding-left: 40%; /* Espaço para o label */
        text-align: right;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        white-space: normal !important; /* Permitir quebra de linha no mobile */
    }

    #table-manager-container table tbody td:last-child {
        border-bottom: none;
        padding-left: 0;
        justify-content: center;
        margin-top: 8px;
        background: rgba(0,0,0,0.2);
        border-radius: 8px;
        padding: 12px;
    }

    /* Label (Header) Fake */
    #table-manager-container table tbody td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 35%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 800;
        color: #94a3b8;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        text-align: left;
    }
    
    /* Fix para o label AÇÕES não ficar colado na borda */
    #table-manager-container table tbody td:last-child::before {
        left: 16px; 
    }

    /* Ajustes específicos para alinhar conteúdo complexo à direita */
    #table-manager-container table tbody td[data-field="source"] > div,
    #table-manager-container table tbody td[data-field="points_cost"] > div,
    #table-manager-container table tbody td[data-field="date"] > div {
        align-items: flex-end !important; 
        text-align: right;
    }
    
    /* Resetar larguras forçadas pelo JS no mobile */
    #table-manager-container table td {
        width: 100% !important;
    }
}