/* RUANTECH V2.0 - CSS Principal (Sem Media Queries Responsivas) */

/* CSS Custom Properties para Temas */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111827;
    --bg-glass: #111827;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --accent-primary: #7c3aed;
    --accent-secondary: #8b5cf6;
    --gradient-main: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
    --glow-color: rgba(124, 58, 237, 0.5);
    --border-glass: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] {
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --bg-glass: #ffffff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --accent-primary: #7c3aed;
    --accent-secondary: #8b5cf6;
    --gradient-main: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
    --glow-color: rgba(124, 58, 237, 0.3);
    --border-glass: rgba(0, 0, 0, 0.1);
}

[data-theme="cyberpunk"] {
    --bg-primary: #0d0208;
    --bg-secondary: #1a0e1a;
    --bg-glass: rgba(26, 14, 26, 0.8);
    --text-primary: #00ff00;
    --text-secondary: #ff00ff;
    --accent-primary: #00ff00;
    --accent-secondary: #ff00ff;
    --gradient-main: linear-gradient(135deg, #00ff00 0%, #ff00ff 100%);
    --glow-color: rgba(0, 255, 0, 0.6);
    --border-glass: rgba(0, 255, 0, 0.2);
}
/* Otimização: Remover blur dos fundos dos títulos em mobile */
@media (max-width: 639px) {
    .service-category > .text-center > .absolute {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

/* Glassmorphism Effects */
.glass {
    background: #111827 !important;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
}

.glass-hover {
    will-change: transform;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.glass-hover:hover {
    background: #1f2937 !important;
    border-color: var(--accent-primary);
    box-shadow: 0 20px 64px rgba(124, 58, 237, 0.3);
    transform: translateY(-4px);
}

/* Service Nodes */
.service-node {
    will-change: transform;
    background: #111827 !important;
    border: 1px solid rgba(124, 58, 237, 0.3);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.service-node:hover {
    transform: translateY(-8px) scale(1.05);
    border-color: var(--accent-primary);
    background: #1f2937 !important;
    box-shadow: 
        0 25px 50px rgba(124, 58, 237, 0.4),
        0 0 0 1px rgba(124, 58, 237, 0.5);
}

.service-node::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.2), transparent);
    transition: left 0.5s;
}

.service-node:hover::before {
    left: 100%;
}

/* Node Effects */
.node {
    position: relative;
    z-index: 10;
    overflow: hidden;
}

/* Service Icons */
.service-icon {
    will-change: transform;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.service-node:hover .service-icon {
    transform: scale(1.2) rotateY(360deg);
    box-shadow: 0 0 30px var(--glow-color);
}

/* Demo Badge */
.demo-badge {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    animation: demo-glow 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.5);
}

@keyframes demo-glow {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(249, 115, 22, 0.5);
    }
    50% { 
        box-shadow: 0 0 20px rgba(249, 115, 22, 0.8);
    }
}

/* Responsive Text */
.responsive-text {
    font-size: clamp(0.875rem, 2.5vw, 1.125rem);
}

.responsive-title {
    font-size: clamp(2rem, 5vw, 4rem);
}

/* Performance Optimizations */
.gpu-optimization {
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
}

/* Touch friendly targets */
.touch-friendly {
    min-height: 44px;
    min-width: 44px;
}

/* Touch manipulation for better mobile interaction */
.touch-manipulation {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* FAB Responsive Styles */
#fab-menu {
    /* Garantir que sempre fique visível na tela */
    max-width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
}

#fab-main {
    /* Melhor área de toque para mobile */
    min-width: 44px;
    min-height: 44px;
    position: relative;
    z-index: 31;
}

#fab-options {
    /* Prevenir overflow em telas pequenas */
    max-width: calc(100vw - 2rem);
    max-height: calc(70vh);
    overflow-y: auto;
    padding: 0.25rem;
    
    /* Backdrop para melhor visibilidade */
    backdrop-filter: blur(4px);
    border-radius: 0.75rem;
    background: rgba(17, 24, 39, 0.1);
}

