/* Custom Animations and Additional Styles */

* {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

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

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

@keyframes pulse-slow {
    0%, 100% {
        opacity: 0.15;
    }
    50% {
        opacity: 0.25;
    }
}

/* Animation Classes */
.animate-fade-in {
    animation: fade-in 0.6s ease-out forwards;
}

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

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

/* Animation Delays */
.animation-delay-100 {
    animation-delay: 0.1s;
}

.animation-delay-200 {
    animation-delay: 0.2s;
}

.animation-delay-300 {
    animation-delay: 0.3s;
}

.animation-delay-400 {
    animation-delay: 0.4s;
}

/* Navbar Styles */
#navbar {
    transition: all 0.3s ease;
}

#navbar.scrolled {
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-link {
    position: relative;
    color: rgba(255, 255, 255, 0.7);
}

.nav-link.active {
    color: rgb(34, 211, 238);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    background: linear-gradient(90deg, rgb(34, 211, 238), rgb(59, 130, 246));
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

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

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

::-webkit-scrollbar-thumb {
    background: rgba(34, 211, 238, 0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(34, 211, 238, 0.5);
}

/* Text Selection */
::selection {
    background: rgba(34, 211, 238, 0.3);
    color: white;
}

::-moz-selection {
    background: rgba(34, 211, 238, 0.3);
    color: white;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, rgb(34, 211, 238), rgb(59, 130, 246), rgb(147, 51, 234));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card Hover Effects */
.project-card,
.skill-card,
.experience-card {
    transition: all 0.3s ease;
}

.project-card:hover,
.skill-card:hover,
.experience-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(34, 211, 238, 0.2);
}

/* Button Animations */
.btn-primary {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgb(6, 182, 212), rgb(37, 99, 235));
    z-index: -1;
    transition: all 0.3s ease;
}

.btn-primary:hover::before {
    background: linear-gradient(135deg, rgb(8, 145, 178), rgb(29, 78, 216));
}

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

.loading {
    animation: spin 1s linear infinite;
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .animate-fade-in-up {
        animation: fade-in 0.6s ease-out forwards;
    }
    
    .animation-delay-100,
    .animation-delay-200,
    .animation-delay-300,
    .animation-delay-400 {
        animation-delay: 0s;
    }
}

/* Smooth Transitions */
a, button {
    transition: all 0.3s ease;
}

/* Focus States for Accessibility */
a:focus,
button:focus {
    outline: 2px solid rgb(34, 211, 238);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    nav,
    footer,
    .animate-pulse,
    .animate-pulse-slow {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Performance Optimization */
.bg-blur {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Safari Specific Fixes */
@supports (-webkit-backdrop-filter: blur(12px)) or (backdrop-filter: blur(12px)) {
    .backdrop-blur-sm {
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    body {
        background: black;
    }
    
    .text-white\/60,
    .text-white\/70,
    .text-white\/80 {
        color: white;
    }
}

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

/* Mobile Menu Styles */
#mobile-menu {
    transition: max-height 0.3s ease;
}

#mobile-menu.show {
    display: block;
}

/* Image Lazy Loading */
img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.loaded {
    opacity: 1;
}

/* Custom Cursor (Optional) */
@media (pointer: fine) {
    a, button {
        cursor: pointer;
    }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #0a0a0a;
    }
}

/* Typography Improvements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

p {
    line-height: 1.7;
}

/* Section Padding */
section {
    scroll-margin-top: 80px;
}

/* Glassmorphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Gradient Borders */
.gradient-border {
    position: relative;
    background: linear-gradient(#0a0a0a, #0a0a0a) padding-box,
                linear-gradient(135deg, rgb(34, 211, 238), rgb(59, 130, 246)) border-box;
    border: 2px solid transparent;
}

/* Utility Classes */
.text-balance {
    text-wrap: balance;
}

.truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}