/* =============================================================================
   WHATSAPP DISPATCHER — INOVARE AI — CSS
   Padrão Artools (Seção 15 do Arquivo Mestre)
   ============================================================================= */

/* --- Noise Overlay (Seção 15.2) --- */
.noise-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0.04; pointer-events: none; z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- Reading Progress Bar (Seção 16.1) --- */
#reading-progress {
    position: fixed; top: 0; left: 0; height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #3b82f6);
    background-size: 200% 100%;
    animation: gradientMove 3s linear infinite;
    width: 0%; z-index: 999999;
    transition: width 0.2s ease;
}
@keyframes gradientMove {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* --- Glass Panel (Seção 15.5) --- */
.glass-panel {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* --- Reveal Up Animation (Seção 15.3) --- */
.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(15px);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-up.active {
    opacity: 1; transform: translateY(0); filter: blur(0);
}

/* --- Flashlight Card (Seção 15.4) --- */
.flashlight-card { position: relative; overflow: hidden; }
.flashlight-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(255,255,255,0.06), transparent 40%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}
.flashlight-card:hover::before { opacity: 1; }

/* --- Tab Buttons --- */
.tab-btn {
    color: #78716c;
    background: transparent;
}
.tab-btn:hover {
    color: #d6d3d1;
    background: rgba(255,255,255,0.05);
}
.tab-btn.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(139,92,246,0.2));
    box-shadow: 0 0 20px rgba(59,130,246,0.15);
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* --- Status indicators --- */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.online { background: #10b981; box-shadow: 0 0 8px rgba(16,185,129,0.5); animation: pulse-green 2s infinite; }
.status-dot.offline { background: #ef4444; }
.status-dot.pending { background: #f59e0b; animation: pulse-yellow 2s infinite; }

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 4px rgba(16,185,129,0.4); }
    50% { box-shadow: 0 0 12px rgba(16,185,129,0.6); }
}
@keyframes pulse-yellow {
    0%, 100% { box-shadow: 0 0 4px rgba(245,158,11,0.4); }
    50% { box-shadow: 0 0 12px rgba(245,158,11,0.6); }
}

/* --- Instance card --- */
.instance-card {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
}
.instance-card:hover {
    border-color: rgba(59,130,246,0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* --- Log entry --- */
.log-entry { padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.03); }
.log-entry .log-success { color: #10b981; }
.log-entry .log-error { color: #ef4444; }
.log-entry .log-time { color: #78716c; }

/* --- Glowing Grid Background (Seção 16.3) --- */
.glowing-grid-bg {
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}

/* --- Message bubbles --- */
.msg-outgoing {
    background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(59,130,246,0.1));
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: 12px 12px 4px 12px;
    padding: 8px 12px; max-width: 80%;
    margin-left: auto;
}
.msg-incoming {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px 12px 12px 4px;
    padding: 8px 12px; max-width: 80%;
}

/* --- Button hover effect --- */
button { cursor: pointer; }
button:active { transform: scale(0.97); }
