/* ===================================
   GLOBAL STYLES
   ===================================== */

/* Reset for proper scroll snapping */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #0B0F15;
    color: #ffffff;
}

/* ===================================
   ETAPA 1: FULL-PAGE SCROLL SNAPPING
   ===================================== */

/* Body is the scroll container for snap behavior */
body.snap-container {
    height: 100vh;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar */
body.snap-container::-webkit-scrollbar {
    width: 8px;
}

body.snap-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

body.snap-container::-webkit-scrollbar-thumb {
    background: rgba(43, 108, 238, 0.5);
    border-radius: 4px;
}

body.snap-container::-webkit-scrollbar-thumb:hover {
    background: rgba(43, 108, 238, 0.7);
}

/* Each section is EXACTLY 100vh - NO WRAPPERS NEEDED */
.snap-section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

/* Disable snap on mobile for better UX */
@media (max-width: 768px) {
    html {
        overflow: auto;
    }
    
    body.snap-container {
        scroll-snap-type: none;
        height: auto;
        overflow-y: auto;
    }
    
    .snap-section {
        scroll-snap-align: none;
        scroll-snap-stop: auto;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
    }
}

/* Accessibility - respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    body.snap-container {
        scroll-behavior: auto;
    }
}

/* ===================================
   FASE 2: HERO 3D IMMERSIVE EFFECT
   =================================== */

/* Enable 3D transformations and preserve depth */
#heroCard {
    transform-style: preserve-3d;
    will-change: transform;
    transition: box-shadow 0.4s ease;
}

/* Enhance hover state with deeper shadow */
#heroCard:hover {
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(43, 108, 238, 0.15);
}

/* Ensure icons float in 3D space */
#heroCard .material-symbols-outlined {
    transform-style: preserve-3d;
    will-change: transform;
}

/* Glare effect styling (created by Vanilla-Tilt) */
.js-tilt-glare {
    border-radius: 1rem;
}

/* ===================================
   UTILITY CLASSES
   =================================== */

.text-glow {
    text-shadow: 0 0 30px rgba(43, 108, 238, 0.4);
}

