body {
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

header {
  background-size: cover;
  background-position: center top;
}

@media (max-width: 768px) {
  header {
    background-size: cover;
    background-position: center 20%;
  }
}

#background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #4b5563, #6b7280);
}

.orb {
    position: absolute;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, rgba(100, 116, 139, 0.4) 60%, transparent 100%);
    border-radius: 50%;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.8), 0 0 10px rgba(59, 130, 246, 0.5);
    animation: float 12s infinite ease-in-out, pulse 6s infinite ease-in-out;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translate(calc(40vw - 50%), calc(40vh - 50%)) scale(1.3);
        opacity: 0.9;
    }
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.8), 0 0 10px rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 35px rgba(255, 255, 255, 1), 0 0 15px rgba(59, 130, 246, 0.7);
    }
    100% {
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.8), 0 0 10px rgba(59, 130, 246, 0.5);
    }
}

.carousel {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.carousel-item {
    flex: 0 0 auto;
    transition: transform 0.3s ease;
}

.nav-link.active {
    background-color: #4b5563;
    color: #ffffff;
}

/* Hamburger and Dropdown Styles */
@media (min-width: 768px) {
    .nav-links {
        display: flex;
        justify-content: center;
        width: auto;
    }
    .hamburger {
        display: none;
    }
    .dropdown-menu {
        display: none;
    }
    .flex.justify-between {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }
    .nav-links {
        display: none;
    }
    .dropdown-menu {
        display: none;
    }
    .dropdown-menu.active {
        display: flex;
    }
    .dropdown-menu li a {
        width: 100%;
        text-align: left;
    }
}

/* Research Page Specific Styles */
.abstract-container {
    position: relative;
}

.abstract-text {
    line-height: 1.5em;
    transition: max-height 0.3s ease;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.read-more-btn:hover {
    color: #d1d5db;
}

/* Modal Styles */
#bibtex-modal {
    transition: opacity 0.3s ease;
}

#bibtex-modal:not(.hidden) {
    display: flex !important;
}

/* PDF Link Styles */
a[download] {
    text-decoration: none;
}

/* Toast Notification */
.toastify {
    font-family: 'Inter', sans-serif;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Research Item Hover Effect */
.research-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.research-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* 3D Floating Image Styles */
.floating-image {
    animation: float 6s ease-in-out infinite;
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.1),
        0 0 40px rgba(59, 130, 246, 0.2),
        inset 0 0 40px rgba(255, 255, 255, 0.1);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.floating-glow {
    animation: glow-pulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        box-shadow: 
            0 0 20px rgba(255, 255, 255, 0.1),
            0 10px 40px rgba(59, 130, 246, 0.3),
            inset 0 0 40px rgba(255, 255, 255, 0.1);
    }
    50% {
        transform: translateY(-20px) rotate(2deg);
        box-shadow: 
            0 0 30px rgba(255, 255, 255, 0.2),
            0 20px 60px rgba(59, 130, 246, 0.4),
            inset 0 0 50px rgba(255, 255, 255, 0.15);
    }
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 30px 10px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 40px 15px rgba(59, 130, 246, 0.5);
    }
}

/* Infinite Carousel Styles */
.infinite-carousel {
    display: flex;
    white-space: nowrap;
    will-change: transform;
    transition: transform 0.1s linear;
}

.infinite-carousel .carousel-item {
    flex: 0 0 auto;
    white-space: normal;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.infinite-carousel .carousel-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Gradient fade edges */
.gradient-mask {
    mask-image: linear-gradient(
        to right,
        transparent,
        black 10%,
        black 90%,
        transparent
    );
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    #floating-profile {
        display: none;
    }
    
    .infinite-carousel .carousel-item {
        min-width: 280px !important;
    }
}

@media (max-width: 768px) {
    .infinite-carousel .carousel-item {
        min-width: 250px !important;
    }
}

/* Infinite Carousel Styles */
.infinite-carousel-container {
    overflow: hidden;
    position: relative;
    width: 100%;
}

