/**
 * Portfolio - Emanuel Gomes Lima Lázaro
 * Estilos customizados e animações
 */

/* ========================================
   BASE E RESET
   ======================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background-color: #020617; /* slate-950 */
    color: #e2e8f0; /* slate-200 */
    overflow-x: hidden;
}

/* ========================================
   SELEÇÃO DE TEXTO
   ======================================== */

::selection {
    background-color: rgba(99, 102, 241, 0.3);
    color: white;
}

/* ========================================
   GLASSMORPHISM
   ======================================== */

.glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.glass-dark {
    background: rgba(2, 6, 23, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ========================================
   ANIMAÇÕES PERSONALIZADAS
   ======================================== */

/* Pulse Glow Background */
@keyframes pulse-glow {
    0%, 100% {
        opacity: 0.15;
        transform: scale(1);
    }
    50% {
        opacity: 0.25;
        transform: scale(1.1);
    }
}

.animate-pulse-glow {
    animation: pulse-glow 8s ease-in-out infinite;
}

.animate-pulse-glow.delay-1000 {
    animation-delay: 1s;
}

.animate-pulse-glow.delay-2000 {
    animation-delay: 2s;
}

/* Fade In Up */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fade-in-up 0.6s ease-out forwards;
}

/* Fade In */
@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Elements Stagger */
.hero-element {
    opacity: 0;
    transform: translateY(20px);
    animation: hero-fade-in 0.6s ease-out forwards;
}

.hero-element:nth-child(1) { animation-delay: 0.1s; }
.hero-element:nth-child(2) { animation-delay: 0.2s; }
.hero-element:nth-child(3) { animation-delay: 0.3s; }
.hero-element:nth-child(4) { animation-delay: 0.4s; }
.hero-element:nth-child(5) { animation-delay: 0.5s; }
.hero-element:nth-child(6) { animation-delay: 0.6s; }

@keyframes hero-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Skill Card Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

.skill-card:hover {
    animation: float 2s ease-in-out infinite;
}

/* Shine Effect on Cards */
@keyframes shine {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* ========================================
   NAVBAR SCROLL EFFECT
   ======================================== */

#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ========================================
   EFEITOS DE HOVER
   ======================================== */

/* Button Glow */
.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::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;
}

.btn-glow:hover::before {
    left: 100%;
}

/* Link Hover Underline */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* ========================================
   PROJECT CARDS
   ======================================== */

.project-card {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.project-card:hover {
    transform: translateY(-8px);
}

.project-card:hover .project-image {
    transform: scale(1.05);
}

.project-image {
    transition: transform 0.6s ease;
}

/* ========================================
   SKILL BARS ANIMATION
   ======================================== */

.skill-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1s ease-out;
}

.skill-bar-fill.visible {
    transform: scaleX(1);
}

/* ========================================
   DIFFERENCIAL CARDS
   ======================================== */

.diferencial-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.diferencial-card:hover {
    box-shadow: 0 25px 50px -12px rgba(99, 102, 241, 0.25);
}

/* ========================================
   EXPERIENCE SECTION & TIMELINE
   ======================================== */

.timeline-item {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.timeline-item:nth-child(even) {
    transform: translateX(30px);
}

.timeline-item:nth-child(even).visible {
    transform: translateX(0);
}

.experience-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.experience-card:hover {
    box-shadow: 0 20px 40px -12px rgba(99, 102, 241, 0.15);
    transform: translateY(-4px);
}

/* Timeline Line Glow */
.timeline-item::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #6366f1, #a855f7, transparent);
    opacity: 0.3;
}

@media (min-width: 768px) {
    .timeline-item::before {
        display: none;
    }
}

/* Timeline Dot Pulse */
.timeline-item .rounded-full[class*="bg-gradient"] {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    animation: timeline-dot-pulse 2s ease-out infinite;
}

@keyframes timeline-dot-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #334155 #0f172a;
}

/* ========================================
   FOCUS STATES (Acessibilidade)
   ======================================== */

a:focus-visible,
button:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* ========================================
   ICONS FIX
   ======================================== */

/* Garantir que ícones SVG são exibidos */
svg {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Ícones nos botões */
a svg,
button svg {
    display: inline-block;
}

/* Ícones nos cards de contacto */
.group svg {
    transition: transform 0.3s ease;
}

.group:hover svg {
    transform: scale(1.1);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 640px) {
    .glass {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

/* ========================================
   LOADING STATES
   ======================================== */

.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    animation: loading-shine 1.5s infinite;
}

@keyframes loading-shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ========================================
   TEXT GRADIENTS
   ======================================== */

.text-gradient {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   GRADIENT BORDERS
   ======================================== */

.gradient-border {
    position: relative;
    background: #020617;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(135deg, #6366f1, #a855f7, #06b6d4);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
