/* ========================================
   CONFIGURAÇÃO DO TAILWIND CSS
   ======================================== */

/* Configuração do Tailwind via JavaScript será movida para um arquivo separado */


/* ========================================
   ESTILOS CUSTOMIZADOS
   ======================================== */

/* Gradientes de Fundo */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dark .gradient-bg {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* ========================================
   BENTO GRID LAYOUT
   ======================================== */

/* Bento Grid Container */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto auto;
    gap: 1.5rem;
    grid-auto-flow: dense;
    width: 100%;
    overflow: hidden;
}

/* Bento Grid Items */
.bento-item {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0; /* Prevent overflow */
    overflow: hidden;
}

.bento-large {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-medium {
    grid-column: span 2;
    grid-row: span 1;
}

.bento-small {
    grid-column: span 1;
    grid-row: span 1;
}

/* Responsive Bento Grid */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bento-large {
        grid-column: span 2;
        grid-row: span 1;
    }
    
    .bento-medium {
        grid-column: span 1;
        grid-row: span 1;
    }
}

@media (max-width: 640px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    
    .bento-large,
    .bento-medium,
    .bento-small {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* ========================================
   3D TECH CUBE
   ======================================== */

.tech-cube-container {
    perspective: 1000px;
    width: min(200px, 80vw);
    height: min(200px, 80vw);
    margin: 0 auto;
    max-width: 100%;
    overflow: visible;
}

.tech-cube {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: cube-rotate 20s infinite linear;
    transition: transform 0.3s ease;
}

.tech-cube:hover {
    animation-play-state: paused;
}

.tech-cube.manual-control {
    animation: none;
}

.tech-face {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(2rem, 4vw, 3rem);
}

.tech-face-front  { transform: rotateY(0deg) translateZ(min(100px, 40vw)); }
.tech-face-back   { transform: rotateY(180deg) translateZ(min(100px, 40vw)); }
.tech-face-right  { transform: rotateY(90deg) translateZ(min(100px, 40vw)); }
.tech-face-left   { transform: rotateY(-90deg) translateZ(min(100px, 40vw)); }
.tech-face-top    { transform: rotateX(90deg) translateZ(min(100px, 40vw)); }
.tech-face-bottom { transform: rotateX(-90deg) translateZ(min(100px, 40vw)); }

/* Floating Tech Icons */
.floating-tech {
    animation: floating-tech 6s ease-in-out infinite;
}

/* ========================================
   ENHANCED ANIMATIONS
   ======================================== */

@keyframes cube-rotate {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    25% { transform: rotateX(90deg) rotateY(90deg); }
    50% { transform: rotateX(180deg) rotateY(180deg); }
    75% { transform: rotateX(270deg) rotateY(270deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

@keyframes floating-tech {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(120deg); }
    66% { transform: translateY(-10px) rotate(240deg); }
}

/* Scroll Dot Animation */
.scroll-dot {
    animation: scroll-dot 2s infinite;
}

@keyframes scroll-dot {
    0% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(100%); opacity: 0; }
    51% { transform: translateY(-100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Line Clamp Utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* General text overflow prevention */
.break-words {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Enhanced text overflow prevention for all elements */
* {
    box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6, p, span, div, a {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

/* Prevent horizontal overflow */
body, html {
    overflow-x: hidden;
    max-width: 100%;
}

/* Ensure containers don't overflow */
.container, .max-w-6xl, .max-w-4xl, .max-w-7xl {
    max-width: 100%;
    overflow-x: hidden;
}

/* Container constraints and centering */
.container {
    max-width: 100%;
    overflow-x: hidden;
    margin: 0 auto;
}

/* Global centering for all sections */
section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Specific content centering */
.section-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Project card specific fixes */
.project-card h3 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.project-card p {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ========================================
   COSMIC PARTICLES FOR HERO
   ======================================== */

.cosmic-particles-hero {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

/* ========================================
   BACKGROUND CÓSMICO
   ======================================== */

/* Container do background cósmico */
.cosmic-bg {
    position: relative;
    overflow: hidden;
}

.cosmic-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(2px 2px at 20px 30px, #ffffff, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #ffffff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #ffffff, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: cosmic-drift 20s linear infinite;
    opacity: 0.3;
    z-index: 0;
}

.dark .cosmic-bg::before {
    opacity: 0.4;
}

/* Estrelas brilhantes */
.cosmic-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(3px 3px at 50px 50px, #ffffff, transparent),
        radial-gradient(2px 2px at 150px 20px, #ffffff, transparent),
        radial-gradient(2px 2px at 250px 90px, #ffffff, transparent),
        radial-gradient(1px 1px at 350px 40px, #ffffff, transparent),
        radial-gradient(3px 3px at 450px 70px, #ffffff, transparent),
        radial-gradient(2px 2px at 550px 30px, #ffffff, transparent),
        radial-gradient(1px 1px at 650px 80px, #ffffff, transparent),
        radial-gradient(2px 2px at 750px 50px, #ffffff, transparent);
    background-repeat: repeat;
    background-size: 300px 150px;
    animation: cosmic-twinkle 8s ease-in-out infinite;
    opacity: 0.2;
    z-index: 0;
}

.dark .cosmic-bg::after {
    opacity: 0.3;
}

/* Nebulosas sutis */
.cosmic-nebula {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse 200px 100px at 20% 30%, rgba(102, 126, 234, 0.1), transparent),
        radial-gradient(ellipse 150px 80px at 80% 70%, rgba(139, 92, 246, 0.1), transparent),
        radial-gradient(ellipse 180px 90px at 50% 80%, rgba(6, 182, 212, 0.1), transparent);
    animation: nebula-float 15s ease-in-out infinite;
    z-index: 0;
}

/* Partículas flutuantes cósmicas */
.cosmic-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.cosmic-particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: cosmic-float 12s ease-in-out infinite;
}

.cosmic-particle:nth-child(1) { width: 2px; height: 2px; left: 10%; animation-delay: 0s; }
.cosmic-particle:nth-child(2) { width: 1px; height: 1px; left: 20%; animation-delay: 2s; }
.cosmic-particle:nth-child(3) { width: 3px; height: 3px; left: 30%; animation-delay: 4s; }
.cosmic-particle:nth-child(4) { width: 1px; height: 1px; left: 40%; animation-delay: 6s; }
.cosmic-particle:nth-child(5) { width: 2px; height: 2px; left: 50%; animation-delay: 8s; }
.cosmic-particle:nth-child(6) { width: 1px; height: 1px; left: 60%; animation-delay: 10s; }
.cosmic-particle:nth-child(7) { width: 3px; height: 3px; left: 70%; animation-delay: 12s; }
.cosmic-particle:nth-child(8) { width: 1px; height: 1px; left: 80%; animation-delay: 14s; }
.cosmic-particle:nth-child(9) { width: 2px; height: 2px; left: 90%; animation-delay: 16s; }

/* Z-index para conteúdo */
.cosmic-content {
    position: relative;
    z-index: 1;
}

/* ========================================
   ANIMAÇÕES CÓSMICAS
   ======================================== */

@keyframes cosmic-drift {
    0% { transform: translateX(0px) translateY(0px); }
    100% { transform: translateX(-200px) translateY(-100px); }
}

@keyframes cosmic-twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.4; }
}

@keyframes nebula-float {
    0%, 100% { transform: translateX(0px) translateY(0px) scale(1); }
    33% { transform: translateX(20px) translateY(-10px) scale(1.1); }
    66% { transform: translateX(-15px) translateY(15px) scale(0.9); }
}

@keyframes cosmic-float {
    0%, 100% { 
        transform: translateY(0px) translateX(0px);
        opacity: 0.6;
    }
    25% { 
        transform: translateY(-20px) translateX(10px);
        opacity: 1;
    }
    50% { 
        transform: translateY(-40px) translateX(-5px);
        opacity: 0.8;
    }
    75% { 
        transform: translateY(-20px) translateX(-15px);
        opacity: 1;
    }
}

/* Cards de Tecnologia */
.tech-card {
    transition: all 0.3s ease;
}

.tech-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.dark .tech-card:hover {
    box-shadow: 0 20px 40px rgba(255, 255, 255, 0.1);
}

/* Cards de Projeto */
.project-card {
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.dark .project-card:hover {
    box-shadow: 0 15px 30px rgba(255, 255, 255, 0.1);
}

/* Efeito Typewriter */
.typewriter {
    overflow: hidden;
    border-right: 2px solid;
    white-space: nowrap;
    animation: typewriter 3s steps(40) 1s 1 normal both, blink 1s infinite;
}

/* Indicador de Scroll */
.scroll-indicator {
    animation: bounce 2s infinite;
}

/* ========================================
   NOVOS EFEITOS MODERNOS
   ======================================== */

/* Efeito de Partículas Flutuantes */
.floating-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) { width: 4px; height: 4px; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { width: 6px; height: 6px; left: 20%; animation-delay: 1s; }
.particle:nth-child(3) { width: 3px; height: 3px; left: 30%; animation-delay: 2s; }
.particle:nth-child(4) { width: 5px; height: 5px; left: 40%; animation-delay: 3s; }
.particle:nth-child(5) { width: 4px; height: 4px; left: 50%; animation-delay: 4s; }
.particle:nth-child(6) { width: 6px; height: 6px; left: 60%; animation-delay: 5s; }
.particle:nth-child(7) { width: 3px; height: 3px; left: 70%; animation-delay: 6s; }
.particle:nth-child(8) { width: 5px; height: 5px; left: 80%; animation-delay: 7s; }
.particle:nth-child(9) { width: 4px; height: 4px; left: 90%; animation-delay: 8s; }

/* Efeito de Glow nos Cards */
.glow-effect {
    position: relative;
    overflow: hidden;
}

.glow-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.glow-effect:hover::before {
    left: 100%;
}

/* Efeito de Morphing Background */
.morphing-bg {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 400% 400%;
    animation: morphing 15s ease infinite;
}

@keyframes morphing {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Efeito de Glassmorphism */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.dark .glass-effect {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Efeito de Texto Neon */
.neon-text {
    text-shadow: 0 0 2px currentColor, 0 0 4px currentColor, 0 0 6px currentColor;
    animation: neon-pulse 3s ease-in-out infinite alternate;
}

@keyframes neon-pulse {
    from { text-shadow: 0 0 2px currentColor, 0 0 4px currentColor, 0 0 6px currentColor; }
    to { text-shadow: 0 0 4px currentColor, 0 0 8px currentColor, 0 0 12px currentColor; }
}

/* Efeito de Hover 3D */
.hover-3d {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.hover-3d:hover {
    transform: rotateX(10deg) rotateY(10deg) scale(1.05);
}

/* Efeito de Loading Progressivo */
.progressive-load {
    opacity: 0;
    transform: translateY(30px);
    animation: progressive-load 0.8s ease forwards;
}

.progressive-load:nth-child(1) { animation-delay: 0.1s; }
.progressive-load:nth-child(2) { animation-delay: 0.2s; }
.progressive-load:nth-child(3) { animation-delay: 0.3s; }
.progressive-load:nth-child(4) { animation-delay: 0.4s; }
.progressive-load:nth-child(5) { animation-delay: 0.5s; }
.progressive-load:nth-child(6) { animation-delay: 0.6s; }

/* Efeito de Scroll Reveal */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Efeito de Magnetic Hover */
.magnetic-hover {
    transition: transform 0.3s ease;
}

/* Efeito de Ripple */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple-effect:active::after {
    width: 300px;
    height: 300px;
}

/* Efeito de Gradient Text */
.gradient-text {
    background: linear-gradient(45deg, #3b82f6, #8b5cf6, #06b6d4);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 6s ease infinite;
    opacity: 1;
    /* Fix for text clipping issues */
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Ensure proper spacing to prevent clipping */
    padding: 0.1em 0.1em 0.15em 0.1em !important; /* Extra bottom padding for descenders */
    margin: 0 -0.1em;
    display: inline-block;
    overflow: visible !important;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Efeito de Floating Animation */
.floating {
    animation: floating 3s ease-in-out infinite;
}

.floating-delayed {
    animation: floating 3s ease-in-out infinite;
    animation-delay: 1.5s;
}

/* Efeito de Shimmer */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

/* Efeito de Pulse Glow */
.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Efeito de Stagger Animation */
.stagger-animation > * {
    opacity: 0;
    transform: translateY(20px);
    animation: stagger-fade 0.6s ease forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }

/* ========================================
   ANIMAÇÕES CSS
   ======================================== */

/* Fade In */
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Slide Up */
@keyframes slideUp {
    0% { transform: translateY(50px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Slide In Left */
@keyframes slideInLeft {
    0% { transform: translateX(-100px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

/* Slide In Right */
@keyframes slideInRight {
    0% { transform: translateX(100px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

/* Slide Down */
@keyframes slideDown {
    0% { transform: translateY(-100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Bounce In */
@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* Typewriter */
@keyframes typewriter {
    0% { width: 0; }
    100% { width: 100%; }
}

/* Blink */
@keyframes blink {
    0%, 50% { borderColor: transparent; }
    51%, 100% { borderColor: currentColor; }
}

/* Bounce */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Spin */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Float */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Progressive Load */
@keyframes progressive-load {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger Fade */
@keyframes stagger-fade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shimmer */
@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Pulse Glow */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(102, 126, 234, 0.5); }
    50% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.8), 0 0 30px rgba(102, 126, 234, 0.6); }
}

/* ========================================
   LOADER/SPINNER
   ======================================== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #3b82f6;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ========================================
   BOTÃO WHATSAPP
   ======================================== */
.whatsapp-button {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.whatsapp-button:hover {
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

/* Animação de pulso personalizada para WhatsApp */
@keyframes whatsapp-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.whatsapp-button .animate-ping {
    animation: whatsapp-pulse 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Ajustes do modo escuro para WhatsApp */
.dark .whatsapp-button .bg-gray-900 {
    background-color: #1f2937;
}

.dark .whatsapp-button .border-l-gray-900 {
    border-left-color: #1f2937;
}

/* ========================================
   CARROSSEL
   ======================================== */
.carousel-slide {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
}

.carousel-slide.active {
    display: block;
    position: relative;
    min-height: auto;
}

.carousel-dot.active {
    background-color: #3b82f6;
}

.dark .carousel-dot.active {
    background-color: #60a5fa;
}

.carousel-nav {
    z-index: 10;
}

.carousel-nav:hover {
    transform: scale(1.1);
    background-color: #f8fafc;
}

.dark .carousel-nav:hover {
    background-color: #374151;
}

/* ========================================
   DROPDOWN DE IDIOMA
   ======================================== */
.language-dropdown {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease-in-out;
    pointer-events: none;
    visibility: hidden;
    z-index: 999999 !important;
    position: fixed !important;
}

.language-dropdown.show {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

/* Controle específico do dropdown */
#language-dropdown {
    z-index: 999999 !important;
    position: fixed !important;
}

#language-dropdown.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#language-dropdown.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.language-option {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.language-option:hover {
    background-color: #f3f4f6;
}

.dark .language-option:hover {
    background-color: #374151;
}

/* ========================================
   CLASSES DE ANIMAÇÃO UTILITÁRIAS
   ======================================== */
.animate-fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

.animate-slide-up {
    animation: slideUp 0.8s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out;
}

.animate-bounce-in {
    animation: bounceIn 0.8s ease-out;
}

.animate-typewriter {
    animation: typewriter 3s steps(40) 1s 1 normal both;
}

.animate-blink {
    animation: blink 1s infinite;
}

.animate-slide-down {
    animation: slideDown 0.3s ease-out;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ========================================
   HEADER STYLES - OPTIMIZED FOR MOBILE
   ======================================== */

/* HEADER LAYOUT - Simple and Working */
header .flex.items-center.justify-between {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
}

/* Name on left - ALL SCREENS */
header .text-2xl.font-bold,
header .text-2xl {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    text-align: left !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: ellipsis !important;
    color: inherit !important;
}

/* Icons on right */
header .flex.items-center.space-x-2 {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

/* MOBILE-FIRST HEADER BUTTONS - Better UX */
#language-toggle,
#theme-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 44px !important;  /* iOS/Android touch target minimum */
    min-height: 44px !important;
    border-radius: 12px !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
    position: relative !important;
    background: rgba(156, 163, 175, 0.1) !important;
    border: 1px solid rgba(156, 163, 175, 0.2) !important;
}

#language-toggle:hover,
#theme-toggle:hover {
    background: rgba(156, 163, 175, 0.15) !important;
    transform: scale(1.05) !important;
}

/* Dark mode styles */
.dark #language-toggle,
.dark #theme-toggle {
    background: rgba(75, 85, 99, 0.3) !important;
    border: 1px solid rgba(75, 85, 99, 0.4) !important;
}

.dark #language-toggle:hover,
.dark #theme-toggle:hover {
    background: rgba(75, 85, 99, 0.4) !important;
}

/* Language toggle specific styling */
#language-toggle {
    gap: 0.25rem !important;
    width: auto !important; /* Allow width to adjust for text on desktop */
    min-width: 2.5rem !important;
}

/* DESKTOP ENHANCEMENTS - Better proportions and text handling */
@media (min-width: 640px) {
    /* Allow language button to expand for text */
    #language-toggle {
        width: auto !important;
        padding: 0 12px !important;
        min-width: 44px !important;
        height: 44px !important;
        gap: 6px !important;
    }
    
    /* Desktop theme button - perfect square */
    #theme-toggle {
        width: 44px !important;
        height: 44px !important;
        padding: 0 !important;
    }
    
    /* Desktop icons - slightly larger for better visibility */
    #language-toggle .fas.fa-globe,
    #theme-toggle .fas.fa-moon,
    #theme-toggle .fas.fa-sun {
        font-size: 20px !important;
        width: 20px !important;
        height: 20px !important;
    }
    
    /* Language text styling */
    #language-toggle #current-lang {
        font-size: 14px !important;
        font-weight: 500 !important;
        letter-spacing: 0.025em !important;
    }
    
    /* Chevron for desktop */
    #language-toggle .fas.fa-chevron-down {
        font-size: 10px !important;
        opacity: 0.7 !important;
    }
}

/* MOBILE-OPTIMIZED ICONS - Better visibility and touch */
#language-toggle .fas.fa-globe,
#theme-toggle .fas.fa-moon,
#theme-toggle .fas.fa-sun {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: rgba(55, 65, 81, 0.8) !important;
    transition: color 0.2s ease !important;
    margin: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
}

/* Dark mode icon colors */
.dark #language-toggle .fas.fa-globe,
.dark #theme-toggle .fas.fa-moon,
.dark #theme-toggle .fas.fa-sun {
    color: rgba(209, 213, 219, 0.9) !important;
}

/* CRITICAL: Remove all margins from ALL icons - force override */
#language-toggle i,
#theme-toggle i,
#language-toggle .fas,
#theme-toggle .fas,
.fas.fa-globe,
.fas.fa-moon,
.fas.fa-sun,
.fas.fa-chevron-down {
    margin: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    vertical-align: baseline !important;
}

/* DARK MODE ICON VISIBILITY - Fix dynamic switching */
/* Light mode: show moon, hide sun */
html:not(.dark) #theme-toggle .fas.fa-moon {
    display: block !important;
}

html:not(.dark) #theme-toggle .fas.fa-sun {
    display: none !important;
}

/* Dark mode: show sun, hide moon */
html.dark #theme-toggle .fas.fa-moon {
    display: none !important;
}

html.dark #theme-toggle .fas.fa-sun {
    display: block !important;
}

/* Override any Tailwind classes that might interfere */
#theme-toggle .dark\\:hidden {
    display: block !important;
}

#theme-toggle .hidden {
    display: none !important;
}

.dark #theme-toggle .dark\\:hidden {
    display: none !important;
}

.dark #theme-toggle .hidden {
    display: block !important;
}

/* Hover states for better feedback */
#language-toggle:hover .fas.fa-globe,
#theme-toggle:hover .fas.fa-moon,
#theme-toggle:hover .fas.fa-sun {
    color: rgba(37, 99, 235, 1) !important;
}

.dark #language-toggle:hover .fas.fa-globe,
.dark #theme-toggle:hover .fas.fa-moon,
.dark #theme-toggle:hover .fas.fa-sun {
    color: rgba(96, 165, 250, 1) !important;
}

/* Chevron stays smaller */
#language-toggle .fas.fa-chevron-down {
    font-size: 12px !important;
    width: 12px !important;
    height: 12px !important;
    line-height: 12px !important;
    text-align: center !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Theme toggle specific styling - force square button */
#theme-toggle {
    width: 2.5rem !important;
    height: 2.5rem !important;
    padding: 0.5rem !important;
}

/* Global header layout enforcement */
@media (max-width: 1024px) {
    header nav .flex.items-center.justify-between {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
    }

    header nav .text-2xl {
        order: 1 !important;
        flex: 1 1 auto !important;
        text-align: left !important;
    }

    header nav .hidden.md\\:flex {
        order: 2 !important;
        flex: 0 1 auto !important;
    }

    header nav .flex.items-center.space-x-2 {
        order: 3 !important;
        flex: 0 0 auto !important;
        margin-left: auto !important;
    }
}

/* ========================================
   DESKTOP STYLES (DEFAULT)
   ======================================== */

/* Desktop container constraints for better UX */
@media (min-width: 769px) {
    /* Desktop content centering - limit width for better readability */
    .container {
        max-width: 1200px !important;
        margin: 0 auto !important;
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
    
    /* Hero section desktop optimization */
    #home .container {
        max-width: 1400px !important;
    }
    
    /* Make DIEGO NOGUEIRA name bigger on desktop */
    #home h1 .gradient-text {
        font-size: 6rem !important; /* Much larger than current xl:text-8xl */
        line-height: 1.1 !important; /* Increased to prevent letter cut-off */
        font-weight: 900 !important;
        letter-spacing: -0.03em !important;
        padding-bottom: 0.1em !important; /* Add padding to prevent descender cut-off */
    }
}

/* Extra large screens - even bigger name */
@media (min-width: 1280px) {
    #home h1 .gradient-text {
        font-size: 7rem !important;
        line-height: 1.05 !important; /* Adjusted to prevent cut-off */
        padding-bottom: 0.1em !important;
    }
}

/* Ultra wide screens - massive name */
@media (min-width: 1536px) {
    #home h1 .gradient-text {
        font-size: 8rem !important;
        line-height: 1.0 !important; /* Adjusted to prevent cut-off */
        padding-bottom: 0.1em !important;
    }
    
    /* All sections use centered containers */
    section .container,
    section .max-w-6xl,
    section .max-w-4xl,
    section .max-w-7xl {
        max-width: 1200px !important;
        margin: 0 auto !important;
        padding-left: 2rem !important;
        padding-right: 2rem !important;
        box-sizing: border-box !important;
    }
    
    /* About section container */
    #about .container {
        max-width: 1100px !important;
    }
    
    /* Projects section container */
    #projects .container {
        max-width: 1300px !important;
    }
    
    /* Tech section container */
    #tech .container {
        max-width: 1100px !important;
    }
    
    /* Contact section container */
    #contact .container {
        max-width: 1000px !important;
    }

/* Desktop WhatsApp button - larger for desktop */
    .whatsapp-button {
        width: 64px !important;
        height: 64px !important;
        bottom: 1.5rem !important;
        right: 1.5rem !important;
    }
    
    .whatsapp-button .relative {
        width: 64px !important;
        height: 64px !important;
    }
    
    .whatsapp-button .bg-green-500 {
        width: 64px !important;
        height: 64px !important;
    }
    
    .whatsapp-button i {
        font-size: 1.75rem !important;
    }
    
    .whatsapp-button .animate-ping {
        width: 64px !important;
        height: 64px !important;
    }
    
    /* Desktop social media - restore original alignment */
    #contact .animate-slide-in-left {
        text-align: center !important;
    }
    
    #contact .space-y-4 {
        align-items: center !important;
        text-align: center !important;
    }
    
    #contact .flex.items-center.space-x-4 {
        justify-content: flex-start !important;
        text-align: left !important;
    }
    
    #contact .flex.items-center.space-x-4 > div:last-child {
        text-align: left !important;
    }
    
    /* Restore desktop typography sizes */
    .text-sm { font-size: 0.875rem; }
    .text-base { font-size: 1rem; }
    .text-lg { font-size: 1.125rem; }
    .text-xl { font-size: 1.25rem; }
    .text-2xl { font-size: 1.5rem; }
    .text-3xl { font-size: 1.875rem; }
    .text-4xl { font-size: 2.25rem; }
    .text-5xl { font-size: 3rem; }
    .text-6xl { font-size: 3.75rem; }
    .text-7xl { font-size: 4.5rem; }
    .text-8xl { font-size: 6rem; }
    
    /* Enhanced stats cards for desktop */
    .bento-medium {
        grid-column: span 2;
        grid-row: span 1;
        min-height: 200px;
    }
    
    /* Stats cards desktop styling */
    .bento-item.bento-medium .text-5xl {
        font-size: 3.5rem;
        font-weight: 900;
        line-height: 1;
    }
    
    .bento-item.bento-medium .text-6xl {
        font-size: 4rem;
        opacity: 0.15;
    }
    
    .bento-item.bento-medium:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    }
}

