@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

body { 
    font-family: 'Space Grotesk', sans-serif; 
    overflow-x: hidden; /* ensure no horizontal scroll on the whole page */
}

.font-mono { font-family: 'JetBrains Mono', monospace; }

.cyber-grid {
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.holographic {
    background: linear-gradient(45deg, #3b82f6, #8b5cf6, #06b6d4, #10b981, #f59e0b);
    background-size: 400% 400%;
    animation: gradient 3s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.neon-text {
    text-shadow: 0 0 10px #3b82f6, 0 0 20px #3b82f6, 0 0 30px #3b82f6;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 10px #3b82f6, 0 0 20px #3b82f6, 0 0 30px #3b82f6; }
    to { text-shadow: 0 0 20px #3b82f6, 0 0 30px #3b82f6, 0 0 40px #3b82f6; }
}

.morphing-shape {
    background: linear-gradient(45deg, #3b82f6, #8b5cf6, #06b6d4);
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    animation: morph 8s ease-in-out infinite;
}

@keyframes morph {
    0%, 100% { clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%); }
    25% { clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%); }
    50% { clip-path: polygon(40% 0%, 60% 0%, 100% 40%, 100% 60%, 60% 100%, 40% 100%, 0% 60%, 0% 40%); }
    75% { clip-path: polygon(25% 0%, 75% 0%, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0% 75%, 0% 25%); }
}

.floating-orb {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.1));
    animation: float 6s ease-in-out infinite;
    filter: blur(1px);
}

@keyframes float {
    0%, 100% { transform: translateY(0px) translateX(0px); }
    33% { transform: translateY(-30px) translateX(20px); }
    66% { transform: translateY(10px) translateX(-15px); }
}

.particle {
    position: absolute;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    border-radius: 50%;
    pointer-events: none;
    animation: particle-float 8s ease-in-out infinite;
}

@keyframes particle-float {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.8; }
    50% { transform: translateY(-100px) rotate(180deg); opacity: 0.3; }
}

.code-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: rgba(59, 130, 246, 0.6);
    overflow: hidden;
}

.code-line {
    position: absolute;
    white-space: nowrap;
    animation: rain 10s linear infinite;
}

@keyframes rain {
    0% { transform: translateY(-100vh); opacity: 1; }
    100% { transform: translateY(100vh); opacity: 0; }
}

.cyber-button {
    position: relative;
    background: linear-gradient(45deg, #3b82f6, #1e40af);
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: all 0.3s ease;
    overflow: hidden;
}

.cyber-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.cyber-button:hover::before {
    left: 100%;
}

.cyber-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

/* ========================================
   SEÇÃO SERVIÇOS - ANIMAÇÕES CORRIGIDAS
   ======================================== */

.service-card {
    /* Base estável sem animações conflitantes */
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.18);
    
    /* Transição única e controlada */
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                border-color 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* Otimizações de performance */
    transform: translateZ(0);
    will-change: transform, box-shadow, border-color;
    backface-visibility: hidden;
    
    /* Posicionamento para efeitos */
    position: relative;
    overflow: hidden;

    /* Animação de entrada */
    animation: serviceCardEntry 0.8s ease-out forwards;
}

/* Estados de entrada com delay escalonado */
.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }
.service-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes serviceCardEntry {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Estado hover estável */
.service-card:hover {
    transform: translateY(-12px) scale(1.015);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.2),
                0 0 0 1px rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.4);
}

/* Efeito shimmer controlado */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
                transparent, 
                rgba(255, 255, 255, 0.1), 
                transparent);
    transition: left 0.6s ease-out;
    z-index: 1;
}

.service-card:hover::before {
    left: 100%;
}

/* Conteúdo acima do shimmer */
.service-card > * {
    position: relative;
    z-index: 2;
}

/* Ícones holográficos estáveis */
.service-card .holographic {
    transition: transform 0.3s ease, 
                filter 0.3s ease;
    transform: translateZ(0);
}

.service-card:hover .holographic {
    transform: scale(1.05);
    filter: brightness(1.1) saturate(1.1);
}

/* Botões dos cards */
.service-card .cyber-button {
    transition: all 0.3s ease;
    transform: translateZ(0);
}

