/* Custom CSS for Portfolio */

/* Ensure main content is always visible */
main {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Hide loading screen by default */
#loading-screen {
    display: none !important;
}

/* Fallback to ensure content is visible */
main {
    animation: makeVisible 3s ease-in-out forwards;
}

@keyframes makeVisible {
    0% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 1 !important;
    }
}

/* Force visibility after 4 seconds */
@media screen {
    main {
        animation: makeVisible 4s ease-in-out forwards, forceVisible 0.1s ease-in-out 4s forwards;
    }
    
    @keyframes forceVisible {
        to {
            opacity: 1 !important;
            visibility: visible !important;
        }
    }
}

/* Keyframe Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

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

@keyframes glow {
    from {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    }
    to {
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
    }
}

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

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

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #00d4ff;
}

/* Navigation Styles */
#navbar {
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(51, 51, 51, 0.3);
    height: 80px; /* Fixed navbar height */
}

#navbar.scrolled {
    background: rgba(26, 26, 26, 0.95);
    border-bottom: 1px solid rgba(51, 51, 51, 0.5);
}

/* Ensure main content starts below the navbar */
#home {
    padding-top: 80px; /* Match navbar height */
    margin-top: 0;
    scroll-margin-top: 0; /* Override default scroll margin for home */
}

/* Add scroll offset for all sections except home */
section[id]:not(#home) {
    scroll-margin-top: 80px;
}

/* Adjust for mobile */
@media (max-width: 768px) {
    #home {
        padding-top: 70px;
        scroll-margin-top: 0;
    }
    
    #navbar {
        height: 70px;
    }
    
    section[id]:not(#home) {
        scroll-margin-top: 70px;
    }
}

.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #00d4ff;
    transition: width 0.3s ease;
}

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

/* Typewriter Effect */
.typewriter-text {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #00d4ff;
    animation: typewriter 3s steps(40) 1s 1 normal both;
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Skill Progress Bars */
.skill-progress {
    position: relative;
    background: #333333;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #4ecdc4);
    border-radius: 4px;
    transition: width 1s ease-in-out;
    position: relative;
}

.skill-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

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

/* Experience Timeline */
.timeline-item {
    position: relative;
    padding-left: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 12px;
    height: 12px;
    background: #00d4ff;
    border-radius: 50%;
    border: 3px solid #1a1a1a;
}

@media (min-width: 768px) {
    .timeline-item {
        padding-left: 0;
        width: calc(50% - 2rem);
    }
    
    .timeline-item:nth-child(odd) {
        margin-left: 0;
        text-align: right;
        padding-right: 2rem;
    }
    
    .timeline-item:nth-child(even) {
        margin-left: calc(50% + 2rem);
        text-align: left;
        padding-left: 2rem;
    }
    
    .timeline-item::before {
        left: calc(50% - 6px);
    }
    
    .timeline-item:nth-child(odd)::before {
        right: -6px;
        left: auto;
    }
}

/* Project Cards */
.project-card {
    background: #2a2a2a;
    border: 1px solid #333333;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover::before {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: #00d4ff;
    box-shadow: 0 20px 40px rgba(0, 212, 255, 0.1);
}

/* Technology Tags */
.tech-tag {
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tech-tag:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
    transform: scale(1.05);
}

/* Form Styles */
.form-input {
    background: #1a1a1a;
    border: 1px solid #333333;
    color: #ffffff;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #00d4ff, #4ecdc4);
    color: #0a0a0a;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 212, 255, 0.3);
}

/* Loading Animation */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .typewriter-text {
        font-size: 2rem;
    }
    
    .timeline-item {
        padding-left: 2rem;
    }
    
    .timeline-item::before {
        left: -6px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
*:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

/* Selection Styles */
::selection {
    background: rgba(0, 212, 255, 0.3);
    color: #ffffff;
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, #00d4ff, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(42, 42, 42, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
}



/* Enhanced Animations and Responsive Design */

/* Advanced Keyframe Animations */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes flipIn {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0deg);
    }
}

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

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

@keyframes elasticIn {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    55% {
        opacity: 1;
        transform: scale(1.1);
    }
    75% {
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Particle Animation */
@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.7;
    }
    33% {
        transform: translateY(-30px) rotate(120deg);
        opacity: 1;
    }
    66% {
        transform: translateY(-60px) rotate(240deg);
        opacity: 0.8;
    }
}

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Text Reveal Animation */
@keyframes textReveal {
    0% {
        width: 0;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        width: 100%;
        opacity: 1;
    }
}

/* Enhanced Animation Classes */
.animate-slide-in-left {
    animation: slideInFromLeft 0.8s ease-out;
}

.animate-slide-in-right {
    animation: slideInFromRight 0.8s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.6s ease-out;
}

.animate-rotate-in {
    animation: rotateIn 0.8s ease-out;
}

.animate-bounce-in {
    animation: bounceIn 0.8s ease-out;
}

.animate-flip-in {
    animation: flipIn 0.6s ease-out;
}