.infinite-carousel {
    display: flex;
    gap: 1rem;
    will-change: transform;
}

.infinite-carousel .carousel-item {
    flex: 0 0 auto;
    background: #1f2937;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.infinite-carousel .carousel-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

/* Scroll buttons */
.scroll-btn {
    transition: all 0.3s ease;
}

.scroll-btn:hover {
    transform: scale(1.1);
}

/* 3D Floating Image Styles */
.floating-image {
    animation: float 6s ease-in-out infinite;
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.1),
        0 0 40px rgba(59, 130, 246, 0.2),
        inset 0 0 40px rgba(255, 255, 255, 0.1);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.floating-glow {
    animation: glow-pulse 3s ease-in-out infinite;
    pointer-events: none;
}

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

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 30px 10px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 40px 15px rgba(59, 130, 246, 0.5);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .infinite-carousel .carousel-item {
        min-width: 280px !important;
        max-width: 280px !important;
    }
    
    .floating-image {
        width: 192px;
        height: 192px;
    }
}

@media (max-width: 640px) {
    .infinite-carousel .carousel-item {
        min-width: 250px !important;
        max-width: 250px !important;
    }
    
    .floating-image {
        width: 160px;
        height: 160px;
    }
}

/* Ensure all content blocks have same width */
#bio > div {
    width: 100%;
}

/* Make sure carousel items have consistent height */
.carousel-item {
    height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.carousel-item h3 {
    font-size: 1.125rem;
    line-height: 1.375;
}

.carousel-item p {
    font-size: 0.875rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* Narrative Bio Styles */
.chapter-section {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.chapter-section:nth-child(1) { animation-delay: 0.1s; }
.chapter-section:nth-child(2) { animation-delay: 0.3s; }
.chapter-section:nth-child(3) { animation-delay: 0.5s; }
.chapter-section:nth-child(4) { animation-delay: 0.7s; }
.chapter-section:nth-child(5) { animation-delay: 0.9s; }

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

.chapter-number {
    box-shadow: 0 0 20px currentColor;
    animation: pulse-number 2s ease-in-out infinite;
}

@keyframes pulse-number {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px currentColor;
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px currentColor;
    }
}

/* Enhanced prose styling */
.prose-lg p {
    font-size: 1.125rem;
    line-height: 1.75;
    margin-bottom: 1.5rem;
}

.prose-lg p:last-child {
    margin-bottom: 0;
}

/* Gradient borders */
.border-l-4 {
    position: relative;
}

.border-l-4::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, currentColor, transparent);
    opacity: 0.7;
}