.service-card:hover .cyber-button {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

/* Animação dos ícones de check */
.service-card .fas.fa-check {
    transition: transform 0.2s ease, color 0.2s ease;
}

.service-card:hover .fas.fa-check {
    transform: scale(1.1);
}

/* Lista de recursos com movimento sutil */
.service-card .flex.items-center.space-x-3 {
    transition: transform 0.2s ease;
}

.service-card:hover .flex.items-center.space-x-3 {
    transform: translateX(2px);
}

/* Pontos coloridos com pulsação sutil */
.service-card .animate-pulse {
    animation: none !important; /* Remove animação conflitante */
}

.service-card .w-6.h-6.rounded-full {
    animation: subtlePulse 4s ease-in-out infinite;
}

@keyframes subtlePulse {
    0%, 100% { 
        opacity: 0.75; 
        transform: scale(1);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.02);
    }
}

/* Responsividade mobile */
@media (max-width: 768px) {
    .service-card:hover {
        transform: translateY(-6px) scale(1.01);
    }
    
    .service-card .holographic {
        transform: none !important;
    }
}

/* Movimento reduzido para acessibilidade */
@media (prefers-reduced-motion: reduce) {
    .service-card,
    .service-card *,
    .service-card::before {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
    
    .service-card {
        opacity: 1 !important;
    }
}

/* Estados de foco */
.service-card:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Container da grid com espaçamento adequado */
#servicos .grid {
    gap: 2rem;
    padding-top: 1rem;
    padding-bottom: 2rem; /* Espaço extra para hover effects */
}

@media (min-width: 768px) {
    #servicos .grid {
        gap: 2.5rem;
    }
}

@media (min-width: 1024px) {
    #servicos .grid {
        gap: 3rem;
    }
}

.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.typing-effect {
    border-right: 2px solid #3b82f6;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #3b82f6; }
}

.hologram-effect {
    position: relative;
    background: linear-gradient(45deg, transparent 30%, rgba(59, 130, 246, 0.1) 50%, transparent 70%);
    background-size: 200% 200%;
    animation: hologram 3s ease-in-out infinite;
}

@keyframes hologram {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
}

/* Floating Buttons Styles */
.floating-buttons {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.floating-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.whatsapp-btn {
    background: linear-gradient(45deg, #25d366, #20c653);
}

.chat-btn {
    background: linear-gradient(45deg, #3b82f6, #1e40af);
}

.floating-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.5);
}

.whatsapp-btn:hover {
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.5);
}

.floating-btn i {
    font-size: 24px;
    color: white;
}

.credit{
    color:white;
}

/* Animations for floating buttons */
@keyframes pulse-ring {
    0% {
        transform: scale(.33);
        opacity: 1;
    }
    80%, 100% {
        transform: scale(2.33);
        opacity: 0;
    }
}

.floating-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: pulse-ring 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
    z-index: -1;
}

/* Mobile responsiveness for floating buttons */
@media (max-width: 768px) {
    .floating-buttons {
        bottom: 1rem;
        right: 1rem;
    }
    
    .floating-btn {
        width: 50px;
        height: 50px;
    }
    
    .floating-btn i {
        font-size: 20px;
    }
}

/* Form Validation Styles */
.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

.input-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2) !important;
}

.error-message {
    font-size: 0.75rem;
    animation: shake 0.3s ease-in-out;
}

.success-message {
    font-size: 0.75rem;
    color: #10b981;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Loading Button State */
.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading .btn-text {
    display: none;
}

.btn-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Chat Modal Specific Styles (changed: non-transparent, high contrast, no horizontal scroll) */
#chat-modal {
    backdrop-filter: none; /* avoid blurring entire page */
}

/* inner container for chat modal: solid black, white text, strong contrast */
.chat-modal-inner {
    background: #000000; /* solid black as requested */
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

/* chat messages container: vertical scroll only, avoid horizontal overflow */
#chat-messages {
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px; /* avoid overlaying scrollbar on content */
}

/* individual chat message wrapper: ensure wrapping and prevent horizontal scroll */
.chat-message {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: flex-start;
    overflow-wrap: anywhere; /* strong wrapping for long strings */
    word-break: break-word;
    white-space: pre-wrap; /* preserve newlines while wrapping */
}

/* message bubble styles (glass-effect used elsewhere, for chat override to solid) */
.chat-message .glass-effect,
#chat-messages .glass-effect {
    background: #0b0b0b;
    border: 1px solid rgba(255,255,255,0.06);
    color: #ffffff;
    max-width: 78%; /* ensure messages don't exceed container width */
    padding: 8px 10px;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
}

