/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --main-bg-light: #ffffff;
    --main-bg-dark: #0a1931;
    --text-light: #000000;
    --text-dark: #ffffff;
    --accent: #185adb;
    --container-bg-light: #ffffff;
    --container-bg-dark: #1a2847;
    --nav-hover-light: #f5f5f5;
    --nav-hover-dark: #2a3757;
    --shadow-light: rgba(0,0,0,0.1);
    --shadow-dark: rgba(0,0,0,0.3);
    --border-light: rgba(128,128,128,0.2);
    --border-dark: rgba(255,255,255,0.1);
    --card-bg-light: #ffffff;
    --card-bg-dark: #1a2847;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--main-bg-light);
    color: var(--text-light);
    transition: all 0.3s ease;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

body.dark {
    background: var(--main-bg-dark);
    color: var(--text-dark);
}

/* Container - Fully Responsive */
.container {
    margin: 5vh 5vw;
    min-height: 90vh;
    background: var(--container-bg-light);
    border-radius: clamp(10px, 2vw, 20px);
    box-shadow: 0 10px 40px var(--shadow-light);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 5vh;
    margin-bottom: 5vh;
}

body.dark .container {
    background: var(--container-bg-dark);
    box-shadow: 0 10px 40px var(--shadow-dark);
}

/* Header - Fully Responsive */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(1rem, 3vw, 2rem);
    border-bottom: 1px solid var(--border-light);
    background: inherit;
    flex-wrap: wrap;
    gap: 1rem;
}

body.dark header {
    border-bottom-color: var(--border-dark);
}

/* Logo - Responsive Typography */
.logo {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.5rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--accent);
    display: flex;
    align-items: baseline;
    flex-shrink: 0;
    transition: color 0.3s ease;
    text-decoration: none; /* when used as a link */
}

body.dark .logo {
    color: #ffffff;
}

.logo .info {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(0.9rem, 2.5vw, 1.6rem);
    font-weight: 600;
    margin-left: 2px;
    transform: translateY(-0.3em);
    color: var(--accent);
    transition: color 0.3s ease;
}

body.dark .logo .info {
    color: #ffffff;
}

/* Header Right Container */
.header-right {
    display: flex;
    align-items: center;
    gap: clamp(0.8rem, 2vw, 1.5rem);
    flex-wrap: wrap;
}

/* Navigation - Mobile First Approach */
.nav {
    display: flex;
    align-items: center;
    position: relative;
}

/* Push nav area to the right on larger screens */
@media (min-width: 769px) {
    .header-right { margin-left: auto; flex-wrap: nowrap; }
    .mobile-menu-toggle { display: none; }
    nav { position: static; }
    .nav-menu {
        position: static !important;
        display: flex !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        max-height: none !important;
        overflow: visible !important;
    }
    .nav-item {
        margin: 0 !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: clamp(8px, 1.5vw, 12px) !important;
        width: auto !important;
        padding: clamp(0.5rem, 2vw, 0.8rem) clamp(0.8rem, 2.5vw, 1.2rem) !important;
    }
}

.nav-items {
    display: flex;
    align-items: center;
    gap: clamp(0.2rem, 1vw, 0.8rem);
    list-style: none;
    flex-wrap: wrap;
}

/* Ensure nav-menu (used on index) behaves like the standard horizontal nav on desktop */
.nav-menu {
    display: flex;
    align-items: center;
    gap: clamp(0.2rem, 1vw, 0.8rem);
    list-style: none;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: relative;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--text-light);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

body.dark .mobile-menu-toggle span {
    background: var(--text-dark);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: clamp(0.5rem, 2vw, 0.8rem) clamp(0.8rem, 2.5vw, 1.2rem);
    border-radius: clamp(8px, 1.5vw, 12px);
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: clamp(0.8rem, 2vw, 1rem);
    white-space: nowrap;
}

.nav-item:hover {
    background: var(--nav-hover-light);
    transform: translateY(-2px);
}

body.dark .nav-item:hover {
    background: var(--nav-hover-dark);
}

.nav-item.active {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(24, 90, 219, 0.3);
}

.nav-item i {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    flex-shrink: 0;
}

/* Navigation Dropdown Styles */
.nav-item.dropdown {
    position: relative;
    cursor: pointer;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0; /* let parent .nav-item control padding */
    border-radius: 0; /* avoid nested rounded background */
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    width: 100%;
    cursor: pointer;
}

/* Use parent .nav-item hover styling for consistency */
.dropdown-trigger:hover { background: transparent; }
body.dark .dropdown-trigger:hover { background: transparent; }

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.nav-item.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

