/* Força tema escuro para barras de navegação do sistema */
:root {
    color-scheme: dark;
}

html, body {
    color-scheme: dark;
    background-color: #0f172a; /* slate-950 - cor sólida para o navegador detectar */
}

/* Safe Area padding para dispositivos com notch/gestos */
.pb-safe {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.pt-safe {
    padding-top: env(safe-area-inset-top, 0px);
}

.px-safe {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

/* Tailwind Custom Animations */
@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(139, 92, 246, 0.5); }
    100% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.8), 0 0 30px rgba(139, 92, 246, 0.4); }
}

/* Utility classes for animations */
.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-up {
    animation: slideUp 0.3s ease-out;
}

.animate-float {
    animation: float 2.5s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite alternate;
}

.animate-spin-slow {
    animation: spin 3s linear infinite;
}

/* Custom Scrollbar Styling */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(88, 28, 135, 0.2);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    border-radius: 4px;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #7c3aed, #9333ea);
}

.custom-scrollbar::-webkit-scrollbar-thumb:active {
    background: linear-gradient(135deg, #6d28d9, #7e22ce);
}

/* Firefox Scrollbar */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #8b5cf6 rgba(88, 28, 135, 0.2);
}

/* Thin Scrollbar Variant */
.thin-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.thin-scrollbar::-webkit-scrollbar-track {
    background: rgba(31, 41, 55, 0.4);
    border-radius: 3px;
}

.thin-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #a855f7, #c084fc);
    border-radius: 3px;
}

.thin-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #9333ea, #a855f7);
}

.thin-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #a855f7 rgba(31, 41, 55, 0.4);
}

/* Logo Container */
.logo-icon {
    position: relative;
    display: inline-block;
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.4));
}

.tech-grid {
    background-image: 
        linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Glass morphism effect */
.glass {
    background: rgba(139, 92, 246, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Dark Glass Effect */
.dark-glass {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animated Gradient Borders */
.animated-border {
    position: relative;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(24px);
}

.animated-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6, #06b6d4, #10b981, #f59e0b, #ef4444);
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    animation: rotateBorder 4s linear infinite;
    background-size: 300% 300%;
}

@keyframes rotateBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Animated Purple Border */
.purple-border {
    position: relative;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(24px);
}

.purple-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    background: linear-gradient(45deg, #8b5cf6, #a855f7, #c084fc, #ddd6fe);
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    animation: rotateBorder 3s linear infinite;
    background-size: 200% 200%;
}

/* Animated Blue Border */
.blue-border {
    position: relative;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(24px);
}

.blue-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    background: linear-gradient(45deg, #3b82f6, #06b6d4, #0ea5e9, #60a5fa);
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    animation: rotateBorder 3.5s linear infinite;
    background-size: 200% 200%;
}

/* Animated Yellow Border */
.yellow-border {
    position: relative;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(24px);
}

.yellow-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    background: linear-gradient(45deg, #f59e0b, #fbbf24, #fcd34d, #fde047);
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    animation: rotateBorder 2.8s linear infinite;
    background-size: 200% 200%;
}

/* Accessibility - Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only.focus\:not-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Focus visible improvements */
*:focus-visible {
    outline: 2px solid #a855f7;
    outline-offset: 2px;
}

button:focus-visible {
    outline: 2px solid #a855f7;
    outline-offset: 2px;
}

input:focus-visible,
textarea:focus-visible {
    outline: none;
    border-color: #a855f7;
    ring: 2px solid rgba(168, 85, 247, 0.2);
}

/* Loading spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* FAB Bubble Animation */
@keyframes bubble {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.15);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.fab-bubble {
    animation: bubble 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.fab-bubble-delay {
    animation: bubble 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards;
    opacity: 0; /* Começa invisível, animação define opacidade final */
}