/* ========================================
   RESPONSIVIDADE ADICIONAL
   ======================================== */

/* ========================================
   MODERN MOBILE NAVIGATION DRAWER
   ======================================== */

/* Mobile Menu Container */
#mobile-menu {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;
}

/* Mobile menu states */
#mobile-menu.active {
    pointer-events: auto !important;
}

#mobile-menu.active .mobile-overlay {
    opacity: 1 !important;
    pointer-events: auto !important;
}

#mobile-menu.active .mobile-drawer {
    transform: translateX(0) !important;
}

/* Modern Slide Animation */
.mobile-drawer {
    will-change: transform;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.mobile-overlay {
    will-change: opacity;
    transition: opacity 0.3s ease-out !important;
}

/* Navigation Link Hover Effects */
.mobile-nav-link {
    position: relative;
    overflow: hidden;
}

.mobile-nav-link::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.5s;
}

.mobile-nav-link:hover::before {
    left: 100%;
}

/* Icon Container Animations */
.mobile-nav-link .w-10 {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-nav-link:hover .w-10 {
    transform: scale(1.1) rotate(5deg);
}

/* Chevron Animation */
.mobile-nav-link .fa-chevron-right {
    transition: all 0.2s ease;
}

.mobile-nav-link:hover .fa-chevron-right {
    transform: translateX(4px);
}

/* Modern Border Gradient */
.border-gradient {
    border-image: linear-gradient(90deg, transparent, rgba(0,0,0,0.1), transparent) 1;
}

.dark .border-gradient {
    border-image: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent) 1;
}