/* Hover effects for chapter sections */
.chapter-section:hover .chapter-number {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.chapter-section:hover .bg-gray-800\/40 {
    background-color: rgba(31, 41, 55, 0.6);
    transition: background-color 0.3s ease;
}

/* Call to action button animation */
@keyframes pulse-cta {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
}

.bg-gradient-to-r.from-blue-600.to-purple-600 {
    animation: pulse-cta 2s ease-in-out infinite;
}

/* Scroll reveal animation */
@keyframes reveal {
    from {
        clip-path: inset(0 0 100% 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.reveal-text {
    animation: reveal 1.5s ease-out forwards;
}

/* Responsive adjustments for narrative bio */
@media (max-width: 768px) {
    .chapter-section {
        margin-left: 0;
    }
    
    .bg-gray-800\/40 {
        margin-left: 0;
        padding: 1rem;
    }
    
    .chapter-number {
        width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
    }
    
    .ml-14 {
        margin-left: 3rem;
    }
    
    .prose-lg p {
        font-size: 1rem;
        line-height: 1.6;
    }
}

/* Smooth transitions */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* Backdrop blur for modern browsers */
@supports (backdrop-filter: blur(10px)) {
    .backdrop-blur-sm {
        backdrop-filter: blur(8px);
    }
}

/* Research Carousel Styles */
.infinite-carousel.research-carousel {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
}

.infinite-carousel.research-carousel .research-card {
    flex: 0 0 auto;
    background: rgba(31, 41, 55, 0.5);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.infinite-carousel.research-carousel .research-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.infinite-carousel.research-carousel .research-card:hover {
    background: rgba(31, 41, 55, 0.8);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(59, 130, 246, 0.3);
}

.infinite-carousel.research-carousel .research-card:hover::before {
    transform: scaleX(1);
}

.infinite-carousel.research-carousel .research-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    hyphens: auto;
}

/* Dynamic text sizing for research titles */
.research-card[style*="min-height: 200px"] .research-title {
    -webkit-line-clamp: 4;
    font-size: 0.95rem !important;
    line-height: 1.3 !important;
}

.research-card[style*="min-height: 180px"] .research-title {
    -webkit-line-clamp: 3;
    font-size: 1rem !important;
    line-height: 1.35 !important;
}

.research-card[style*="min-height: 160px"] .research-title {
    -webkit-line-clamp: 2;
    font-size: 1.05rem !important;
    line-height: 1.4 !important;
}

/* Research icon animation */
.infinite-carousel.research-carousel .research-card:hover i.fa-flask {
    animation: pulse-research 1s ease-in-out infinite;
    color: #60a5fa;
}

@keyframes pulse-research {
    0%, 100% {
        transform: scale(1);
        color: #60a5fa;
    }
    50% {
        transform: scale(1.15);
        color: #93c5fd;
    }
}

/* Gradient effect animation */
.infinite-carousel.research-carousel .effect-line {
    transition: all 0.3s ease;
}

.infinite-carousel.research-carousel .research-card:hover .effect-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
}

/* Content container styling */
.flex-col.h-full.justify-between {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .infinite-carousel.research-carousel .research-card {
        min-width: 340px !important;
        max-width: 340px !important;
    }
}

@media (max-width: 768px) {
    .infinite-carousel.research-carousel {
        gap: 1rem;
    }
    
    .infinite-carousel.research-carousel .research-card {
        min-width: 300px !important;
        max-width: 300px !important;
        min-height: 150px !important;
        padding: 1rem !important;
    }
    
    .research-card[style*="min-height: 200px"] .research-title {
        -webkit-line-clamp: 5;
        font-size: 0.9rem !important;
    }
    
    .research-card[style*="min-height: 180px"] .research-title {
        -webkit-line-clamp: 4;
        font-size: 0.925rem !important;
    }
    
    .research-card[style*="min-height: 160px"] .research-title {
        -webkit-line-clamp: 3;
        font-size: 0.95rem !important;
    }
}

@media (max-width: 640px) {
    .infinite-carousel.research-carousel .research-card {
        min-width: 280px !important;
        max-width: 280px !important;
        min-height: 140px !important;
    }
    
    .research-card[style*="min-height: 200px"] .research-title {
        -webkit-line-clamp: 6;
        font-size: 0.875rem !important;
    }
    
    .research-card[style*="min-height: 180px"] .research-title {
        -webkit-line-clamp: 5;
        font-size: 0.9rem !important;
    }
    
    .research-card[style*="min-height: 160px"] .research-title {
        -webkit-line-clamp: 4;
        font-size: 0.925rem !important;
    }
}

/* Ensure proper spacing in the carousel container */
.infinite-carousel-container {
    overflow: hidden;
    position: relative;
    width: 100%;
    padding: 0.5rem 0;
}

.infinite-carousel {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* Add a subtle background pattern to cards */
.research-card {
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 20%);
}

.research-card:hover {
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 20%);
}


/* Projects Carousel Styles */
.infinite-carousel.projects-carousel {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
}

.infinite-carousel.projects-carousel .project-card {
    flex: 0 0 auto;
    background: rgba(31, 41, 55, 0.5);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.infinite-carousel.projects-carousel .project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #3b82f6);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.infinite-carousel.projects-carousel .project-card:hover {
    background: rgba(31, 41, 55, 0.8);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(16, 185, 129, 0.3);
}

.infinite-carousel.projects-carousel .project-card:hover::before {
    transform: scaleX(1);
}

/* Project title styling */
.project-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    hyphens: auto;
}

/* Dynamic text sizing for project titles */
.project-card[style*="min-height: 220px"] .project-title {
    -webkit-line-clamp: 3;
    font-size: 0.95rem !important;
    line-height: 1.3 !important;
}

.project-card[style*="min-height: 200px"] .project-title {
    -webkit-line-clamp: 2;
    font-size: 1rem !important;
    line-height: 1.35 !important;
}

.project-card[style*="min-height: 180px"] .project-title {
    -webkit-line-clamp: 2;
    font-size: 1.05rem !important;
    line-height: 1.4 !important;
}

/* Project description styling */
.project-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #d1d5db;
    line-height: 1.5;
}