body.dark .dropdown-menu {
    background: var(--container-bg-dark);
    border-color: var(--border-dark);
    box-shadow: 0 4px 15px var(--shadow-dark);
}

.nav-item.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    border-radius: 4px;
    margin: 0.2rem;
}

.dropdown-item:hover {
    background: #f5f5f5;
    color: inherit;
}

body.dark .dropdown-item:hover {
    background: var(--nav-hover-dark);
}

.dropdown-item i {
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Floating Language Selector */
.floating-language-selector {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.language-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--container-bg-light);
    border: 2px solid var(--accent);
    border-radius: 50%;
    cursor: pointer;
    padding: 0.8rem;
    transition: all 0.3s ease;
    width: 60px;
    height: 60px;
    box-shadow: 0 4px 20px var(--shadow-light);
}

body.dark .language-toggle {
    background: var(--container-bg-dark);
    box-shadow: 0 4px 20px var(--shadow-dark);
}

.language-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px var(--shadow-light);
}

body.dark .language-toggle:hover {
    box-shadow: 0 6px 25px var(--shadow-dark);
}

.flag-img {
    width: 28px;
    height: 20px;
    object-fit: cover;
    border-radius: 3px;
}

.language-dropdown {
    position: absolute;
    bottom: 60px;
    right: 0;
    background: var(--container-bg-light);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 0.8rem;
    min-width: 180px;
    box-shadow: 0 10px 30px var(--shadow-light);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

body.dark .language-dropdown {
    background: var(--container-bg-dark);
    border-color: var(--border-dark);
    box-shadow: 0 10px 30px var(--shadow-dark);
}

.language-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
    width: 100%;
}

.language-item:hover {
    background: var(--nav-hover-light);
}

body.dark .language-item:hover {
    background: var(--nav-hover-dark);
}

.language-item.active {
    background: var(--accent);
    color: #ffffff;
}

.language-item .flag-img {
    width: 24px;
    height: 18px;
    flex-shrink: 0;
}

.language-item .lang-name {
    white-space: nowrap;
    font-weight: 500;
}

/* Theme Toggle - Responsive */
.theme-toggle {
    background: none;
    border: 2px solid var(--accent);
    border-radius: 50px;
    cursor: pointer;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--accent);
    padding: clamp(0.6rem, 1.5vw, 0.8rem);
    transition: all 0.3s ease;
    width: clamp(40px, 8vw, 55px);
    height: clamp(40px, 8vw, 55px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--accent);
    color: #ffffff;
    transform: rotate(180deg);
}

