/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Place it behind all other content */
    background-color: #060821; /* Fallback color */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    background-color: #0a0e14; /* Dark background */
    color: #ffffff; /* Lighter text for dark background */
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
}

.container {
    display: flex;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    background: transparent;
    box-shadow: none;
}

/* Enhanced transitions for better UX */
.nav-link, .btn-ai, .research-card, .course-card, .publication-item, .ai-tag {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Navigation Sidebar */
.nav-sidebar {
    width: 250px;
    background: rgba(15, 22, 42, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    color: #ecf0f1;
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-header {
    padding: 0 1.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1rem;
}

.nav-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ecf0f1;
}

.nav-links {
    list-style: none;
}

.nav-link {
    display: block;
    padding: 0.8rem 1.5rem;
    color: #bdc3c7;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border-left-color: #3498db;
    transform: translateX(5px);
}

.nav-link:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Navigation Overlay for Mobile */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: #3498db;
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
}

.mobile-nav-toggle:hover {
    background: #2980b9;
    transform: scale(1.05);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
    overflow-x: hidden;
}

/* Hero Section */
.hero-section {
    background: rgba(22, 28, 54, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 3rem 2rem;
    border-radius: 15px;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.profile-section {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.profile-image {
    position: relative;
}

.profile-image img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.3);
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.ai-pulse {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #00ff88;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.profile-info h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.title {
    font-size: 1.3rem;
    color: #ecf0f1;
    margin-bottom: 0.5rem;
}

.affiliation {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 1.5rem;
}

.research-focus h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.focus-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ai-tag {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.3);
    position: relative;
    overflow: hidden;
}

.ai-tag:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.ai-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.ai-tag:hover::before {
    left: 100%;
}

/* Section Styles */
.section {
    background: rgba(22, 28, 54, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    transform: translateY(20px);
    opacity: 0;
    animation: slideInUp 0.6s ease-out forwards;
}

.section:nth-child(even) {
    animation-delay: 0.1s;
}

.section:nth-child(odd) {
    animation-delay: 0.2s;
}

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

.section h2 {
    font-size: 2rem;
    color: #ecf0f1;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 2px;
}

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

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #3498db, #2980b9);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 2rem;
}

.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    background: #3498db;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #3498db;
}

.timeline-content h3 {
    color: #ecf0f1;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.institution {
    color: #7f8c8d;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.year {
    color: #3498db;
    font-weight: 600;
}

/* Research Grid */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.research-card {
    background: rgba(30, 38, 68, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #dee2e6;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.research-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    background: rgba(52, 152, 219, 0.7);
    color: white;
}

.research-card::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;
}

.research-card:hover::before {
    left: 100%;
}

.card-icon {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.research-card:hover .card-icon {
    color: white;
}

.research-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #ecf0f1;
    transition: color 0.3s ease;
}

.research-card:hover h3 {
    color: white;
}

/* Publications */
.publication-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn.active,
.filter-btn:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-2px);
}

.publications-list {
    margin-top: 1.5rem;
}

.publication-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: transparent;
    border-radius: 10px;
    border-left: 4px solid #3498db;
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.publication-item:hover {
    background: rgba(52, 152, 219, 0.15); /* Subtle blue tint on hover */
    transform: translateX(5px) scale(1.01);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.2);
    border-left-color: #5dade2; /* Brighter blue border on hover */
}

.publication-item.filtered-out {
    opacity: 0;
    transform: translateX(-20px) scale(0.95);
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.pub-year {
    font-size: 1.2rem;
    font-weight: 700;
    color: #3498db;
    min-width: 60px;
}

.pub-content h3 {
    color: #ecf0f1;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.authors {
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 0.3rem;
}

.venue {
    color: #5d6d7e;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.pub-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: #3498db;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Courses Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.course-card {
    background: rgba(30, 38, 68, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e1e8ed;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.course-code {
    background: #3498db;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.course-card h3 {
    color: #ecf0f1;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.course-card p {
    color: #7f8c8d;
    line-height: 1.5;
}

/* AI Demos Section */
.demo-container {
    background: rgba(22, 28, 54, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.demo-container:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.25);
    border-color: rgba(52, 152, 219, 0.5);
}

.demo-container h3 {
    color: #ecf0f1;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.demo-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.image-upload-area,
.text-input-area,
.paper-input {
    background: rgba(15, 22, 42, 0.75);
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px dashed rgba(52, 152, 219, 0.5);
    text-align: center;
    color: #ecf0f1;
}

.upload-placeholder {
    cursor: pointer;
    padding: 2rem;
    transition: all 0.3s ease;
}

.upload-placeholder:hover {
    background: rgba(52, 152, 219, 0.1);
}

.upload-placeholder i {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 1rem;
}

#promptInput {
    width: 100%;
    height: 120px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(15, 22, 42, 0.75);
    color: #ecf0f1;
    border-radius: 8px;
    padding: 1rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

#promptInput:focus {
    transform: scale(1.02);
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.4);
}

#paperTitle {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(15, 22, 42, 0.75);
    color: #ecf0f1;
    border-radius: 8px;
    font-family: inherit;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

#paperTitle:focus {
    transform: scale(1.02);
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.4);
}

.analysis-results,
.text-output,
.similarity-results {
    background: rgba(15, 22, 42, 0.75);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 200px;
}

.analysis-results h4,
.text-output h4,
.similarity-results h4 {
    color: #ecf0f1;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

#analysisOutput,
#textOutput,
#similarityOutput {
    color: #bdc3c7;
    line-height: 1.6;
}

.btn-ai {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-ai:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.btn-ai:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Enhanced loading states */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

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

/* Smooth scrolling and performance */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
}

/* Enhanced mobile interactions */
@media (hover: none) and (pointer: coarse) {
    .research-card:active,
    .course-card:active {
        transform: scale(0.98);
    }
    
    .btn-ai:active {
        transform: scale(0.95);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .mobile-nav-toggle {
        display: block;
    }
    
    .nav-sidebar {
        transform: translateX(-100%);
        z-index: 1000;
    }
    
    .nav-sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .profile-section {
        flex-direction: column;
        text-align: center;
    }
    
    .demo-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .profile-info h1 {
        font-size: 2rem;
    }
    
    .research-grid,
    .courses-grid {
        grid-template-columns: 1fr;
    }
    
    .publication-item {
        flex-direction: column;
        gap: 1rem;
    }
    
    .focus-tags {
        justify-content: center;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Loading animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
