body {
    font-family: 'Inter', sans-serif;
    background-color: #0D1117;
    color: #C9D1D9;
    overflow-x: hidden;
}

code, .code-font {
    font-family: 'JetBrains Mono', monospace;
}

#vanta-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* This creates the dimming effect. The color is your site's dark bg. */
    /* Adjust the last value (0.7) to change opacity. 0.5 is more transparent, 0.9 is more opaque. */
    background-color: rgba(13, 17, 23, 0.7); 
    z-index: -1; /* This places the overlay between the animation and your content */
}

.section-container {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding: 8rem 1.5rem;
}

.accent-text {
    color: #58A6FF;
}

.section-heading {
    font-size: 2.25rem;
    font-weight: 700;
    color: #F0F6FC;
    margin-bottom: 4rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.section-heading::before, .section-heading::after {
    content: '';
    height: 1px;
    width: 50px;
    background-color: #30363D;
}

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

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

::-webkit-scrollbar-thumb {
    background-color: #21262D;
    border-radius: 5px;
    border: 2px solid #0D1117;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #30363D;
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: #30363D;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    position: relative;
    width: 50%;
    margin-bottom: 2rem;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: #58A6FF;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    box-shadow: 0 0 0 4px rgba(88, 166, 255, 0.3);
}

.timeline-item.left {
    left: 0;
    padding-right: 2rem;
}

.timeline-item.right {
    left: 50%;
    padding-left: 2rem;
}

.timeline-item.left::after {
    right: -8px;
}

.timeline-item.right::after {
    left: -8px;
}

.timeline-item .timeline-content {
    position: relative;
    background-color: rgba(22, 27, 34, 0.7);
    border: 1px solid #30363D;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
}

.timeline-item .timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    border-color: #58A6FF;
}

@media screen and (max-width: 768px) {
    .timeline::after {
        left: 31px;
    }
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 0;
    }
    .timeline-item.right {
        left: 0;
        padding-left: 70px;
    }
    .timeline-item::after, .timeline-item.right::after {
        left: 23px;
        top: 1.5rem;
        transform: none;
    }
    .timeline-item .timeline-content {
        width: 100%;
    }
}

/* Experience Section */
.experience-card {
    background-color: rgba(22, 27, 34, 0.7);
    border: 1px solid #30363D;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
}

.experience-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    border-color: #58A6FF;
}

/* Skills Section */
.skill-icon {
    transition: transform 0.3s ease, color 0.3s ease;
}

.skill-icon:hover {
    transform: translateY(-8px) scale(1.1);
    color: #58A6FF;
}

.skill-progress {
    height: 8px;
    border-radius: 4px;
    background-color: #21262D;
    overflow: hidden;
}

.skill-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #58A6FF, #38B2AC);
    border-radius: 4px;
    transition: width 1.5s ease-in-out;
}

/* Project Section */
.project-card {
    background-color: #161B22;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid #30363D;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 30px rgba(0,0,0,0.3);
    border-color: #58A6FF;
}

.project-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Project gallery */
.project-gallery {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.project-gallery .swiper {
    width: 100%;
    height: 100%;
}

.project-gallery .swiper-slide {
    position: relative;
}

.project-gallery img, 
.project-gallery video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-navigation {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    gap: 5px;
}

.gallery-navigation button {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(22, 27, 34, 0.7);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.gallery-navigation button:hover {
    background: rgba(88, 166, 255, 0.7);
}

/* Project Modal - Manages visibility and background overlay */
#project-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex; /* Always a flex container */
    align-items: flex-start; /* Align content to the top */
    justify-content: center;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    
    /* Controlled by JS through the '.visible' class */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;

    /* Make the modal itself scrollable */
    overflow-y: auto;
    padding: 4rem 1rem; /* Add padding for spacing */
}

/* Adjust padding for smaller screens */
@media screen and (max-width: 768px) {
    #project-modal {
        padding: 2rem 1rem;
    }
}

#project-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Content - Manages the "window" appearance and animation */
#project-modal-content {
    transform: scale(0.95);
    transition: transform 0.3s ease-in-out;
    width: 100%; /* Ensure it takes up available width */
}

#project-modal.visible #project-modal-content {
    transform: scale(1);
}
.modal-gallery-main {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 0.5rem;
    background-color: #0D1117;
    transition: all 0.3s ease-in-out;
    aspect-ratio: 16 / 9; /* Always maintain 16:9 aspect ratio */
}

/* Style for when a VIDEO is active */
.modal-gallery-main.gallery-mode-video {
    aspect-ratio: 16 / 9;
    height: auto;
}

/* Style for when an IMAGE is active */
.modal-gallery-main.gallery-mode-image {
    height: auto;
    max-height: 75vh; /* Max height to prevent huge images */
    aspect-ratio: unset;
}