.glass-panel {
    background: rgba(19, 27, 38, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tech-grid-bg {
    background-size: 50px 50px;
    mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
}

/* ===================================
   FASE 5: PREMIUM TYPOGRAPHY
   =================================== */

/* Dramatic section titles with premium effects */
.section-title {
    letter-spacing: -0.02em;
    text-shadow: 
        0 0 40px rgba(43, 108, 238, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    position: relative;
}

.section-title:hover {
    text-shadow: 
        0 0 50px rgba(43, 108, 238, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.6);
    transform: translateY(-2px);
}

/* ===================================
   BUTTONS
   =================================== */

.btn-neon {
    position: relative;
    background: linear-gradient(90deg, #2b6cee, #4facfe);
    background-size: 200% auto;
    color: white;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 0 20px rgba(43, 108, 238, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-neon:hover {
    background-position: right center;
    box-shadow: 0 0 30px rgba(79, 172, 254, 0.6);
    transform: translateY(-2px);
}

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

.card-hover-glow {
    transition: all 0.4s ease;
}

.card-hover-glow:hover {
    box-shadow: 0 0 30px rgba(43, 108, 238, 0.15), inset 0 0 10px rgba(43, 108, 238, 0.05);
    border-color: rgba(43, 108, 238, 0.5);
}

/* ===================================
   FASE 4: HORIZONTAL PROJECT CAROUSEL
   =================================== */

/* Horizontal scrolling container */
.horizontal-scroll-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 0.5rem 0 1rem 0;
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    position: relative;
    
    /* Hide scrollbar but keep functionality */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Add gradient fade to indicate more cards */
.horizontal-scroll-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: -0.5rem;
    bottom: 0;
    width: 80px;
    background: linear-gradient(to left, rgba(11, 15, 21, 1) 0%, rgba(11, 15, 21, 0.7) 40%, transparent 100%);
    pointer-events: none;
    z-index: 5;
}

@media (min-width: 640px) {
    .horizontal-scroll-container::after {
        right: -1rem;
    }
}

@media (min-width: 768px) {
    .horizontal-scroll-container::after {
        right: -2rem;
    }
}

@media (min-width: 640px) {
    .horizontal-scroll-container {
        margin: 0 -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        gap: 1.5rem;
    }
}

/* Hide scrollbar for Chrome, Safari and Opera */
.horizontal-scroll-container::-webkit-scrollbar {
    display: none;
}

/* Add gradient fade on edges to indicate scrollability */
.horizontal-scroll-container::before,
.horizontal-scroll-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    pointer-events: none;
    z-index: 10;
}

.horizontal-scroll-container::before {
    left: 0;
    background: linear-gradient(to right, rgba(11, 15, 21, 0.8), transparent);
}

.horizontal-scroll-container::after {
    right: 0;
    background: linear-gradient(to left, rgba(11, 15, 21, 0.8), transparent);
}

@media (max-width: 639px) {
    .horizontal-scroll-container::after {
        width: 60px;
        background: linear-gradient(to left, rgba(11, 15, 21, 0.95) 0%, rgba(11, 15, 21, 0.7) 40%, transparent 100%);
    }
}

/* Project card in horizontal layout */
.project-card {
    flex: 0 0 auto;
    width: 85vw;
    max-width: 500px;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    height: auto;
    min-height: 40px;
}

/* Tablet adjustments */
@media (min-width: 640px) {
    .project-card {
        width: 80vw;
        max-width: 520px;
    }
}

/* Desktop adjustments */
@media (min-width: 768px) {
    .project-card {
        width: 70vw;
        max-width: 580px;
    }
    
    .horizontal-scroll-container {
        gap: 2rem;
        margin: 0 -2rem;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1024px) {
    .project-card {
        width: 65vw;
        max-width: 650px;
    }
    
    .horizontal-scroll-container {
        gap: 3rem;
        margin: 0 -3rem;
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

/* ===================================
   SKILLS SECTION
   =================================== */

.skill-node {
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.skill-node:hover {
    box-shadow: 0 0 15px rgba(43, 108, 238, 0.4);
    border-color: #2b6cee;
    transform: scale(1.02);
    z-index: 10;
}

.connection-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(43, 108, 238, 0.3), transparent);
    z-index: 0;
    pointer-events: none;
}

/* ===================================
   ANIMATIONS
   =================================== */

/* FASE 3: Scroll-Triggered Animations - Initial State */
.scroll-animate {
    opacity: 0;
    transform: translateY(50px);
    will-change: opacity, transform;
}

/* State after animation is triggered */
.scroll-animate.animated {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

@keyframes float-slow {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-15px) scale(1.02);
    }
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Animation classes */
.animate-on-scroll {
    opacity: 1;
    transform: translateY(0);
}

.animate-on-scroll.animated {
    animation-duration: 0.8s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-up {
    animation-name: fadeInUp;
}

.fade-in-left {
    animation-name: fadeInLeft;
}

.fade-in-right {
    animation-name: fadeInRight;
}

.scale-in {
    animation-name: scaleIn;
}

.slide-down {
    animation-name: slideDown;
}

/* Delay classes for staggered animations */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* ===================================
   MOBILE MENU
   =================================== */

#mobileMenu {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#mobileMenu.active {
    display: block !important;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.mobile-nav-link {
    animation: slideDown 0.5s ease;
    display: block;
    padding: 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover {
    background: rgba(43, 108, 238, 0.1);
    transform: translateX(10px);
}

/* Mobile menu improvements */
@media (max-width: 1024px) {
    #mobileMenu nav {
        padding: 2rem 1rem;
    }
    
    .mobile-nav-link {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem;
    }
}

/* Cross-browser compatibility */
@supports (-webkit-backdrop-filter: none) or (backdrop-filter: none) {
    .glass-panel {
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
    }
}

/* Firefox fallback */
@-moz-document url-prefix() {
    .glass-panel {
        background: rgba(19, 27, 38, 0.9);
    }
}

/* ===================================
   UI/UX OPTIMIZATIONS
   =================================== */

/* Improve focus states for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #2b6cee;
    outline-offset: 2px;
}

/* Better readability */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Prevent text overflow */
h1, h2, h3, h4, h5, h6, p {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Optimize images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Better tap highlighting on mobile */
a, button {
    -webkit-tap-highlight-color: rgba(43, 108, 238, 0.1);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Improve contrast for better readability */
.text-slate-400 {
    color: #94a3b8 !important;
}

/* Mobile-specific UI improvements */
@media (max-width: 768px) {
    /* Larger tap targets */
    a, button, .skill-node {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Better spacing for readability */
    p + p {
        margin-top: 0.75rem;
    }
    
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }
    
    /* Fix iOS input zoom */
    input, textarea, select {
        font-size: 16px !important;
    }
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .glass-panel {
        padding: 1.5rem !important;
    }
    
    section {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .text-glow {
        text-shadow: 0 0 15px rgba(43, 108, 238, 0.3);
    }
    
    /* Hero section mobile optimization */
    h1 {
        font-size: 2.25rem !important;
        line-height: 1.15 !important;
        letter-spacing: -0.02em !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }
    
    h3 {
        font-size: 1.125rem !important;
        line-height: 1.4 !important;
    }
    
    /* Reduce excessive spacing */
    .glass-panel {
        padding: 1rem !important;
        margin-bottom: 0.75rem;
    }
    
    /* Tighter section padding */
    section {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    /* Hero section specific */
    section:first-of-type {
        padding-top: 4rem !important;
        padding-bottom: 3rem !important;
    }
    
    /* Reduce gap between elements */
    .gap-8 {
        gap: 1.25rem !important;
    }
    
    .gap-12 {
        gap: 1.5rem !important;
    }
    
    /* Button optimization */
    .btn-neon {
        height: 2.75rem !important;
        font-size: 0.875rem !important;
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }
    
    /* Grid adjustments */
    .grid {
        gap: 0.75rem !important;
    }
    
    /* Skill nodes */
    .skill-node {
        padding: 0.625rem !important;
        font-size: 0.8125rem !important;
    }
    
    /* Improve touch targets */
    a, button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Text sizing for better readability */
    p {
        font-size: 0.875rem !important;
        line-height: 1.5 !important;
    }
    
    /* Reduce container padding */
    .px-6 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .px-12 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Optimize hero content */
    .flex-col.gap-4 {
        gap: 0.875rem !important;
    }
    
    /* Better badge sizing */
    .px-3.py-1 {
        padding-left: 0.625rem !important;
        padding-right: 0.625rem !important;
        padding-top: 0.375rem !important;
        padding-bottom: 0.375rem !important;
    }
    
    /* Hero visual - reduce size on mobile */
    .aspect-square {
        max-width: 280px !important;
        margin: 0 auto;
    }
    
    /* Reduce border size */
    .pl-4 {
        padding-left: 0.75rem !important;
    }
    
    /* Optimize mono text */
    .font-mono {
        font-size: 0.8125rem !important;
    }
}

/* Small mobile (max-width: 480px) */
@media (max-width: 480px) {
    h1 {
        font-size: 1.875rem !important;
        line-height: 1.15 !important;
    }
    
    h2 {
        font-size: 1.375rem !important;
    }
    
    .glass-panel {
        padding: 0.875rem !important;
    }
    
    /* Compact sections */
    section {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    section:first-of-type {
        padding-top: 3rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    /* Reduce gaps further */
    .gap-8 {
        gap: 1rem !important;
    }
    
    .gap-12 {
        gap: 1.25rem !important;
    }
    
    /* Full width cards */
    .grid > * {
        width: 100% !important;
    }
    
    /* Smaller hero visual */
    .aspect-square {
        max-width: 240px !important;
    }
    
    /* Smaller buttons */
    .btn-neon {
        height: 2.5rem !important;
        font-size: 0.8125rem !important;
    }
    
    /* Compact text */
    p {
        font-size: 0.8125rem !important;
    }
}

/* ===========================
   ETAPA 2: PARALLAX 3D BACKGROUND
   =========================== */
.parallax-bg-container {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.bg-layer {
    will-change: transform;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.layer-deep {
    z-index: 1;
}

.layer-mid {
    z-index: 2;
}

.layer-front {
    z-index: 3;
}

.layer-shapes {
    z-index: 4;
}

/* Floating Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

@keyframes float-delayed {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-30px) rotate(-5deg);
    }
}

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

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