/* Main Content - Responsive */
main {
    flex: 1;
    padding: clamp(2rem, 5vw, 4rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

main h1 {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(2rem, 6vw, 4.5rem);
    margin-bottom: clamp(1rem, 3vw, 2rem);
    color: var(--accent);
    font-weight: 800;
    line-height: 1.2;
    transition: color 0.3s ease;
}

body.dark main h1 {
    color: #ffffff;
}

.eye-icon {
    transform: rotate(0deg);
    display: inline-block;
    transition: transform 0.3s ease;
    margin: 0 0.05em;
    font-size: 0.6em;
    vertical-align: middle;
}

main p {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    opacity: 0.8;
    max-width: 100%;
    line-height: 1.6;
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.equation-container {
    text-align: center;
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(24, 90, 219, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(24, 90, 219, 0.1);
}

.equation-legend {
    font-size: clamp(0.8rem, 2vw, 1rem);
    margin-top: 1rem;
    opacity: 0.7;
    font-style: italic;
}

body.dark .equation-container {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Footer - Responsive */
footer {
    text-align: center;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    font-size: clamp(0.8rem, 2vw, 1rem);
    opacity: 0.6;
    border-top: 1px solid var(--border-light);
    position: relative;
}

body.dark footer {
    border-top-color: var(--border-dark);
}

/* Tablet Styles */
@media (max-width: 1024px) {
    .container {
        margin: 3vh 3vw;
    }
    
    .nav-item span {
    display: inline;
    color: inherit;
    }
}

/* Mobile Landscape */
@media (max-width: 768px) {
    .container {
        margin: 2vh 2vw;
        border-radius: 15px;
    }
    
    header {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start; /* place items from left to right */
        gap: 0.75rem;
        padding: 1rem 1.5rem;
        position: relative;
    }
    
    .header-right { display: flex; align-items: center; gap: 0.75rem; }
    
    .mobile-menu-toggle { display: flex; order: 1; }
    
    .theme-toggle {
    display: flex;
    order: 3; /* right */
    }
    
    nav { order: 2; position: relative; flex: 1; }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 0; /* anchor to left so it feels left-aligned */
        right: 0;
        background: var(--container-bg-light);
        border: 1px solid var(--border-light);
        border-radius: 12px;
        padding: 1.5rem;
        z-index: 2001;
        box-shadow: 0 8px 25px var(--shadow-light);
        max-height: 80vh;
        overflow-y: auto;
    }
    
    body.dark .nav-menu {
        background: var(--container-bg-dark);
        border-color: var(--border-dark);
        box-shadow: 0 8px 25px var(--shadow-dark);
    }
    
    .nav-menu.active {
        display: block;
    }
    
    .nav-item {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1rem 1.5rem;
        margin: 0.5rem 0;
    background: var(--main-bg-light);
        border: 1px solid var(--border-light);
        border-radius: 8px;
    color: var(--text-light);
        text-decoration: none;
        font-size: 1.1rem;
        font-weight: 500;
        transition: all 0.3s ease;
    width: 100%; /* full-width tap target */
    }
    
    body.dark .nav-item {
        background: var(--main-bg-dark);
        border-color: var(--border-dark);
        color: var(--text-dark);
    }
    
    .nav-item:hover {
        background: var(--nav-hover-light);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    
    body.dark .nav-item:hover {
        background: var(--nav-hover-dark);
        box-shadow: 0 4px 12px rgba(255,255,255,0.1);
    }
    
    .nav-item.active {
        background: var(--accent);
        color: white;
        border-color: var(--accent);
    }
    
    .nav-item i {
        font-size: 1.2rem;
        width: 24px;
        text-align: center;
    color: inherit;
    }
    
    .dropdown-menu {
        position: static;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        margin: 0.5rem 0 0 0;
        border-left: none;
        padding-left: 0;
        width: 100%;
        display: none; /* collapsed by default on mobile */
    }

    /* Show submenu only when user expands */
    .nav-item.dropdown.open .dropdown-menu {
        display: block;
    }

    /* Rotate arrow when open on mobile */
    .nav-item.dropdown.open .dropdown-arrow {
        transform: rotate(180deg);
    }
    
    
    .dropdown-item {
        display: flex;
        align-items: center;
        gap: 0.8rem;
        padding: 0.9rem 1.2rem;
        margin: 0.35rem 0;
        background: var(--main-bg-light);
        border: 1px solid var(--border-light);
        border-radius: 8px;
        color: var(--text-light);
        text-decoration: none;
        font-size: 1rem;
        transition: all 0.3s ease;
        width: 100%;
    }
    
    body.dark .dropdown-item {
        background: var(--main-bg-dark);
        border-color: var(--border-dark);
        color: var(--text-dark);
    }
    
    .dropdown-item:hover {
        background: var(--nav-hover-light);
        transform: translateX(5px);
    }
    
    body.dark .dropdown-item:hover {
        background: var(--nav-hover-dark);
    }
    
    .floating-language-selector {
        top: 15px;
        right: 15px;
    }
    
    .language-toggle {
        width: 50px;
        height: 50px;
        padding: 0.6rem;
    }
    
    .flag-img {
        width: 24px;
        height: 18px;
    }
    
    .language-dropdown {
        top: 60px;
        min-width: 160px;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .container {
        margin: 1vh 1vw;
        border-radius: 10px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        min-width: 180px;
        right: -1rem;
    }
    
    .nav-item {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
    
    .theme-toggle {
        width: 45px;
        height: 45px;
    }
    
    .floating-language-selector {
        top: 10px;
        right: 10px;
    }
    
    .language-toggle {
        width: 45px;
        height: 45px;
        padding: 0.5rem;
    }
    
    .flag-img {
        width: 22px;
        height: 16px;
    }
    
    .language-dropdown {
        top: 55px;
        min-width: 140px;
        padding: 0.6rem;
    }
    
    .language-item {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Very Small Screens */
@media (max-width: 320px) {
    .container {
        margin: 0.5vh 0.5vw;
        border-radius: 8px;
    }
    
    header {
        padding: 1rem;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-menu-toggle span {
        width: 20px;
        height: 2px;
    }
    
    .nav-menu {
        min-width: 160px;
        padding: 0.8rem;
    }
    
    .nav-item {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .container {
        box-shadow: 0 5px 20px var(--shadow-light);
    }
    
    body.dark .container {
        box-shadow: 0 5px 20px var(--shadow-dark);
    }
}

/* Landscape Orientation on Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        margin: 2vh 5vw;
    }
    
    header {
        padding: 1rem 2rem;
    }
    
    main {
        padding: 1.5rem 2rem;
    }
    
    footer {
        padding: 1rem 2rem;
    }
}

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

/* Print Styles */
@media print {
    .theme-toggle {
        display: none;
    }
    
    .container {
        box-shadow: none;
        margin: 0;
        background: white;
        color: black;
    }
}

/* About Page Specific Styles */
.about-content {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.7;
}

.about-content h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-size: 2.5rem;
    font-weight: 600;
}

.about-content h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.about-content h3 {
    color: var(--text-color);
    font-size: 1.2rem;
    margin: 1.5rem 0 0.8rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.intro-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--accent-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.current-position,
.research-interests,
.academic-journey,
.collaborations,
.publications-section {
    margin-bottom: 2.5rem;
}

.journey-item,
.collaboration-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.journey-item:hover,
.collaboration-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.about-content a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.about-content a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.about-content p {
    margin-bottom: 1rem;
    text-align: justify;
}

.about-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Dark theme adjustments for about page */
[data-theme="dark"] .intro-section,
[data-theme="dark"] .journey-item,
[data-theme="dark"] .collaboration-item {
    background: var(--card-bg);
    border-color: var(--accent-color);
}

[data-theme="dark"] .about-content h2 {
    border-bottom-color: var(--accent-color);
}

/* Responsive adjustments for about page */
@media (max-width: 768px) {
    .about-content {
        padding: 0 1rem;
    }
    
    .about-content h1 {
        font-size: 2rem;
    }
    
    .about-content h2 {
        font-size: 1.3rem;
    }
    
    .intro-section,
    .journey-item,
    .collaboration-item {
        padding: 1rem;
    }
}

/* Name Explanation Popup */
.name-explanation-link {
    color: var(--accent-color);
    cursor: pointer;
    text-decoration: underline;
    font-weight: 500;
}

.name-explanation-link:hover {
    color: var(--primary-color);
}

.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff !important;
    color: #2c3e50 !important;
    padding: 3rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    max-width: 650px;
    width: 85%;
    max-height: 75vh;
    overflow-y: auto;
    border: none;
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    font-weight: 300;
    color: #64748b !important;
    cursor: pointer;
    line-height: 1;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: rgba(100, 116, 139, 0.1);
}

.popup-close:hover {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.1);
    transform: scale(1.1);
}

.popup-content p {
    margin: 0;
    line-height: 1.7;
    color: #475569 !important;
    font-size: 16px;
    text-align: justify;
}

/* Dark theme popup override */
[data-theme="dark"] .popup-content {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .popup-close {
    color: #94a3b8 !important;
    background: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .popup-close:hover {
    color: #f87171 !important;
    background: rgba(248, 113, 113, 0.15);
}

[data-theme="dark"] .popup-content p {
    color: #cbd5e1 !important;
}

/* Enhanced link styles for about page */
.about-content a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.about-content a:hover {
    color: #1d4ed8;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.08));
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Dark theme link styles */
[data-theme="dark"] .about-content a {
    color: #60a5fa;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(96, 165, 250, 0.08));
    border-color: rgba(96, 165, 250, 0.3);
}

[data-theme="dark"] .about-content a:hover {
    color: #93c5fd;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(96, 165, 250, 0.1));
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.25);
}

/* Enhanced name explanation link */
.name-explanation-link {
    color: #8b5cf6 !important;
    cursor: pointer;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(139, 92, 246, 0.25);
    transition: all 0.3s ease;
    display: inline-block;
    margin: 0 2px;
}

.name-explanation-link:hover {
    color: #7c3aed !important;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.08));
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] .name-explanation-link {
    color: #a78bfa !important;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.15), rgba(167, 139, 250, 0.08));
    border-color: rgba(167, 139, 250, 0.3);
}

[data-theme="dark"] .name-explanation-link:hover {
    color: #c4b5fd !important;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(167, 139, 250, 0.1));
    border-color: rgba(167, 139, 250, 0.5);
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.25);
}

/* Enhanced about content spacing */
.about-content {
    max-width: 1000px;
    margin: 0 auto;
    line-height: 1.8;
    padding: 2rem;
}

.about-content p {
    margin-bottom: 1.5rem;
    font-size: 16px;
    text-align: justify;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .popup-content {
        width: 92%;
        padding: 2rem 1.5rem;
        border-radius: 12px;
    }
    
    .about-content {
        padding: 1rem;
    }
}

/* Inline photo styling */
.inline-photo-right {
    float: right;
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    margin: 0 0 1rem 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.inline-photo-right:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .inline-photo-right {
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .inline-photo-right:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

/* Clear float after paragraphs with photos */
.about-content p:has(.inline-photo-right) {
    overflow: hidden;
    min-height: 140px;
    margin-bottom: 2rem;
}

/* Responsive adjustments for inline photos */
@media (max-width: 768px) {
    .inline-photo-right {
        width: 100px;
        height: 100px;
        margin: 0 0 1rem 1rem;
        border-radius: 8px;
    }
    
    .about-content p:has(.inline-photo-right) {
        min-height: 120px;
    }
}

@media (max-width: 480px) {
    .inline-photo-right {
        float: none;
        display: block;
        margin: 0 auto 1rem auto;
        width: 100px;
        height: 100px;
    }
    
    .about-content p:has(.inline-photo-right) {
        min-height: auto;
        text-align: center;
    }
}

/* CV Page Styles */
.cv-content {
    max-width: none;
    margin: 0;
    padding: 0 1rem;
    width: 100%;
}

/* Override main padding for CV page */
main:has(.cv-content) {
    padding: 2rem 1rem;
}

.cv-section {
    margin: 0 0 3rem 0;
    background: var(--container-bg-light);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px var(--shadow-light);
    border-left: 4px solid var(--accent);
    width: 100%;
}

body.dark .cv-section {
    background: var(--container-bg-dark);
    box-shadow: 0 2px 10px var(--shadow-dark);
}

.cv-section h2 {
    color: var(--accent);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 0.5rem;
}

body.dark .cv-section h2 {
    border-bottom-color: var(--border-dark);
}

.cv-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

body.dark .cv-item {
    border-bottom-color: var(--border-dark);
}

.cv-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cv-item h3 {
    color: var(--text-light);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

body.dark .cv-item h3 {
    color: var(--text-dark);
}

.institution {
    color: var(--accent);
    font-weight: 500;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.description {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

body.dark .description {
    color: var(--text-dark);
}

.cv-item ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.cv-item li {
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

body.dark .cv-item li {
    color: var(--text-dark);
}

.skills-grid {
    margin-top: 1rem;
}

.skill-category h4 {
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.skill-category ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-category li {
    color: var(--text-light);
    font-weight: 500;
}

body.dark .skill-category li {
    color: var(--text-dark);
}

.skill-category li:not(:last-child)::after {
    content: " •";
    margin-left: 0.5rem;
    color: var(--accent);
}

/* Publication Table Layout */
.publication-table {
    background: var(--nav-hover-light);
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid rgba(129, 140, 248, 0.1);
    overflow: hidden;
}

body.dark .publication-table {
    background: var(--nav-hover-dark);
    border-color: rgba(129, 140, 248, 0.2);
}

.publication-header-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(129, 140, 248, 0.1);
    background: rgba(129, 140, 248, 0.05);
}

body.dark .publication-header-row {
    background: rgba(129, 140, 248, 0.1);
    border-bottom-color: rgba(129, 140, 248, 0.2);
}

.publication-type-year {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.pub-type {
    background: var(--accent);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.pub-year {
    background: rgba(129, 140, 248, 0.2);
    color: var(--accent);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.publication-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-light);
    line-height: 1.4;
    text-align: left;
    margin-bottom: 0.5rem;
}

body.dark .publication-title {
    color: var(--text-dark);
}

.publication-title-section {
    flex: 1;
    align-self: center;
}

.publication-authors {
    font-size: 1rem;
    color: var(--text-light);
    text-align: left;
}

body.dark .publication-authors {
    color: var(--text-dark);
}

.author-name-bold {
    font-weight: 700;
}

.publication-content-row {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    gap: 1.5rem;
    padding: 1.5rem;
    align-items: start;
}

.publication-logo {
    display: flex;
    justify-content: center;
    align-items: stretch;
    padding: 0;
}

.journal-logo {
    width: 100%;
    height: 100%;
    min-height: 132px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(129, 140, 248, 0.1);
}

.publication-excerpt {
    flex: 1;
}

.journal-submission {
    color: var(--text-light);
    font-style: italic;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-align: left;
}

body.dark .journal-submission {
    color: var(--text-dark);
}

.journal-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.journal-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.excerpt-text {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    text-align: left;
}

body.dark .excerpt-text {
    color: var(--text-dark);
}

.read-abstract-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
}

.read-abstract-btn:hover {
    color: var(--primary);
}

.read-abstract-btn i {
    transition: transform 0.3s ease;
}

.read-abstract-btn.expanded i {
    transform: rotate(180deg);
}

.full-abstract {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(129, 140, 248, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

body.dark .full-abstract {
    background: rgba(129, 140, 248, 0.1);
}

.full-abstract p {
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
    text-align: left;
}

body.dark .full-abstract p {
    color: var(--text-dark);
}

.publication-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-width: 120px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-align: center;
    justify-content: center;
}

.doi-btn {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.doi-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

.download-btn {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.download-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    transform: translateY(-1px);
}

.download-btn.disabled {
    background: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.2);
    cursor: not-allowed;
    opacity: 0.6;
}

.download-btn.disabled:hover {
    background: rgba(156, 163, 175, 0.1);
    transform: none;
    cursor: not-allowed;
}

.contact-btn {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.contact-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    transform: translateY(-1px);
}

.in-review-btn {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.2);
    cursor: default;
}

.in-review-btn:hover {
    background: rgba(249, 115, 22, 0.15);
}

.in-press-btn {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
    cursor: default;
}

.in-press-btn:hover {
    background: rgba(34, 197, 94, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
    .publication-header-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .publication-type-year {
        flex-direction: row;
        min-width: auto;
    }
    
    .publication-content-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .publication-logo {
        justify-content: flex-start;
    }
    
    .journal-logo {
        width: 50px;
        height: 50px;
    }
    
    .publication-actions {
        flex-direction: row;
        flex-wrap: wrap;
        min-width: auto;
    }
    
    .action-btn {
        flex: 1;
        min-width: 100px;
    }
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(24, 90, 219, 0.3);
}

.btn-primary:hover {
    background: #1248a3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(24, 90, 219, 0.4);
}

/* Publications Page Styles */
.publications-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.publication-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
    justify-content: center;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--container-bg-light);
    color: var(--text-light);
    border: 2px solid var(--border-light);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

body.dark .filter-btn {
    background: var(--container-bg-dark);
    color: var(--text-dark);
    border-color: var(--border-dark);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(24, 90, 219, 0.3);
}

.publication-section {
    margin-bottom: 4rem;
}

.publication-section h2 {
    color: var(--accent);
    font-size: 1.8rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 3px solid var(--accent);
    padding-bottom: 0.5rem;
}

.publication-item {
    background: var(--container-bg-light);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px var(--shadow-light);
    border-left: 4px solid var(--accent);
    transition: all 0.3s ease;
}

body.dark .publication-item {
    background: var(--container-bg-dark);
    box-shadow: 0 2px 10px var(--shadow-dark);
}

.publication-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--shadow-light);
}

body.dark .publication-item:hover {
    box-shadow: 0 4px 20px var(--shadow-dark);
}

.publication-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.publication-title {
    color: var(--text-light);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

body.dark .publication-title {
    color: var(--text-dark);
}

.publication-year {
    background: var(--accent);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    flex-shrink: 0;
}

.publication-authors {
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

body.dark .publication-authors {
    color: var(--text-dark);
}

.publication-journal {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1rem;
}

.publication-abstract {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    text-align: justify;
}

body.dark .publication-abstract {
    color: var(--text-dark);
}

.publication-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.pub-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--nav-hover-light);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
}

body.dark .pub-link {
    background: var(--nav-hover-dark);
    color: var(--text-dark);
    border-color: var(--border-dark);
}

.pub-link:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(24, 90, 219, 0.3);
}

.publication-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
    padding: 2rem;
    background: var(--nav-hover-light);
    border-radius: 12px;
}

body.dark .publication-stats {
    background: var(--nav-hover-dark);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

body.dark .stat-label {
    color: var(--text-dark);
}

/* Responsive adjustments for CV and Publications */
@media (max-width: 768px) {
    .cv-content,
    .publications-content {
        padding: 1rem;
    }
    
    .cv-section,
    .publication-item {
        padding: 1.5rem;
    }
    
    .publication-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .publication-title {
        font-size: 1.1rem;
    }
    
    .publication-year {
        align-self: flex-start;
    }
    
    .skills-grid {
        margin-top: 1rem;
    }
    
    .skill-category ul {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .skill-category li:not(:last-child)::after {
        content: "";
        margin-left: 0;
    }
    
    .skill-category li::before {
        content: "• ";
        color: var(--accent);
    }
    
    .publication-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-btn {
        justify-content: center;
    }
    
    .publication-links {
        flex-direction: column;
    }
    
    .pub-link {
        justify-content: center;
    }
    
    .publication-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* CV Timeline Styles */
.cv-timeline-item {
    display: grid;
    grid-template-columns: 120px 200px 1fr;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
}

body.dark .cv-timeline-item {
    border-bottom-color: var(--border-dark);
}

.cv-timeline-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cv-logo-column {
    display: flex;
    justify-content: center;
    align-items: center;
}

.cv-date-column {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    text-align: left;
}

.cv-date {
    font-weight: 600;
    color: var(--accent);
    font-size: 0.9rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.cv-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-light);
}

body.dark .cv-logo {
    box-shadow: 0 2px 8px var(--shadow-dark);
}

.cv-content-column {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.cv-position {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
    margin: 0;
    line-height: 1.4;
}

body.dark .cv-position {
    color: var(--text-dark);
}

.cv-expandable {
    margin-top: 0.5rem;
}

.cv-read-more {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
}

.cv-read-more:hover {
    color: #1d4ed8;
}

.cv-read-more i {
    transition: transform 0.3s ease;
}

.cv-read-more.expanded i {
    transform: rotate(180deg);
}

.cv-details {
    margin-top: 0.75rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
    text-align: left;
}

.cv-details p {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary-light);
}

.cv-details p:last-child {
    margin-bottom: 0;
}

.cv-details strong {
    color: var(--accent);
    font-weight: 600;
}

.cv-details ul {
    margin: 0.5rem 0 1rem 1.5rem;
    padding: 0;
}

.cv-details li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary-light);
}

body.dark .cv-details {
    background: rgba(59, 130, 246, 0.1);
}

body.dark .cv-details p,
body.dark .cv-details li {
    color: var(--text-secondary-dark);
}

body.dark .cv-details strong {
    color: #60a5fa;
}

.research-interests {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-light);
    margin: 0;
    text-align: center;
    font-weight: 500;
}

body.dark .research-interests {
    color: var(--text-dark);
}

/* CV Awards - 2 column layout (no logo) */
.cv-award-item {
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
}

/* CV Presentations - 3 column layout (date, content, download) */
.cv-presentation-item {
    grid-template-columns: 200px 1fr 250px;
    gap: 1.5rem;
    align-items: start;
}

.cv-download-column {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 0.5rem;
}

.cv-links-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.cv-links-group .btn-secondary {
    width: 100%;
    justify-content: center;
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
}

.cv-download-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(59, 130, 246, 0.2);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent), #1d4ed8);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

body.dark .btn-secondary {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

body.dark .btn-secondary:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.4);
}

body.dark .cv-description {
    color: var(--text-dark);
}

/* Responsive CV Timeline */
@media (max-width: 768px) {
    .cv-timeline-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .cv-date-column {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 1rem;
    }
    
    .cv-date {
        margin-bottom: 0;
    }
    
    .cv-logo {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .cv-date-column {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .cv-date {
        font-size: 0.8rem;
    }
    
    .cv-logo {
        width: 35px;
        height: 35px;
    }
}

/* Python Packages Page Styles */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

/* Force dropdown menu to be solid - override any glassy effects */
body .dropdown-menu {
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;
    border: 1px solid #d0d0d0 !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

body.dark .dropdown-menu {
    background: var(--container-bg-dark) !important;
    border-color: var(--border-dark) !important;
    box-shadow: 0 4px 15px var(--shadow-dark) !important;
}

body .dropdown-item {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body .dropdown-item:hover {
    background: #f5f5f5 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.dark .dropdown-item:hover {
    background: var(--nav-hover-dark) !important;
}

.package-card {
    background: var(--card-bg-light);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: left;
}

body.dark .package-card {
    background: var(--card-bg-dark);
    border-color: var(--border-dark);
}

.package-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px var(--shadow-light);
}

body.dark .package-card:hover {
    box-shadow: 0 8px 25px var(--shadow-dark);
}

.package-card.coming-soon {
    border: 2px dashed var(--border-light);
    text-align: center;
    background: var(--main-bg-light);
}

body.dark .package-card.coming-soon {
    border-color: var(--border-dark);
    background: var(--main-bg-dark);
}

.package-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    text-align: left;
}

.package-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
}

.package-title i {
    color: var(--accent);
    font-size: 1.2rem;
}

.package-title h3 {
    margin: 0;
    color: var(--text-light);
    font-size: 1.25rem;
    font-weight: 600;
    text-align: left;
}

body.dark .package-title h3 {
    color: var(--text-dark);
}

.package-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-category {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-status {
    background: #e8f5e8;
    color: #2e7d32;
}

.package-description {
    margin-bottom: 1.5rem;
    text-align: left;
}

.package-description p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 0.5rem;
    text-align: left;
}

body.dark .package-description p {
    color: var(--text-dark);
}

.package-description p:first-child {
    font-weight: 600;
    color: var(--accent);
    text-align: left;
}

.package-excerpt {
    text-align: left;
}

.excerpt-text, .full-text {
    text-align: left;
    margin-bottom: 0.75rem;
}

.read-more-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: underline;
    padding: 0;
    margin-bottom: 0.5rem;
    text-align: left;
}

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

.package-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid;
}

.github-btn {
    background: #24292e;
    color: white;
    border-color: #24292e;
}

.github-btn:hover {
    background: #1a1e23;
    transform: translateY(-1px);
}

.pypi-btn {
    background: #3775a9;
    color: white;
    border-color: #3775a9;
}

.pypi-btn:hover {
    background: #2a5a87;
    transform: translateY(-1px);
}

.docs-btn {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.docs-btn:hover {
    background: #2196f3;
    transform: translateY(-1px);
}

.contact-btn {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

.contact-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}

/* Responsive Design for Packages */
@media (max-width: 768px) {
    .packages-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .package-actions {
        flex-direction: column;
    }
    
    .action-btn {
        justify-content: center;
    }
    
    .package-header {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Resources Page Styles */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.resource-card {
    background: var(--card-bg-light);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: left;
}

body.dark .resource-card {
    background: var(--card-bg-dark);
    border-color: var(--border-dark);
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px var(--shadow-light);
}

body.dark .resource-card:hover {
    box-shadow: 0 8px 25px var(--shadow-dark);
}

.resource-card.coming-soon {
    border: 2px dashed var(--border-light);
    text-align: center;
    background: var(--main-bg-light);
}

body.dark .resource-card.coming-soon {
    border-color: var(--border-dark);
    background: var(--main-bg-dark);
}

.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    text-align: left;
}

.resource-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
}

.resource-title i {
    color: var(--accent);
    font-size: 1.2rem;
}

.resource-title h3 {
    margin: 0;
    color: var(--text-light);
    font-size: 1.25rem;
    font-weight: 600;
    text-align: left;
}

body.dark .resource-title h3 {
    color: var(--text-dark);
}

.resource-description {
    margin-bottom: 1.5rem;
    text-align: left;
}

.resource-description p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 0.5rem;
    text-align: left;
}

body.dark .resource-description p {
    color: var(--text-dark);
}

.resource-excerpt {
    text-align: left;
}

.resource-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.view-btn {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.view-btn:hover {
    background: #2196f3;
    transform: translateY(-1px);
}

/* Responsive Design for Resources */
@media (max-width: 768px) {
    .resources-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .resource-actions {
        flex-direction: column;
    }
    
    .action-btn {
        justify-content: center;
    }
    
    .resource-header {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Contact Page Styles */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.contact-card {
    background: var(--card-bg-light);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

body.dark .contact-card {
    background: var(--card-bg-dark);
    border-color: var(--border-dark);
}

.contact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px var(--shadow-light);
}

body.dark .contact-card:hover {
    box-shadow: 0 8px 25px var(--shadow-dark);
}

.contact-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-icon {
    color: var(--accent);
    font-size: 1.5rem;
    width: 24px;
    text-align: center;
}

.contact-header h3 {
    margin: 0;
    color: var(--text-light);
    font-size: 1.25rem;
    font-weight: 600;
}

body.dark .contact-header h3 {
    color: var(--text-dark);
}

.contact-content {
    color: var(--text-light);
    line-height: 1.6;
}

body.dark .contact-content {
    color: var(--text-dark);
}

.contact-content p {
    margin: 0;
    color: var(--text-light);
}

body.dark .contact-content p {
    color: var(--text-dark);
}

.contact-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.contact-link:hover {
    color: #2196f3;
    text-decoration: underline;
}

.academic-profiles {
    grid-column: span 2;
}

.profile-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.profile-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.profile-link:hover {
    background: #2196f3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(63, 81, 181, 0.3);
}

.profile-link i {
    font-size: 1.2rem;
}

/* Responsive Design for Contact */
@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .academic-profiles {
        grid-column: span 1;
    }
    
    .profile-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .profile-link {
        justify-content: center;
        text-align: center;
    }
}