/* Language Toggle Animation */
#mobile-language-toggle {
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#mobile-language-toggle:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3) !important;
}

/* Social Links Pulse Effect */
.mobile-drawer a[href*="github"],
.mobile-drawer a[href*="linkedin"],
.mobile-drawer a[href*="wa.me"] {
    transition: all 0.3s ease;
    position: relative;
}

.mobile-drawer a[href*="github"]:hover,
.mobile-drawer a[href*="linkedin"]:hover,
.mobile-drawer a[href*="wa.me"]:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Stagger Animation for Nav Links */
.mobile-nav-link:nth-child(1) { animation-delay: 0.1s; }
.mobile-nav-link:nth-child(2) { animation-delay: 0.15s; }
.mobile-nav-link:nth-child(3) { animation-delay: 0.2s; }
.mobile-nav-link:nth-child(4) { animation-delay: 0.25s; }
.mobile-nav-link:nth-child(5) { animation-delay: 0.3s; }

/* Mobile Navigation Slide In Animation */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#mobile-menu.active .mobile-nav-link {
    animation: slideInRight 0.4s ease-out forwards;
}

/* Backdrop Blur Enhancement */
.mobile-drawer {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* Modern Glassmorphism Effect */
.mobile-drawer {
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.dark .mobile-drawer {
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Improved Mobile Touch Targets */
@media (max-width: 768px) {
    /* Force main content to center on mobile - EXCLUDE HEADER */
    section:not(#contact):not(header) h1,
    section:not(#contact):not(header) h2,
    section:not(#contact):not(header) h3,
    section:not(#contact):not(header) p,
    section:not(#contact):not(header) div {
        text-align: center !important;
    }

    /* EXCLUDE header from mobile centering */
    header,
    header *,
    header .text-2xl,
    header .text-2xl.font-bold {
        text-align: left !important;
    }
    
    /* Override specific left alignments only where needed */
    .lg\\:text-left {
        text-align: center !important;
    }
    
    /* Hero section specific centering */
    #home * {
        text-align: center !important;
    }
    
    /* About section centering */
    #about .text-center,
    #about .lg\\:text-left {
        text-align: center !important;
    }
    
    /* Projects section centering */
    #projects * {
        text-align: center !important;
    }
    
    /* Tech section centering */
    #tech * {
        text-align: center !important;
    }
    
    /* MOBILE HEADER - FIX OVERFLOW */
    header {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    header .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
        width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    header nav {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    header .flex.items-center.justify-between {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 0.5rem !important;
        flex-wrap: nowrap !important;
        overflow: hidden !important;
    }
    
    /* MOBILE NAME - PREVENT OVERFLOW */
    header .text-2xl {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        text-align: left !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: calc(100vw - 140px) !important; /* Reserve more space for icons */
        min-width: 0 !important;
        flex: 1 1 auto !important;
        font-size: 1.125rem !important;
        font-weight: 700 !important;
        color: inherit !important;
        box-sizing: border-box !important;
    }
    
    /* MOBILE ICONS - FIXED WIDTH */
    header .flex.items-center.space-x-2 {
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: fit-content !important;
        max-width: 120px !important;
    }

    /* MOBILE HEADER OPTIMIZATION - Better touch targets */
    #language-toggle,
    #theme-toggle {
        width: 50px !important;      /* Larger touch target for mobile */
        height: 48px !important;
        min-width: 50px !important;
        min-height: 48px !important;
        padding: 0 !important;
        border-radius: 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        background: rgba(156, 163, 175, 0.08) !important;
        border: 1px solid rgba(156, 163, 175, 0.15) !important;
        transition: all 0.2s ease !important;
        flex: 0 0 auto !important;
    }

    /* Mobile tap feedback */
    #language-toggle:active,
    #theme-toggle:active {
        background: rgba(156, 163, 175, 0.2) !important;
        transform: scale(0.95) !important;
    }

    /* Dark mode mobile styles */
    .dark #language-toggle,
    .dark #theme-toggle {
        background: rgba(75, 85, 99, 0.2) !important;
        border: 1px solid rgba(75, 85, 99, 0.3) !important;
    }

    .dark #language-toggle:active,
    .dark #theme-toggle:active {
        background: rgba(75, 85, 99, 0.4) !important;
    }

    /* Mobile icon sizes - optimized for touch */
    #language-toggle .fas.fa-globe,
    #theme-toggle .fas.fa-moon,
    #theme-toggle .fas.fa-sun {
        font-size: 20px !important;
        width: 20px !important;
        height: 20px !important;
        color: rgba(55, 65, 81, 0.8) !important;
        margin: 0 !important;
        margin-bottom: 0 !important;
    }

    .dark #language-toggle .fas.fa-globe,
    .dark #theme-toggle .fas.fa-moon,
    .dark #theme-toggle .fas.fa-sun {
        color: rgba(209, 213, 219, 0.9) !important;
    }

    /* Mobile dark mode icon visibility - maintain dynamic switching */
    html:not(.dark) #theme-toggle .fas.fa-moon {
        display: block !important;
    }

    html:not(.dark) #theme-toggle .fas.fa-sun {
        display: none !important;
    }

    html.dark #theme-toggle .fas.fa-moon {
        display: none !important;
    }

    html.dark #theme-toggle .fas.fa-sun {
        display: block !important;
    }

    /* Hide language text on very small screens */
    #current-lang {
        display: none !important;
    }

    /* Hide chevron on mobile */
    #language-toggle .fa-chevron-down {
        display: none !important;
    }
    
    /* Ensure all sections are centered */
    section {
        text-align: center;
    }
    
    /* Center all grid content */
    .grid {
        text-align: center;
        justify-items: center;
    }
    
    /* Center all flex content */
    .flex {
        justify-content: center;
        text-align: center;
    }
    
    /* Better touch targets for mobile */
    button, .button, a {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
    }
    
    /* Make all buttons full width on mobile */
    button, 
    .button,
    a[class*="bg-blue"],
    a[class*="bg-green"],
    a[class*="border-2"],
    .btn {
        width: 100% !important;
        display: block !important;
        text-align: center !important;
        margin: 0.5rem 0 !important;
    }
    
    /* Hero buttons mobile styling */
    .stagger-animation a {
        width: 100% !important;
        margin-bottom: 1rem !important;
        text-align: center !important;
        display: block !important;
    }
    
    /* Form submit button already has w-full, ensure it stays that way */
    button[type="submit"] {
        width: 100% !important;
    }
    
    /* Mobile header adjustments */
    header .container {
        padding: 0 1rem;
    }
    
    header nav {
        padding: 0.75rem 0;
    }
    
    /* Logo size adjustment */
    header .text-2xl {
        font-size: 1.25rem;
    }
    
    /* Hero section mobile optimization */
    #home {
        padding-top: 6rem;
        min-height: calc(100vh - 4rem);
        text-align: center;
    }
    
    #home .grid {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }
    
    #home .flex {
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    
    /* Force hero text to center */
    .gradient-text {
        text-align: center !important;
        display: block;
        width: 100%;
        margin: 0 auto;
    }
    
    /* Optimized typography scaling for mobile UX */
    .text-sm { font-size: 0.875rem; }
    .text-base { font-size: 0.95rem; }
    .text-lg { font-size: 1rem; }
    .text-xl { font-size: 1.125rem; }
    .text-2xl { font-size: 1.25rem; }
    .text-3xl { font-size: 1.5rem; }
    .text-4xl { font-size: 1.75rem; }
    .text-5xl { font-size: 2rem; }
    .text-6xl { font-size: 2.25rem; }
    .text-7xl { font-size: 2.5rem; }
    .text-8xl { font-size: 2.75rem; }
    
    /* Ensure all text has proper line height */
    h1, h2, h3, h4, h5, h6 {
        line-height: 1.2 !important;
        margin-bottom: 0.75rem !important;
    }
    
    p, span, div {
        line-height: 1.5 !important;
    }
    
    /* Mobile spacing improvements */
    .py-20 { padding-top: 3rem; padding-bottom: 3rem; }
    .py-16 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
    .mb-16 { margin-bottom: 2rem; }
    .mb-12 { margin-bottom: 1.5rem; }
    
    /* Grid adjustments for mobile */
    .grid.lg\\:grid-cols-2,
    .grid.lg\\:grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Card padding adjustments - Full width on mobile */
    .tech-card,
    .project-card {
        padding: 1rem;
        text-align: center;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden;
        display: block;
        margin: 0.75rem 0;
    }
    
    /* Ensure all card containers use full width */
    .bento-item,
    .card,
    .glass-effect {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Project card specific mobile fixes */
    .project-card h3 {
        text-align: center;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        line-height: 1.3;
    }
    
    .project-card p {
        text-align: center;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        max-width: 100%;
    }
    
    /* Bento grid mobile adjustments */
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 100%;
    }
    
    .bento-item {
        max-width: 100%;
        overflow: hidden;
        margin: 0 auto;
    }
    
    /* Tech tags wrapping */
    .flex-wrap {
        justify-content: center;
        max-width: 100%;
    }
    
    .flex-wrap span {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
        text-align: center;
    }
    
    .carousel-nav {
        display: none;
    }
    
    .language-dropdown {
        right: 0;
        left: auto;
    }
    
    .floating-particles {
        display: none;
    }
    
    .hover-3d:hover {
        transform: none;
    }
    
    /* Reduzir efeitos cósmicos em mobile */
    .cosmic-bg::before,
    .cosmic-bg::after {
        opacity: 0.1;
    }
    
    .cosmic-nebula {
        opacity: 0.05;
    }
    
    /* Better form styling for mobile - Full width */
    form {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    form input,
    form textarea,
    form button {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem 1rem;
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        margin: 0.5rem 0 !important;
        box-sizing: border-box;
    }
    
    /* Header control buttons - but keep them small for header */
    header button,
    #theme-toggle,
    #language-toggle,
    #mobile-menu-toggle,
    #mobile-language-toggle {
        width: auto !important;
        min-width: 44px !important;
        margin: 0 !important;
    }
    
    /* Fixed WhatsApp button for mobile only */
    .whatsapp-button {
        bottom: 1rem !important;
        right: 1rem !important;
        width: 56px !important;
        height: 56px !important;
    }
    
    /* WhatsApp button circle alignment fix - mobile */
    .whatsapp-button .relative {
        width: 56px !important;
        height: 56px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .whatsapp-button .bg-green-500 {
        width: 56px !important;
        height: 56px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .whatsapp-button i {
        font-size: 1.25rem !important;
    }
    
    /* WhatsApp button pulse rings - mobile */
    .whatsapp-button .animate-ping {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 56px !important;
        height: 56px !important;
        border-radius: 50% !important;
    }
    
    /* Standardize all social media icon sizes */
    .w-12.h-12 {
        width: 3rem !important;
        height: 3rem !important;
    }
    
    .w-12.h-12 i {
        font-size: 1.25rem !important;
    }
    
    /* Contact section social icons - mobile only alignment fix */
    #contact .space-y-4 {
        align-items: flex-start !important;
        text-align: left !important;
    }
    
    #contact .flex.items-center.space-x-4 {
        justify-content: flex-start !important;
        align-items: center !important;
        text-align: left !important;
    }
    
    #contact .flex.items-center.space-x-4 .w-12 {
        width: 3rem !important;
        height: 3rem !important;
        min-width: 3rem !important;
        min-height: 3rem !important;
        flex-shrink: 0 !important;
    }
    
    #contact .flex.items-center.space-x-4 > div:last-child {
        text-align: left !important;
        align-self: center !important;
    }
    
    /* Footer social icons */
    footer .fas,
    footer .fab {
        font-size: 1rem !important;
        width: 1rem !important;
        text-align: center !important;
    }
    
    /* About section card size fixes */
    #about .w-48,
    #about .w-56,
    .w-48.h-48,
    .w-56.h-56 {
        width: 10rem !important;
        height: 10rem !important;
        max-width: 10rem !important;
        max-height: 10rem !important;
    }
    
    #about .glass-effect {
        padding: 1.5rem !important;
        max-width: 280px !important;
        margin: 0 auto !important;
    }
    
    #about .bg-gradient-to-br {
        max-width: 300px !important;
        margin: 0 auto !important;
    }
    
    /* About section avatar icon size */
    #about .fas.fa-user-tie {
        font-size: 2.5rem !important;
    }
    
    /* Contact section mobile optimization */
    .contact-section .flex-col.lg\\:flex-row {
        flex-direction: column;
        gap: 2rem;
    }
    
    /* Ensure all sections and containers use full available width */
    section {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* All grid and flex containers full width */
    .grid,
    .flex {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Navigation links in mobile menu full width */
    .mobile-nav-link {
        width: 100% !important;
        display: block !important;
        text-align: center !important;
        padding: 1rem !important;
    }
    
    /* Carousel and interactive elements */
    .carousel-slide {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Comprehensive content size control */
    .max-w-6xl,
    .max-w-4xl,
    .max-w-7xl {
        max-width: calc(100vw - 2rem) !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Ensure no content exceeds viewport */
    * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Hero section mobile font optimization */
    #home .text-white\\/20 {
        font-size: 1rem !important;
    }
    
    /* Project titles mobile optimization */
    .project-card h3 {
        font-size: 1rem !important;
        line-height: 1.3 !important;
    }
    
    .project-card p {
        font-size: 0.875rem !important;
        line-height: 1.4 !important;
    }
    
    /* Tech stack mobile optimization */
    .tech-card h3 {
        font-size: 0.875rem !important;
        font-weight: 600 !important;
    }
    
    .tech-card i {
        font-size: 2rem !important;
    }
}

@media (max-width: 640px) {
    /* Extra small screens optimization */
    
    /* Further typography scaling for tiny screens */
    .text-sm { font-size: 0.8rem; }
    .text-base { font-size: 0.9rem; }
    .text-lg { font-size: 0.95rem; }
    .text-xl { font-size: 1rem; }
    .text-2xl { font-size: 1.125rem; }
    .text-3xl { font-size: 1.25rem; }
    .text-4xl { font-size: 1.5rem; }
    .text-5xl { font-size: 1.75rem; }
    .text-6xl { font-size: 2rem; }
    .text-7xl { font-size: 2.25rem; }
    .text-8xl { font-size: 2.5rem; }
    
    /* Header name even smaller on tiny screens */
    header .text-2xl {
        font-size: 1rem !important;
        font-weight: 700 !important;
        text-align: left !important;
        flex: 1 1 auto !important;
    }

    /* SMALL SCREEN HEADER - FIX OVERFLOW */
    header {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    header .container {
        padding-left: 0.875rem !important;
        padding-right: 0.875rem !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    header .flex.items-center.justify-between {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 0.375rem !important;
        flex-wrap: nowrap !important;
        overflow: hidden !important;
    }

    /* SMALL SCREEN NAME - PREVENT OVERFLOW */
    header .text-2xl {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        text-align: left !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: calc(100vw - 120px) !important; /* Reserve space for icons */
        min-width: 0 !important;
        flex: 1 1 auto !important;
        font-size: 1rem !important;
        font-weight: 700 !important;
        color: inherit !important;
        box-sizing: border-box !important;
    }

    /* SMALL SCREEN ICONS - COMPACT */
    header .flex.items-center.space-x-2 {
        display: flex !important;
        align-items: center !important;
        gap: 0.25rem !important;
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: fit-content !important;
    }

    /* EXTRA SMALL SCREENS - Compact but still accessible */
    #language-toggle,
    #theme-toggle {
        width: 42px !important;      /* Still meets minimum touch target */
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
        padding: 0 !important;
        border-radius: 10px !important;
        background: rgba(156, 163, 175, 0.06) !important;
        border: 1px solid rgba(156, 163, 175, 0.12) !important;
    }

    /* Smaller icons for compact layout */
    #language-toggle .fas.fa-globe,
    #theme-toggle .fas.fa-moon,
    #theme-toggle .fas.fa-sun {
        font-size: 18px !important;
        width: 18px !important;
        height: 18px !important;
        color: rgba(55, 65, 81, 0.8) !important;
        margin: 0 !important;
        margin-bottom: 0 !important;
    }

    .dark #language-toggle .fas.fa-globe,
    .dark #theme-toggle .fas.fa-moon,
    .dark #theme-toggle .fas.fa-sun {
        color: rgba(209, 213, 219, 0.9) !important;
    }

    /* Small screen dark mode icon visibility - maintain dynamic switching */
    html:not(.dark) #theme-toggle .fas.fa-moon {
        display: block !important;
    }

    html:not(.dark) #theme-toggle .fas.fa-sun {
        display: none !important;
    }

    html.dark #theme-toggle .fas.fa-moon {
        display: none !important;
    }

    html.dark #theme-toggle .fas.fa-sun {
        display: block !important;
    }

    /* Header name smaller on tiny screens */
    header .text-2xl {
        font-size: 1.125rem !important;
        font-weight: 700 !important;
    }

    /* Tighter header spacing */
    header nav {
        padding: 0.75rem 0 !important;
    }

    header .flex.items-center.justify-between {
        gap: 0.75rem !important;
    }
    
    /* Tighter spacing for small screens */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .py-20 { padding-top: 2rem; padding-bottom: 2rem; }
    .py-16 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
    
    /* Hero section adjustments */
    #home {
        min-height: 100vh;
        padding-top: 4rem;
    }
    
    /* Better button sizing */
    .btn, button {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
    
    /* Card optimizations */
    .tech-card:hover {
        transform: translateY(-3px) scale(1.01);
    }
    
    .project-card:hover {
        transform: translateY(-2px);
    }
    
    .project-card p {
        font-size: 0.875rem;
        line-height: 1.5;
    }
    
    /* Form improvements */
    form {
        padding: 1rem;
    }
    
    form input,
    form textarea {
        padding: 1rem;
        font-size: 16px;
    }
    
    /* Tech cube size adjustment */
    .tech-cube-container {
        width: 150px;
        height: 150px;
    }
    
    /* Better carousel spacing */
    .carousel-slide {
        padding: 0.5rem;
    }
    
    /* Logo adjustments */
    header .text-2xl {
        font-size: 1.125rem;
    }
    
    /* Language and theme buttons */
    #language-toggle,
    #theme-toggle {
        padding: 0.5rem;
    }
    
    /* Mobile menu improvements */
    .mobile-nav-link {
        font-size: 1rem;
        padding: 0.75rem 0;
    }
    
    /* Disable complex animations */
    .neon-text {
        text-shadow: none;
        animation: none;
    }
    
    /* Desabilitar completamente efeitos cósmicos em telas muito pequenas */
    .cosmic-bg::before,
    .cosmic-bg::after,
    .cosmic-nebula {
        display: none;
    }
    
    /* Better touch spacing */
    .space-y-4 > * + * {
        margin-top: 1rem;
    }
    
    .space-x-2 > * + * {
        margin-left: 0.5rem;
    }
    
    /* Improve readability */
    p, .text-base {
        font-size: 0.875rem;
        line-height: 1.6;
    }
}

/* ========================================
   MOBILE LANDSCAPE ORIENTATION
   ======================================== */
@media (max-width: 768px) and (orientation: landscape) {
    /* Optimize for mobile landscape */
    #home {
        min-height: 100vh;
        padding-top: 2rem;
    }
    
    .hero-section .grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        align-items: center;
    }
    
    .py-20 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
} 