/* ==========================================================================
   1. Variáveis de Tema (Light & Dark Mode)
   ========================================================================== */
:root.light {
    --color-background: #f8fafc;
    --color-card: #ffffff;
    --color-text-primary: #334155;
    --color-text-secondary: #64748b;
    --color-text-heading: #0f172a;
    --color-background-hover: #e2e8f0;
    --custom-cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23facc15" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-sun"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg>') 12 12;
}

:root.dark {
    --color-background: #0f172a;
    --color-card: #1e293b;
    --color-text-primary: #cbd5e1;
    --color-text-secondary: #94a3b8;
    --color-text-heading: #f1f5f9;
    --color-background-hover: #334155;
    --custom-cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23d946ef" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-moon"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>') 12 12;
}

/* Utilitários baseados no tema */
.bg-background { background-color: var(--color-background); }
.bg-card { background-color: var(--color-card); }
.text-text-primary { color: var(--color-text-primary); }
.text-text-secondary { color: var(--color-text-secondary); }
.text-text-heading { color: var(--color-text-heading); }
.bg-background-hover { background-color: var(--color-background-hover); }
.dark .dark\:text-slate-400 { color: #94a3b8; }


/* ==========================================================================
   2. Estilos Base e Animações Globais
   ========================================================================== */
body {
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    cursor: var(--custom-cursor), auto;
    overflow-x: hidden;
}

a, button, [role="button"], .whatsapp-fab-container {
    cursor: pointer;
}
#draggable-whatsapp {
    cursor: grab;
}
#draggable-whatsapp.dragging {
    cursor: grabbing;
}

#typed-name::after {
    content: '|';
    animation: blink 1s step-start infinite;
}
@keyframes blink {
    50% { opacity: 0; }
}

.scroll-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

.nav-link {
    transition: color 0.2s ease;
    font-weight: 500;
}
.nav-link-active {
    color: #2563eb;
    font-weight: 700;
}
.social-link-footer {
    transition: color 0.2s ease;
}
.social-link-footer:hover {
    color: #60a5fa;
}

.project-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.email-btn {
    transition: transform 0.2s ease;
}
.email-btn:hover {
    transform: scale(1.05);
}


/* ==========================================================================
   3. Canvas para Partículas
   ========================================================================== */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}


/* ==========================================================================
   4. Menu Mobile e Botão Topo
   ========================================================================== */
@media (max-width: 767px) {
    body { cursor: auto; }
    #menu-container {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--color-card);
        box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
        padding: 1rem;
    }
    #menu-container ul {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
}

#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 101;
    background-color: #2563eb;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
#back-to-top:hover {
    background-color: #1d4ed8;
    transform: translateY(-3px);
}
#back-to-top.hidden {
    display: none;
}


/* ==========================================================================
   5. Botão Flutuante de WhatsApp
   ========================================================================== */
#draggable-whatsapp {
    position: fixed;
    bottom: 30px;
    right: 100px;
    z-index: 100;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    cursor: grab;
    user-select: none;
}
#draggable-whatsapp.dragging {
    cursor: grabbing;
}

.whatsapp-main-button {
    width: 65px; height: 65px;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer; border: 1px solid #f1f1f1;
    font-size: 2.3rem;
    animation: pulsar 0.8s ease-out 1s infinite alternate;
}

@keyframes pulsar {
    from { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    to { transform: scale(1.1); box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
}

.whatsapp-options {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#draggable-whatsapp.active .whatsapp-options {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.whatsapp-bubble {
    display: flex; align-items: center;
    background-color: var(--color-card);
    color: var(--color-text-heading);
    padding: 8px 16px; border-radius: 9999px;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    text-decoration: none; white-space: nowrap;
    transition: transform 0.2s ease;
}
.whatsapp-bubble:hover {
    transform: scale(1.05);
}
.whatsapp-bubble .whatsapp-text {
    margin-right: 8px;
    font-weight: 500;
}
.whatsapp-bubble i {
    font-size: 1.2rem;
    color: #25D366;
}
