/* Custom Modern Styles */

/* Prevent horizontal scroll globally */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Ensure all elements respect container width */
* {
    box-sizing: border-box;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #6366f1, #ec4899);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #4f46e5, #db2777);
}

/* Enhanced gradient animations */
@keyframes gradient-x {
    0%, 100% {
        transform: translateX(-50%);
    }
    50% {
        transform: translateX(50%);
    }
}

@keyframes gradient-y {
    0%, 100% {
        transform: translateY(-50%);
    }
    50% {
        transform: translateY(50%);
    }
}

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

/* Floating animation for hero elements */
.float-animation {
    animation: float 6s ease-in-out infinite;
}

/* Custom button hover effects */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Enhanced glassmorphism effect */
.glass {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Custom gradient text */
.gradient-text {
    background: linear-gradient(135deg, #6366f1, #ec4899, #f59e0b);
    background-size: 300% 300%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-x 4s ease infinite;
}

/* Loading animation for skills */
.skill-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

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

/* Stagger animation for skill cards */
.skill-card:nth-child(1) { animation-delay: 0.1s; }
.skill-card:nth-child(2) { animation-delay: 0.2s; }
.skill-card:nth-child(3) { animation-delay: 0.3s; }
.skill-card:nth-child(4) { animation-delay: 0.4s; }
.skill-card:nth-child(5) { animation-delay: 0.5s; }
.skill-card:nth-child(6) { animation-delay: 0.6s; }

/* Enhanced focus states for accessibility */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.5);
}

/* Custom selection styles */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: inherit;
}

/* Smooth transitions for all interactive elements */
button, a, input, textarea {
    transition: all 0.2s ease-in-out;
}

/* Enhanced hover effects for social icons */
.social-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-icon:hover {
    transform: translateY(-2px) scale(1.05);
}

/* Custom pulse animation */
@keyframes pulse-custom {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.pulse-custom {
    animation: pulse-custom 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Typography enhancements */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile-first responsive adjustments */
@media (max-width: 640px) {
    .gradient-text {
        background-size: 200% 200%;
    }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.1;
    }
    
    /* Text justification for mobile devices */
    p {
        text-align: justify;
        text-justify: inter-word;
        hyphens: auto;
        -webkit-hyphens: auto;
        -ms-hyphens: auto;
    }
    
    /* Specific targeting for content paragraphs */
    .text-lg, .text-xl {
        text-align: justify;
        text-justify: inter-word;
    }
    
    /* Ensure proper spacing for justified text */
    .leading-relaxed {
        word-spacing: 0.1em;
        letter-spacing: 0.01em;
    }
    
    /* Prevent horizontal scroll */
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    /* Ensure all containers respect mobile width */
    .max-w-7xl {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Fix grid layout on mobile */
    .grid {
        width: 100%;
        max-width: 100%;
    }
    
    /* Ensure images don't overflow */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Fix any wide elements */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Fix social links container */
    .flex {
        flex-wrap: wrap;
    }
    
    /* Ensure text doesn't break layout */
    h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Fix button and link overflow */
    .inline-flex {
        min-width: 0;
        white-space: nowrap;
    }
    
    /* Ensure no element extends beyond viewport */
    section {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Fix navigation on mobile */
    nav {
        width: 100%;
        max-width: 100vw;
    }
    
    /* Ensure skill cards don't overflow */
    .grid > div {
        min-width: 0;
        width: 100%;
    }
}

/* Dark mode support preparation */
@media (prefers-color-scheme: dark) {
    .glass {
        background: rgba(0, 0, 0, 0.25);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Performance optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}