.fab-option {
    /* Área de toque adequada para mobile */
    min-width: 40px;
    min-height: 40px;
    position: relative;
    backdrop-filter: blur(8px);
}

/* Responsive breakpoints específicos para FAB */
@media (max-width: 374px) {
    /* Telas muito pequenas (iPhone SE, etc.) */
    #fab-main {
        width: 2.5rem !important;
        height: 2.5rem !important;
        font-size: 0.875rem !important;
    }
    
    .fab-option {
        width: 2rem !important;
        height: 2rem !important;
        font-size: 0.75rem !important;
    }
    
    #fab-options {
        bottom: calc(100% + 0.25rem) !important;
    }
    
    #fab-options .fab-option + .fab-option {
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    /* Mobile portrait */
    #fab-menu {
        right: clamp(0.5rem, 3vw, 1rem) !important;
        bottom: clamp(0.5rem, 3vh, 1rem) !important;
    }
    
    #fab-options {
        max-height: 60vh;
    }
}

@media (max-height: 600px) {
    /* Dispositivos com altura reduzida */
    #fab-options {
        max-height: 50vh;
        overflow-y: auto;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    /* Landscape em mobile */
    #fab-menu {
        right: clamp(0.5rem, 2vw, 1rem) !important;
        bottom: clamp(0.5rem, 5vh, 1rem) !important;
    }
    
    #fab-options {
        max-height: 40vh;
        flex-direction: row;
        flex-wrap: wrap;
        bottom: auto;
        top: 50%;
        transform: translateY(-50%);
        right: calc(100% + 0.5rem);
        gap: 0.5rem;
    }
}

/* Animações otimizadas para performance */
@media (prefers-reduced-motion: no-preference) {
    #fab-main {
        transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                    box-shadow 0.3s ease,
                    background-color 0.2s ease;
    }
    
    .fab-option {
        transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1),
                    background-color 0.2s ease,
                    box-shadow 0.2s ease;
    }
}

/* Estados de hover/focus melhorados */
#fab-main:hover, #fab-main:focus-visible {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

.fab-option:hover, .fab-option:focus-visible {
    transform: scale(1.1);
}

#fab-main:active {
    transform: scale(0.95);
}

.fab-option:active {
    transform: scale(0.9);
}

/* Focus styles para acessibilidade */
#fab-main:focus-visible,
.fab-option:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    #fab-main,
    .fab-option {
        border: 2px solid #ffffff !important;
    }
    
    #fab-options {
        background: rgba(0, 0, 0, 0.9) !important;
        border: 1px solid #ffffff;
    }
}

/* Header */
header {
    max-width: 100vw;
    overflow: hidden;
}

header nav {
    max-width: 100%;
    overflow: hidden;
}

/* Tagline única */
.tagline-unique {
    display: inline !important;
    color: #9ca3af !important;
    font-size: clamp(0.625rem, 1.5vw, 0.75rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: clamp(100px, 25vw, 200px);
}

/* Modal Styles */
.modal {
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(124, 58, 237, 0.3);
    backdrop-filter: blur(20px);
}

/* Particle System */
.particle {
    position: absolute;
    background: var(--accent-primary);
    border-radius: 50%;
    pointer-events: none;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Connection Lines - Versão Otimizada */
.connection-line {
    stroke: var(--accent-primary);
    stroke-width: 2;
    fill: none;
    opacity: 0.6;
    transition: stroke-width 0.3s ease, opacity 0.3s ease;
    will-change: stroke-width, opacity;
}

.connection-line.active {
    stroke-width: 4;
    opacity: 1;
    filter: drop-shadow(0 0 6px var(--accent-primary));
    animation: optimized-pulse 2s ease-in-out;
}

/* Animação otimizada de pulso */
@keyframes optimized-pulse {
    0% { 
        stroke-width: 2;
        opacity: 0.6;
    }
    50% { 
        stroke-width: 4;
        opacity: 1;
    }
    100% { 
        stroke-width: 2;
        opacity: 0.6;
    }
}

/* Animação de dados correndo - mais suave */
.connection-line.flowing {
    stroke-dasharray: 20 10;
    animation: smooth-data-flow 2.5s linear;
}

@keyframes smooth-data-flow {
    0% {
        stroke-dashoffset: 1000;
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 0.6;
    }
}

@keyframes pulse-connection {
    0%, 100% { 
        stroke-opacity: 0.4;
        stroke-width: 2;
    }
    50% { 
        stroke-opacity: 0.8;
        stroke-width: 3;
    }
}

@keyframes glow-connection {
    0%, 100% { 
        filter: drop-shadow(0 0 3px var(--accent-primary));
    }
    50% { 
        filter: drop-shadow(0 0 8px var(--accent-primary)) drop-shadow(0 0 15px var(--accent-primary));
    }
}

@keyframes connection-pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.5);
        opacity: 0.7;
    }
}