/* user messages aligned right */
.chat-message .from-user {
    margin-left: auto;
    flex-direction: row-reverse;
}

/* chat textarea input styling */
.chat-textarea {
    resize: vertical;
    min-height: 48px;
    max-height: 200px;
    width: 100%;
    background: #0b0b0b;
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.08);
    padding: 10px;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* counter and small text */
#chat-char-count {
    color: #9ca3af;
}

/* Chat typing indicator styling (ensure no overflow) */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Ensure preview textarea inherits readable style */
#assistant-preview-input {
    background: transparent;
    color: #fff;
    resize: none;
    line-height: 1.2;
}

/* Chat modal responsive rules */
@media (max-width: 768px) {
    .chat-modal-inner {
        max-width: calc(100% - 2rem);
        margin: 0 1rem;
        height: calc(100vh - 3rem);
        display: flex;
        flex-direction: column;
    }
    #chat-messages { height: 100%; }
}

/* Chat scrollbar styles (subtle) */
#chat-messages::-webkit-scrollbar {
    width: 8px;
}
#chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    border-radius: 4px;
}

/* Chat Send button disabled state */
#send-chat:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Chat message timestamp small text */
.chat-message .timestamp {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin-top: 6px;
}

/* Additional Enhancements (kept) */
@media (prefers-reduced-motion: reduce) {
    .floating-orb, .particle, .morphing-shape, .holographic {
        animation: none !important;
    }
}

/* Rest of original CSS preserved below (truncated in this view for brevity) */
/* ... all other styles from the original file remain unchanged ... */

/* Focus States for Accessibility */
input:focus, 
select:focus, 
textarea:focus, 
button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .glass-effect {
        background: rgba(0, 0, 0, 0.8);
        border: 2px solid #ffffff;
    }
    
    .cyber-button {
        background: #0066cc;
        border: 2px solid #ffffff;
    }
}

/* ========================
   FORM MESSAGES STYLES
   ======================== */

/* Form validation states */
.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
    animation: shake 0.3s ease-in-out;
}

.input-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2) !important;
}

.error-message {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.error-message:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

.success-message {
    font-size: 0.75rem;
    color: #10b981;
    margin-top: 0.25rem;
}

/* Form messages container animations */
#form-messages {
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Success message styling */
#success-message {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    animation: successPulse 0.5s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Error message styling */
#error-message {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    animation: errorShake 0.5s ease-out;
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Loading button state */
.btn-loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
    overflow: hidden;
}

.btn-loading .btn-text {
    opacity: 0;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Character counter styling */
#char-count {
    transition: color 0.3s ease;
}

/* Focus states for better accessibility */
input:focus, 
select:focus, 
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Improved mobile form styling */
@media (max-width: 768px) {
    .error-message {
        font-size: 0.7rem;
    }
    
    #form-messages {
        margin-top: 1rem;
    }
    
    .grid.md\\:grid-cols-2 {
        gap: 1rem;
    }
    
    input, select, textarea {
        padding: 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Enhanced form field styling */
input, select, textarea {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:hover, select:hover, textarea:hover {
    border-color: rgba(59, 130, 246, 0.5);
}

/* Placeholder styling improvements */
::placeholder {
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.3s ease;
}

input:focus::placeholder,
textarea:focus::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Select dropdown improvements */
select option {
    background-color: #1a1a1a;
    color: white;
    padding: 0.5rem;
}

select option:hover {
    background-color: #2563eb;
}

/* Form container enhancements */
.glass-effect form {
    position: relative;
}

/* Progress indicator for form completion */
.form-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
}

/* Validation icons */
.field-icon {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.input-success + .field-icon.success {
    opacity: 1;
    color: #10b981;
}

.input-error + .field-icon.error {
    opacity: 1;
    color: #ef4444;
}

/* Tooltip styling for validation messages */
.validation-tooltip {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 10;
}

.validation-tooltip:before {
    content: '';
    position: absolute;
    top: 100%;
    left: 1rem;
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.input-error:focus + .validation-tooltip,
.input-success:focus + .validation-tooltip {
    opacity: 1;
    transform: translateY(0);
}

.cyber-button:active {
    transform: translateY(1px) scale(0.98);
}