.modal-gallery-main .swiper {
    width: 100%;
    height: 100%;
}

.modal-gallery-main .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: #000; /* Black background for letterboxing/pillarboxing */
}

.modal-gallery-main .swiper-slide img {
    max-width: 100%;
    max-height: 100%; 
    width: auto;
    height: auto;
    object-fit: contain;
}

.modal-gallery-main .swiper-slide video {
    max-width: 100%;
    max-height: 100%; 
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Ensure videos don't overflow their container */
.modal-gallery-main video {
    display: block; /* Prevent bottom margin */
}

.modal-gallery-thumbs-container {
    position: relative;
    padding: 0 40px; /* Space for navigation arrows */
    margin-top: 1rem;
}

.modal-gallery-thumbs {
    height: 80px; /* Default height for desktop */
}

.modal-gallery-thumbs .swiper-slide {
    height: 100%;    /* This uses the parent's fixed 80px height */
    max-width: 120px;
    aspect-ratio: 16 / 9; /* ADDED: Enforces a standard 16:9 shape */
    background-color: #000; /* ADDED: Provides black bars for non-16:9 images */
    border-radius: 0.375rem;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease, border-color 0.3s ease;
    border: 2px solid transparent;
    /* REMOVED: width: 120px; - Aspect ratio now controls the width relative to the height */
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-gallery-thumbs .swiper-slide-thumb-active {
    opacity: 1;
    border-color: #58A6FF;
}
.modal-gallery-thumbs .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* This makes the image fill the box */
}

.thumbnail-video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    pointer-events: none; /* Allows clicks to go through to the slide */
}

@media screen and (max-width: 768px) {
    .modal-gallery-thumbs {
        height: 65px; /* Smaller height on mobile */
    }
    .modal-gallery-thumbs .swiper-slide {
        width: 100px; /* Smaller width on mobile */
    }
}

@media screen and (max-width: 480px) {
    .modal-gallery-thumbs {
        height: 55px; /* Even smaller on very small screens */
    }
    .modal-gallery-thumbs .swiper-slide {
        width: 80px; /* Even smaller width */
    }
    .modal-gallery-thumbs-container {
        padding: 0 30px; /* Reduce padding for arrows */
    }
}

/* AI Chat Modal */
#ai-chat-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

#ai-chat-modal-content {
    max-height: 90vh;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.9);
}

/* AI Chat styles */
#chat-window {
    height: 400px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.chat-bubble {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
}

.user-bubble {
    background-color: #58A6FF;
    color: #FFFFFF;
    border-bottom-right-radius: 0.25rem;
}

.ai-bubble {
    background-color: #21262D;
    color: #C9D1D9;
    border-bottom-left-radius: 0.25rem;
}

.chat-project-card {
    background-color: #21262D;
    border: 1px solid #30363D;
    border-radius: 0.5rem;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.chat-project-card:hover {
    border-color: #58A6FF;
    background-color: #2D333B;
}

/* Typewriter effect */
.typewriter {
    border-right: 3px solid #58A6FF;
    white-space: nowrap;
    overflow: hidden;
    margin: 0;
    display: inline-block;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #58A6FF }
}

/* Terminal style section */
.terminal {
    background-color: #0D1117;
    border-radius: 0.5rem;
    border: 1px solid #30363D;
    font-family: 'JetBrains Mono', monospace;
}

.terminal-header {
    background-color: #161B22;
    padding: 0.5rem 1rem;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    border-bottom: 1px solid #30363D;
    display: flex;
    align-items: center;
    position: relative;
}

.terminal-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 6px;
}