/* Code icon animation */
.infinite-carousel.projects-carousel .project-card:hover i.fa-code {
    animation: spin-code 1s ease-in-out;
    color: #34d399;
}

@keyframes spin-code {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Tech tags styling */
.infinite-carousel.projects-carousel .project-card .bg-gray-700 {
    background: rgba(55, 65, 81, 0.8) !important;
    border: 1px solid rgba(75, 85, 99, 0.5);
    transition: all 0.2s ease;
}

.infinite-carousel.projects-carousel .project-card:hover .bg-gray-700 {
    background: rgba(55, 65, 81, 1) !important;
    border-color: rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

/* Gradient effect animation */
.project-effect {
    transition: all 0.3s ease;
}

.infinite-carousel.projects-carousel .project-card:hover .project-effect {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #10b981, #3b82f6, #8b5cf6);
}

/* Content container styling */
.flex-col.h-full.justify-between {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Responsive adjustments for projects */
@media (max-width: 1024px) {
    .infinite-carousel.projects-carousel .project-card {
        min-width: 320px !important;
        max-width: 320px !important;
    }
}

@media (max-width: 768px) {
    .infinite-carousel.projects-carousel {
        gap: 1rem;
    }
    
    .infinite-carousel.projects-carousel .project-card {
        min-width: 280px !important;
        max-width: 280px !important;
        min-height: 180px !important;
        padding: 1rem !important;
    }
    
    .project-card[style*="min-height: 220px"] .project-title {
        -webkit-line-clamp: 4;
        font-size: 0.9rem !important;
    }
    
    .project-card[style*="min-height: 200px"] .project-title {
        -webkit-line-clamp: 3;
        font-size: 0.925rem !important;
    }
    
    .project-card[style*="min-height: 180px"] .project-title {
        -webkit-line-clamp: 2;
        font-size: 0.95rem !important;
    }
    
    .project-desc {
        -webkit-line-clamp: 2;
        font-size: 0.875rem;
    }
}

@media (max-width: 640px) {
    .infinite-carousel.projects-carousel .project-card {
        min-width: 260px !important;
        max-width: 260px !important;
        min-height: 170px !important;
    }
    
    .project-card[style*="min-height: 220px"] .project-title {
        -webkit-line-clamp: 5;
        font-size: 0.875rem !important;
    }
    
    .project-card[style*="min-height: 200px"] .project-title {
        -webkit-line-clamp: 4;
        font-size: 0.9rem !important;
    }
    
    .project-card[style*="min-height: 180px"] .project-title {
        -webkit-line-clamp: 3;
        font-size: 0.925rem !important;
    }
    
    .project-desc {
        -webkit-line-clamp: 2;
        font-size: 0.85rem;
    }
}

/* Add a subtle background pattern to project cards */
.project-card {
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 20%);
}

.project-card:hover {
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 20%);
}

/* Ensure proper spacing for tech tags */
.mt-3.flex.flex-wrap.gap-1 {
    margin-top: 0.75rem;
}

.infinite-carousel.projects-carousel .project-card:hover .mt-3.flex.flex-wrap.gap-1 span {
    animation: float-tag 0.5s ease-out;
}

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