.animate-zoom-in {
    animation: zoomIn 0.5s ease-out;
}

.animate-slide-down {
    animation: slideDown 0.6s ease-out;
}

.animate-elastic-in {
    animation: elasticIn 0.8s ease-out;
}

/* Staggered Animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* Enhanced Hover Effects */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.hover-glow {
    transition: all 0.3s ease;
    position: relative;
}

.hover-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #00d4ff, #4ecdc4);
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
    filter: blur(20px);
    transition: opacity 0.3s ease;
}

.hover-glow:hover::before {
    opacity: 0.7;
}

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Magnetic Effect */
.magnetic {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Parallax Elements */
.parallax-slow {
    transform: translateZ(0);
    will-change: transform;
}

.parallax-medium {
    transform: translateZ(0);
    will-change: transform;
}

.parallax-fast {
    transform: translateZ(0);
    will-change: transform;
}

/* Enhanced Background Effects */
.gradient-bg {
    background: linear-gradient(-45deg, #0a0a0a, #1a1a1a, #2a2a2a, #1a1a1a);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.particle-bg {
    position: relative;
    overflow: hidden;
}

.particle-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(76, 205, 196, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 107, 107, 0.05) 0%, transparent 50%);
    animation: particleFloat 20s ease-in-out infinite;
    pointer-events: none;
}

/* Enhanced Card Styles */
.glass-card {
    background: rgba(42, 42, 42, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.neon-border {
    position: relative;
    border: 2px solid transparent;
    background: linear-gradient(#2a2a2a, #2a2a2a) padding-box,
                linear-gradient(45deg, #00d4ff, #4ecdc4, #ff6b6b) border-box;
}

.morphing-card {
    border-radius: 20px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.morphing-card:hover {
    border-radius: 40px;
    transform: scale(1.02);
}

/* Enhanced Button Styles */
.btn-gradient {
    background: linear-gradient(135deg, #00d4ff, #4ecdc4);
    position: relative;
    overflow: hidden;
}

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

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

.btn-neon {
    background: transparent;
    border: 2px solid #00d4ff;
    color: #00d4ff;
    text-shadow: 0 0 10px #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    transition: all 0.3s ease;
}

.btn-neon:hover {
    background: #00d4ff;
    color: #0a0a0a;
    text-shadow: none;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
}

/* Enhanced Typography */
.text-glow {
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.text-gradient {
    background: linear-gradient(135deg, #00d4ff, #4ecdc4, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

.text-reveal {
    position: relative;
    overflow: hidden;
}

.text-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: #00d4ff;
    animation: textReveal 1s ease-out forwards;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 640px) {
    /* Mobile-specific animations */
    .mobile-slide-up {
        transform: translateY(20px);
        opacity: 0;
        transition: all 0.6s ease;
    }
    
    .mobile-slide-up.visible {
        transform: translateY(0);
        opacity: 1;
    }
    
    /* Reduce animation intensity on mobile */
    .hover-lift:hover {
        transform: translateY(-4px);
    }
    
    .hover-scale:hover {
        transform: scale(1.02);
    }
    
    /* Mobile-optimized cards */
    .mobile-card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    /* Touch-friendly buttons */
    .mobile-btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    /* Tablet adjustments */
    .tablet-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    /* Reduce motion for better performance */
    .reduce-motion {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
}

/* Enhanced Loading States */
.skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #333333 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

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

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

/* Enhanced Scroll Indicators */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #00d4ff, #4ecdc4);
    z-index: 1000;
    transition: width 0.1s ease;
}

.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: #00d4ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a0a0a;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: #4ecdc4;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 212, 255, 0.3);
}

/* Enhanced Focus States for Accessibility */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.5);
}

/* Enhanced Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .print-break {
        page-break-before: always;
    }
    
    .print-avoid-break {
        page-break-inside: avoid;
    }
}

/* Performance Optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

.optimize-animations {
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    :root {
        --shadow-color: rgba(0, 0, 0, 0.5);
        --glow-color: rgba(0, 212, 255, 0.3);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .high-contrast {
        border: 2px solid currentColor;
        background: transparent;
    }
    
    .high-contrast:hover {
        background: currentColor;
        color: var(--bg-primary);
    }
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
    .respect-motion-preference {
        animation: none !important;
        transition: none !important;
    }
    
    .respect-motion-preference:hover {
        transform: none !important;
    }
}

/* Enhanced Utility Classes */
.backdrop-blur-strong {
    backdrop-filter: blur(20px);
}

.text-shadow-glow {
    text-shadow: 0 0 10px currentColor;
}

.border-gradient {
    border-image: linear-gradient(45deg, #00d4ff, #4ecdc4) 1;
}

.shadow-neon {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.transform-gpu {
    transform: translateZ(0);
}

/* Interactive Elements */
.interactive-element {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.interactive-element:active {
    transform: scale(0.95);
}

/* Enhanced Grid Layouts */
.masonry-grid {
    column-count: 3;
    column-gap: 1rem;
    column-fill: balance;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        column-count: 1;
    }
}

