/* --- SHARED STYLES --- */
body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}
.font-serif { font-family: 'Playfair Display', serif; }

#header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 50;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-link {
    position: relative;
    padding: 8px 0;
    color: #cbd5e1;
    transition: color 0.3s;
}
.nav-link:hover { color: white; }
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #38bdf8;
    transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }

.nav-link-special {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border: 1px solid #38bdf8;
    color: #38bdf8;
    border-radius: 9999px;
    transition: all 0.3s;
    font-weight: 500;
}
.nav-link-special:hover {
    background-color: #38bdf8;
    color: white;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: white;
    margin-bottom: 3rem;
}

/* --- RESEARCH PAGE (index.html) STYLES --- */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.social-link {
    color: #94a3b8;
    transition: all 0.3s;
}
.social-link:hover {
    color: #38bdf8;
    transform: scale(1.2);
}

/* Add these missing 3D background styles */
.bg-neural {
    background: radial-gradient(circle at 20% 50%, rgba(56, 189, 248, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(14, 165, 233, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 80%, rgba(56, 189, 248, 0.05) 0%, transparent 50%);
}

/* Floating particles background */
.floating-particles {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    z-index: -1; 
    overflow: hidden; 
    pointer-events: none;
    opacity: 0.3; /* Reduce opacity since we have 3D background */
}

.particle {
    position: absolute; 
    background: rgba(56, 189, 248, 0.1);
    border-radius: 50%; 
    animation: float 8s ease-in-out infinite;
}

.timeline-container { 
    position: relative; 
    max-width: 80rem; 
    margin: 4rem auto; 
    padding: 2rem 0;
}

.timeline-container::before {
    content: ''; 
    position: absolute; 
    left: 50%; 
    top: 0; 
    bottom: 0; 
    width: 4px;
    background: linear-gradient(180deg, #38bdf8, #0ea5e9, #38bdf8);
    border-radius: 2px; 
    transform: translateX(-50%);
}

.timeline-item {
    display: flex; 
    margin-bottom: 4rem; 
    align-items: flex-start;
    opacity: 0; 
    transform: translateY(30px); 
    animation: fadeInUp 0.8s forwards;
    min-height: 200px;
    position: relative;
}

/* Odd items (1st, 3rd, 5th) go to the left */
.timeline-item:nth-child(odd) { 
    justify-content: flex-start; 
}

/* Even items (2nd, 4th, 6th) go to the right */
.timeline-item:nth-child(even) { 
    justify-content: flex-end; 
}

.timeline-item:nth-child(1) { animation-delay: 0.2s; }
.timeline-item:nth-child(2) { animation-delay: 0.4s; }
.timeline-item:nth-child(3) { animation-delay: 0.6s; }
.timeline-item:nth-child(4) { animation-delay: 0.8s; }
.timeline-item:nth-child(5) { animation-delay: 1.0s; }

.timeline-content {
    width: 45%;
    max-width: 600px;
    padding: 2.5rem; 
    position: relative;
    /* Solid background like About section */
    background: rgba(30, 41, 59, 0.95) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Ensure proper margins for alternating sides */
.timeline-item:nth-child(odd) .timeline-content {
    margin-right: 5%;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: 5%;
}

.timeline-content:hover {
    transform: translateY(-8px); 
    border-color: rgba(56, 189, 248, 0.6);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(56, 189, 248, 0.2);
    background: rgba(30, 41, 59, 0.98) !important;
}

/* Improve text readability */
.timeline-content h3 {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.timeline-content p {
    color: #e2e8f0 !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

.timeline-content .text-sky-300 {
    color: #7dd3fc !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.timeline-content .text-slate-400 {
    color: #94a3b8 !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

.timeline-content .text-slate-300 {
    color: #cbd5e1 !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

.timeline-dot {
    width: 24px; 
    height: 24px; 
    background: linear-gradient(45deg, #38bdf8, #0ea5e9); 
    border-radius: 50%;
    border: 4px solid #1e293b; 
    position: absolute; 
    left: 50%;
    top: 50px;
    transform: translateX(-50%); 
    z-index: 10;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.6);
}

.glass-card { 
    background: rgba(30, 41, 59, 0.5); 
    backdrop-filter: blur(10px); 
    border: 1px solid #334155; 
    border-radius: 0.5rem; 
}

.hover-lift:hover { 
    transform: translateY(-8px); 
    transition: transform 0.3s; 
}

/* About section styles */
#about .glass-card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

#about .glass-card:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(56, 189, 248, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Publication styles */
.publication-card { 
    padding: 1.5rem; 
    background: #1e293b; 
    border-radius: 0.5rem; 
    border: 1px solid #334155; 
}

.publication-title { 
    font-size: 1.25rem; 
    font-weight: 600; 
    color: white; 
}

.publication-authors { 
    color: #94a3b8; 
    margin: 0.25rem 0 1rem 0; 
}

.publication-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.publication-button {
    background: linear-gradient(45deg, #38bdf8, #0ea5e9);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.publication-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(56, 189, 248, 0.3);
}

/* Project styles */
.project-card { 
    display: flex; 
    flex-direction: column; 
    background: #1e293b; 
    border-radius: 0.5rem; 
    padding: 1.5rem; 
    border: 1px solid #334155; 
    transition: all 0.3s; 
}

.project-card:hover { 
    transform: translateY(-5px); 
    border-color: #38bdf8; 
}

.project-title { 
    font-size: 1.25rem; 
    font-weight: 600; 
    color: white; 
    margin-bottom: 0.5rem; 
}

.project-desc { 
    color: #94a3b8; 
    flex-grow: 1; 
    margin-bottom: 1rem; 
}

.project-tags { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 0.5rem; 
    margin-top: auto; 
}

.tech-tag { 
    background: #334155; 
    color: #94a3b8; 
    font-size: 0.75rem; 
    font-weight: 500; 
    padding: 0.25rem 0.75rem; 
    border-radius: 9999px; 
}

/* Skills styles */
.skills-title { 
    font-weight: 600; 
    font-size: 1.125rem; 
    color: white; 
    margin-bottom: 0.75rem; 
    display: flex; 
    align-items: center; 
}

.skills-list { 
    color: #94a3b8; 
    line-height: 1.8; 
}

/* Leadership styles */
.leadership-card { 
    display: flex; 
    align-items: center; 
    gap: 1rem; 
    background: #1e293b; 
    padding: 1.5rem; 
    border-radius: 0.5rem; 
    border: 1px solid #334155; 
}

.leadership-card i { 
    color: #38bdf8; 
    flex-shrink: 0; 
    width: 2.5rem; 
    height: 2.5rem; 
}

.leadership-title { 
    font-weight: 600; 
    color: white; 
}

.leadership-desc { 
    color: #94a3b8; 
}

/* Modal styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 2rem;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #38bdf8;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.5rem;
    padding-right: 2rem;
}

.modal-abstract {
    color: #cbd5e1;
    line-height: 1.7;
    font-size: 1rem;
}

/* Science humor section */
#science-humor .glass-card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

#science-humor .glass-card:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

#science-humor img {
    max-width: 100%;
    height: auto;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

#science-humor img:hover {
    animation: subtle-glow 2s ease-in-out infinite;
}

@keyframes subtle-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(56, 189, 248, 0.1); }
    50% { box-shadow: 0 0 30px rgba(56, 189, 248, 0.2); }
}

/* --- LIFE PAGE (life.html) STYLES --- */
/* Two-column adventure gallery */
.adventure-gallery-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.adventure-item {
    position: relative;
    height: 900px;  
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
}

.adventure-item:hover {
    transform: scale(1.03) translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.adventure-item video,
.adventure-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.adventure-item:hover video,
.adventure-item:hover img {
    transform: scale(1.05);
}

.adventure-item-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-family: 'Playfair Display', serif;
}

.adventure-placeholder {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.2));
    border: 2px dashed rgba(251, 191, 36, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-content {
    text-align: center;
    color: #f59e0b;
}

.adventure-placeholder .adventure-item-title {
    position: static;
    background: none;
    color: #f59e0b;
    padding: 0;
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.adventure-placeholder:hover {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.3));
    border-color: rgba(251, 191, 36, 0.5);
}

.timeline-item:nth-child(even) {
    justify-content: flex-end !important;
    text-align: right !important;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: auto !important;
    margin-right: 0 !important;
}

.timeline-item:nth-child(odd) {
    justify-content: flex-start !important;
    text-align: left !important;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-left: 0 !important;
    margin-right: auto !important;
}

@media (max-width: 768px) {
    .timeline-container::before { 
        left: 30px; 
    }
    
    .timeline-item { 
        flex-direction: column !important; 
        align-items: flex-start; 
        justify-content: flex-start !important;
        margin-left: 60px;
    }
    
    .timeline-content { 
        width: calc(100% - 80px) !important; 
        margin: 0 !important;
        max-width: none;
    }
    
    .timeline-dot { 
        left: 30px; 
        top: 30px;
    }

    #science-humor .glass-card {
        padding: 1.5rem;
    }
    
    #science-humor img {
        border-radius: 0.5rem;
    }

    /* Mobile adventure gallery */
    .adventure-gallery-two-column {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .adventure-item {
        height: 600px;
    }
    
    .adventure-item-title {
        font-size: 1rem;
        padding: 1rem;
    }
    
    .adventure-placeholder .adventure-item-title {
        font-size: 1rem;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .adventure-gallery-two-column {
        max-width: 900px;
        gap: 1.5rem;
    }
}

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

/* Stats animation */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
        opacity: 0.1;
    }
    50% { 
        transform: translateY(-30px) rotate(180deg); 
        opacity: 0.3;
    }
}