/* Partículas de energia nas linhas */
.energy-particle {
    position: absolute;
    width: 3px;
    height: 12px;
    background: linear-gradient(to bottom, transparent, var(--accent-primary), transparent);
    border-radius: 50%;
    animation: energy-flow 1.8s linear infinite;
    pointer-events: none;
    z-index: 6;
}

@keyframes energy-flow {
    0% { 
        opacity: 0;
        transform: translateX(-20px) rotate(0deg);
    }
    20% { 
        opacity: 1;
        transform: translateX(0px) rotate(90deg);
    }
    80% { 
        opacity: 1;
        transform: translateX(calc(100% + 20px)) rotate(270deg);
    }
    100% { 
        opacity: 0;
        transform: translateX(calc(100% + 40px)) rotate(360deg);
    }
}

/* Partículas de dados nas linhas */
.data-particle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: linear-gradient(45deg, #00ff88, #00ccff);
    border-radius: 50%;
    box-shadow: 
        0 0 15px currentColor, 
        0 0 30px rgba(0, 255, 136, 0.8),
        0 0 45px rgba(0, 255, 136, 0.4);
    pointer-events: none;
    z-index: 15;
    transition: all 0.1s ease-out;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.data-particle.fast {
    background: linear-gradient(45deg, #ffaa00, #ff6600);
    box-shadow: 
        0 0 20px currentColor, 
        0 0 40px rgba(255, 170, 0, 0.8),
        0 0 60px rgba(255, 170, 0, 0.4);
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.9);
}

.data-particle.from-hub {
    background: linear-gradient(45deg, #7c3aed, #3b82f6);
    box-shadow: 
        0 0 25px #7c3aed, 
        0 0 50px rgba(124, 58, 237, 0.8),
        0 0 75px rgba(124, 58, 237, 0.4);
    animation: hub-pulse 0.3s ease-out;
    width: 14px;
    height: 14px;
}

.data-particle.from-hub.fast {
    background: linear-gradient(45deg, #f59e0b, #ef4444);
    box-shadow: 
        0 0 30px #f59e0b, 
        0 0 60px rgba(245, 158, 11, 0.8),
        0 0 90px rgba(245, 158, 11, 0.4);
    animation: hub-pulse-fast 0.2s ease-out;
    width: 18px;
    height: 18px;
}

.data-particle::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.data-particle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.4;
        animation: particle-ring 1.5s ease-out infinite;
}

@keyframes hub-pulse {
    0% { 
        transform: scale(0.5);
        opacity: 0;
    }
    50% { 
        transform: scale(1.5);
        opacity: 1;
    }
    100% { 
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes hub-pulse-fast {
    0% { 
        transform: scale(0.3);
        opacity: 0;
    }
    50% { 
        transform: scale(2);
        opacity: 1;
    }
    100% { 
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes particle-ring {
    0% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    100% { 
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}@keyframes particle-flow {
    0% { 
        opacity: 0;
        transform: translateX(0) scale(0.5);
    }
    10% { 
        opacity: 1;
        transform: translateX(10px) scale(1);
    }
    90% { 
        opacity: 1;
        transform: translateX(calc(100% - 10px)) scale(1);
    }
    100% { 
        opacity: 0;
        transform: translateX(100%) scale(0.5);
    }
}

@keyframes particle-flow-fast {
    0% { 
        opacity: 0;
        transform: translateX(0) scale(0.3);
        filter: brightness(1);
    }
    15% { 
        opacity: 1;
        transform: translateX(15px) scale(1.2);
        filter: brightness(1.5);
    }
    85% { 
        opacity: 1;
        transform: translateX(calc(100% - 15px)) scale(1.2);
        filter: brightness(1.5);
    }
    100% { 
        opacity: 0;
        transform: translateX(100%) scale(0.3);
        filter: brightness(1);
    }
}

/* Efeitos especiais para conexões ativas */
.connection-line.active {
    stroke-width: 3;
    opacity: 1;
    stroke-dasharray: 15 8;
    animation: data-flow-fast 1.5s linear infinite, glow-connection 2s ease-in-out infinite;
    filter: drop-shadow(0 0 4px var(--accent-primary));
}

.connection-line.active::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-primary);
    animation: connection-pulse 1s ease-in-out infinite;
}

/* Loading States */
.skeleton {
    background: linear-gradient(
        90deg,
        transparent 25%,
        rgba(124, 58, 237, 0.1) 50%,
        transparent 75%
    );
    background-size: 400% 100%;
    animation: skeleton-loading 2s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Animations */
.animate-fade-in-up {
    animation: fade-in-up 0.6s ease-out;
}

@keyframes fade-in-up {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.animate-slide-in {
    animation: slide-in 0.8s ease-out;
}

@keyframes slide-in {
    0% { opacity: 0; transform: translateX(-50px); }
    100% { opacity: 1; transform: translateX(0); }
}

.animate-bounce-in {
    animation: bounce-in 0.6s ease-out;
}

@keyframes bounce-in {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.animate-scale-pulse {
    animation: scale-pulse 0.6s ease-out;
}

@keyframes scale-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Utility Classes */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.gradient-text {
    background: var(--gradient-main);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

/* Accessibility - manter apenas essas media queries */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .service-node::before,
    .particle {
        animation: none !important;
    }
}

@media (prefers-contrast: high) {
    .glass {
        background: rgba(0, 0, 0, 0.9) !important;
        border: 2px solid #ffffff !important;
    }
    
    .service-node {
        border: 2px solid var(--accent-primary) !important;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

/* Print Styles */
@media print {
    .no-print { 
        display: none !important; 
    }
    
    .glass { 
        background: white !important;
        color: black !important;
        border: 1px solid #ccc !important;
    }
    
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* === OTIMIZAÇÕES DE PERFORMANCE PARA CONEXÕES === */

/* Otimizações Mobile */
@media (max-width: 768px) {
    .connection-line {
        will-change: opacity;
        stroke-width: 1.5;
    }
    
    .connection-line.active {
        stroke-width: 2.5;
        animation: mobile-pulse 1.5s ease-in-out;
        filter: none; /* Remove drop-shadow para performance */
    }
    
    @keyframes mobile-pulse {
        0%, 100% { opacity: 0.6; }
        50% { opacity: 1; }
    }
}

/* Reduzir animações para usuários que preferem menos movimento */
@media (prefers-reduced-motion: reduce) {
    .connection-line,
    .connection-line.active,
    .connection-line.flowing {
        animation: none !important;
        transition: opacity 0.3s ease;
    }
}

/* Otimizações para telas muito pequenas */
@media (max-width: 480px) {
    .connection-line {
        stroke-width: 1;
    }
    
    .connection-line.active {
        stroke-width: 2;
        filter: none;
    }
}