.terminal-red { background-color: #F85149; }
.terminal-yellow { background-color: #F0883E; }
.terminal-green { background-color: #3FB950; }

.terminal-body {
    padding: 1rem;
    color: #C9D1D9;
}

.terminal-prompt {
    color: #58A6FF;
}

.terminal-cursor {
    display: inline-block;
    width: 10px;
    height: 18px;
    background-color: #C9D1D9;
    animation: blink 1s infinite;
    vertical-align: middle;
}

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

/* Glow effect */
.glow {
    text-shadow: 0 0 10px rgba(88, 166, 255, 0.7);
}

/* Stats counter */
.stat-counter {
    font-size: 2.5rem;
    font-weight: 700;
    color: #F0F6FC;
}

/* Testimonials */
.testimonial-card {
    background-color: rgba(22, 27, 34, 0.7);
    border: 1px solid #30363D;
    border-radius: 0.75rem;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
}

/* Blog card */
.blog-card {
    background-color: #161B22;
    border: 1px solid #30363D;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    border-color: #58A6FF;
}

/* Floating elements */
.floating {
    animation: floating 3s ease-in-out infinite;
}

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

/* Wave effect */
.wave {
    animation: wave 2s linear infinite;
}

@keyframes wave {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-15deg); }
    100% { transform: rotate(0deg); }
}

/* Tech stack section with blur */
.tech-stack-container {
    position: relative;
    background-color: rgba(22, 27, 34, 0.5);
    border-radius: 0.75rem;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid #30363D;
}

/* Page transitions */
.page-transition {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Scroll reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced navigation animations */
.nav-active {
    color: #58A6FF !important;
    text-shadow: 0 0 10px rgba(88, 166, 255, 0.5);
    transform: scale(1.05);
    transition: all 0.3s ease;
}

/* Smooth section transitions */
.section-transition {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease, transform 1s ease;
}

.section-transition.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced scroll animations */
.scroll-fade-in {
    opacity: 0;
    transform: translateY(40px);
    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);
}

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

.scroll-slide-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-slide-left.active {
    opacity: 1;
    transform: translateX(0);
}

.scroll-slide-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-slide-right.active {
    opacity: 1;
    transform: translateX(0);
}
/* Terminal Profile Picture Styles */
.terminal-profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid #58A6FF;
    float: left;
    margin-right: 15px;
    margin-bottom: 10px;
    shape-outside: circle();
    box-shadow: 0 0 15px rgba(88, 166, 255, 0.4);
    object-fit: cover; /* This ensures the image fills the circle without distortion */
}

.terminal-body p {
    /* Ensures the text clears the floating image correctly */
    overflow: hidden; 
}
/* Navigation Bar Profile Picture Styles */
.nav-logo-container {
    display: block;
    transition: transform 0.3s ease-in-out;
}

.nav-logo-pic {
    width: 45px;  /* Adjust size as needed */
    height: 45px;
    border-radius: 50%; /* Makes it a circle */
    border: 2px solid #30363D; /* Subtle border */
    object-fit: cover; /* Ensures image fills the circle without distortion */
    transition: border-color 0.3s ease;
}

.nav-logo-container:hover {
    transform: scale(1.1); /* Slightly enlarges on hover */
}

.nav-logo-container:hover .nav-logo-pic {
    border-color: #58A6FF; /* Changes border color to accent on hover */
}

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

/* Mobile-specific optimizations */
@media screen and (max-width: 767px) {
    /* Hide 3D background on mobile as a fallback */
    #vanta-bg {
        display: none !important;
    }
    
    /* Fix hero section layout on mobile */
    #home {
        padding-top: 6rem;
        padding-bottom: 4rem;
        overflow-x: hidden;
        width: 100%;
    }
    
    #home h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    #home h2 {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    #home p {
        font-size: 1rem;
    }
    
    /* Adjust hero section buttons and links */
    #home .flex.flex-wrap.gap-4 {
        justify-content: center;
        margin-top: 2rem;
    }
    
    #home .flex.flex-wrap.gap-4 a {
        margin-bottom: 0.5rem;
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    /* Adjust social links spacing */
    #home .flex.space-x-6 {
        justify-content: center;
        margin-top: 2rem;
    }
    
    /* Fix section headings on mobile */
    .section-heading {
        font-size: 1.75rem;
        margin-bottom: 2.5rem;
    }
    
    /* Ensure all content stays within screen bounds */
    .section-container {
        width: 100%;
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
        overflow-x: hidden;
    }
    
    /* Fix stat counters display */
    .stat-counter {
        font-size: 2rem;
    }
    
    /* Make sure the terminal is hidden on mobile */
    #home .terminal.floating {
        display: none;
    }
}

/* Additional tweaks for very small screens */
@media screen and (max-width: 380px) {
    #home h1 {
        font-size: 2.2rem;
    }
    
    #home h2 {
        font-size: 1.6rem;
    }
    
    /* Make buttons easier to tap */
    #home .flex.flex-wrap.gap-4 a {
        padding: 0.75rem 1rem;
    }
}
/* Mobile gradient background as fallback when Vanta is disabled */
.mobile-gradient-bg {
  background: linear-gradient(135deg, #0D1117 0%, #1A1F29 100%);
}

/* Improved mobile buttons */
.mobile-buttons {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.mobile-buttons a {
  width: 100%;
  margin-bottom: 12px;
  text-align: center;
  justify-content: center;
}

/* Fix for text overflow issues on mobile */
@media (max-width: 767px) {
  /* Fix the text overflow issues in the hero section */
  #home h2, #home p {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
  }
  
  /* Ensure content doesn't overflow the viewport */
  body {
    overflow-x: hidden;
    width: 100%;
  }
  
  /* Fix specific text elements that are being cut off */
  .text-gray-400 {
    width: 100%;
    display: inline-block;
  }
  
  /* Add some breathing room to the edges */
  .container {
    padding-left: 20px;
    padding-right: 20px;
  }
}