/* ---=== Global Styles & Variables ===--- */
:root {
    /* Fonts */
    --font-primary: 'Roboto', 'Segoe UI', Arial, sans-serif;
    --font-secondary: 'Montserrat', 'Helvetica Neue', sans-serif;
    
    /* Light Mode Colors */
    --color-bg-light: #f0f2f5;
    --color-text-light: #2c3e50;
    --color-text-secondary-light: #5a6f82;
    --color-royal-blue: #4169E1;
    --color-royal-blue-darker: #3557B8;
    --color-link-icon-specific-blue: #0000FF;

    /* Glass Effect - Light Mode */
    --glass-bg-light: rgba(235, 240, 245, 0.65);
    --glass-bg-navbar-light: rgba(225, 235, 240, 0.75);
    --glass-border-color-light: rgba(65, 105, 225, 0.35);
    --glass-shadow-light: rgba(65, 105, 225, 0.18);

    /* Dark Mode Colors */
    --color-bg-dark: #1a1d24;
    --color-text-dark: #e8eaed;
    --color-text-secondary-dark: #a0a7b3;
    --color-royal-blue-dark-mode: #587FE7;
    --color-royal-blue-darker-dark-mode: #7A9AFF;
    --color-link-icon-specific-blue-dark-mode: #6699FF;

    /* Glass Effect - Dark Mode */
    --glass-bg-dark: rgba(40, 45, 58, 0.7);
    --glass-bg-navbar-dark: rgba(45, 50, 65, 0.8);
    --glass-border-color-dark: rgba(88, 127, 231, 0.4);
    --glass-shadow-dark: rgba(88, 127, 231, 0.15);

    /* Layout & Animation */
    --border-radius-main: 16px;
    --border-radius-small: 10px;
    --transition-speed: 0.3s;
    --backdrop-blur-amount: 9px;
    --box-shadow-light: 0 8px 32px 0 var(--glass-shadow-light);
    --box-shadow-dark: 0 8px 32px 0 var(--glass-shadow-dark);
}

/* ---=== Theme Application ===--- */
body {
    font-family: var(--font-primary);
    margin: 0;
    padding: 0;
    background-color: var(--current-bg);
    color: var(--current-text);
    line-height: 1.7;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
    overflow-x: hidden;
    padding-top: 20px;
}

/* ---=== Theme Setup ===--- */
.light-mode {
    --current-bg: var(--color-bg-light);
    --current-text: var(--color-text-light);
    --current-text-secondary: var(--color-text-secondary-light);
    
    --current-theme-accent: var(--color-royal-blue);
    --current-theme-accent-hover: var(--color-royal-blue-darker);
    --current-link-color: var(--color-link-icon-specific-blue);
    --current-icon-color: var(--color-link-icon-specific-blue);
    --current-glass-bg: var(--glass-bg-light);
    --current-glass-bg-navbar: var(--glass-bg-navbar-light);
    --current-glass-border: var(--glass-border-color-light);
    --current-box-shadow: var(--box-shadow-light);
}

.dark-mode {
    --current-bg: var(--color-bg-dark);
    --current-text: var(--color-text-dark);
    --current-text-secondary: var(--color-text-secondary-dark);
    --current-theme-accent: var(--color-royal-blue-dark-mode);
    --current-theme-accent-hover: var(--color-royal-blue-darker-dark-mode);
    --current-link-color: var(--color-link-icon-specific-blue-dark-mode);
    --current-icon-color: var(--color-link-icon-specific-blue-dark-mode);
    --current-glass-bg: var(--glass-bg-dark);
    --current-glass-bg-navbar: var(--glass-bg-navbar-dark);
    --current-glass-border: var(--glass-border-color-dark);
    --current-box-shadow: var(--box-shadow-dark);
}

/* ---=== Smooth Scrolling & Base Elements ===--- */
html {
    scroll-behavior: smooth;
    /* Enable momentum scrolling on iOS */
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: var(--font-primary);
    margin: 0;
    padding: 0;
    background-color: var(--current-bg);
    color: var(--current-text);
    line-height: 1.7;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
    overflow-x: hidden;
    padding-top: 20px;
    /* Optimize scrolling performance on mobile */
    -webkit-overflow-scrolling: touch;
    /* Prevent horizontal scroll issues on mobile */
    width: 100%;
    min-height: 100vh;
    /* Improve touch scrolling smoothness */
    overscroll-behavior: contain;
}

/* ---=== Basic Elements ===--- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-secondary);
    color: var(--current-theme-accent);
    margin-top: 1.5em;
    margin-bottom: 0.7em;
    font-weight: 700;
}

h1 { 
    font-size: 2.5em; 
    text-align: center; 
}

h2 { 
    font-size: 2em; 
    padding-bottom: 0.3em;
    border-bottom: 2px solid var(--current-theme-accent);
    margin-bottom: 1em;
}

h3 { 
    font-size: 1.6em; 
    color: var(--current-theme-accent); 
}

h4 { 
    font-size: 1.3em; 
}

p {
    margin-bottom: 1.2em;
    color: var(--current-text);
}

a {
    color: var(--current-link-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease, opacity 0.2s ease-out;
    word-break: break-word;
    overflow-wrap: break-word;
}

a:hover, 
a:focus {
    color: var(--current-link-color);
    opacity: 0.8;
    text-decoration: underline;
}

/* Icon color management */
i.fas, i.fab, i.far, i.fal { 
    color: var(--current-icon-color) !important; 
}

.btn i.fas, .btn i.fab { 
    color: white !important; 
}

.dark-mode .btn i.fas, 
.dark-mode .btn i.fab {
    color: var(--current-text-dark) !important;
}

.btn-icon i.fas, 
.btn-icon i.fab {
    color: var(--current-icon-color) !important; 
}

.btn-icon:hover i.fas, 
.btn-icon:hover i.fab {
    color: var(--current-bg) !important; 
}

ul, ol {
    margin-bottom: 1em;
    padding-left: 20px;
}

li {
    margin-bottom: 0.5em;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-small);
}

/* ---=== Header & Island Navigation ===--- */
header {
    position: sticky; 
    top: 0;
    z-index: 1000;
    padding: 20px 0; 
    height: auto; 
}

nav {
    max-width: 900px; 
    margin: 0 auto; 
    padding: 0.8em 1.5em; 
    position: relative; /* Context for mobile menu */
    
    background: var(--current-glass-bg-navbar);
    backdrop-filter: blur(var(--backdrop-blur-amount));
    -webkit-backdrop-filter: blur(var(--backdrop-blur-amount)); 
    border: 1px solid var(--current-glass-border);
    border-radius: var(--border-radius-main); 
    box-shadow: var(--current-box-shadow);

    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--transition-speed) ease, border var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}


nav .logo a {
    font-family: var(--font-secondary);
    font-size: 1.6em;
    font-weight: bold;
    color: var(--current-theme-accent); 
    text-decoration: none;
    transition: transform 0.3s ease, color var(--transition-speed) ease;
}
nav .logo a .logo-icon {
    width: 32px;
    height: 32px;
    margin-right: 8px;
    display: inline-block;
    vertical-align: middle;
}
nav .logo a:hover {
    transform: scale(1.03);
    color: var(--current-theme-accent-hover);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: var(--current-text); 
    text-decoration: none;
    font-weight: 500;
    padding: 0.4em 0.7em;
    border-radius: var(--border-radius-small);
    transition: color var(--transition-speed) ease, background-color var(--transition-speed) ease, transform 0.2s ease;
    position: relative;
}
.dark-mode nav ul li a {
    color: var(--current-text-dark);
}

nav ul li a::after { 
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -3px;
    left: 50%;
    background-color: var(--current-theme-accent); 
    transition: width 0.3s ease, left 0.3s ease, background-color var(--transition-speed) ease;
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
    left: 0;
}

nav ul li a:hover, 
nav ul li a.active {
    color: var(--current-theme-accent); 
}


#theme-toggle, #mobile-menu-toggle {
    background: none;
    border: none;
    color: var(--current-text); 
    font-size: 1.4em;
    cursor: pointer;
    padding: 0.3em 0.5em;
    border-radius: 50%;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease, transform 0.2s ease;
}
#theme-toggle i, #mobile-menu-toggle i {
    color: var(--current-text) !important; 
}
.dark-mode #theme-toggle i, .dark-mode #mobile-menu-toggle i {
    color: var(--current-text-dark) !important;
}


#theme-toggle:hover, #mobile-menu-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05); 
    transform: scale(1.1);
}
.dark-mode #theme-toggle:hover, .dark-mode #mobile-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#mobile-menu-toggle {
    display: none; /* Hidden on desktop, shown in media query */
}

/* MOBILE MENU STYLES */
#mobile-menu {
    position: absolute; /* Relative to nav */
    width: 100%; /* Full width of nav */
    left: 0;
    top: calc(100% + 8px); /* Below the nav */
    z-index: 999; /* Below nav's z-index if nav itself is very high, but above main content */

    background: var(--current-glass-bg-navbar);
    backdrop-filter: blur(var(--backdrop-blur-amount));
    -webkit-backdrop-filter: blur(var(--backdrop-blur-amount));
    border: 1px solid var(--current-glass-border);
    box-shadow: var(--current-box-shadow);
    border-radius: 0 0 var(--border-radius-main) var(--border-radius-main); /* Rounded bottom corners */
    
    max-height: 0; /* For slide animation */
    opacity: 0; /* For fade animation */
    overflow: hidden;
    padding-top: 0; /* Animated */
    padding-bottom: 0; /* Animated */
    transition: max-height 0.35s ease-in-out, opacity 0.3s ease-in-out, 
                padding-top 0.35s ease-in-out, padding-bottom 0.35s ease-in-out;
}

#mobile-menu.active { 
    max-height: 400px; /* Adjust based on number of items */
    opacity: 1;
    padding: 1em; /* Padding when open */
}

#mobile-menu ul { list-style: none; padding: 0; margin: 0; text-align: center; }
#mobile-menu ul li { margin-bottom: 0; } /* Remove bottom margin for tighter list */
#mobile-menu ul li a { 
    color: var(--current-text);
    text-decoration: none;
    font-size: 1.1em;
    display: block;
    padding: 0.8em 0.5em; /* Slightly more padding */
    border-radius: var(--border-radius-small);
    transition: background-color 0.2s ease, color 0.2s ease;
}
.dark-mode #mobile-menu ul li a { color: var(--current-text-dark); }

#mobile-menu ul li a:hover, #mobile-menu ul li a.active {
    background-color: rgba(0,0,0,0.04); /* Subtle hover */
    color: var(--current-theme-accent); 
}
.dark-mode #mobile-menu ul li a:hover, .dark-mode #mobile-menu ul li a.active {
    background-color: rgba(255,255,255,0.08); 
}


/* ---=== Main Content & Glassy Cards ===--- */
main {
    max-width: 900px;
    margin: 2em auto;
    padding: 0 20px;
    /* Ensure main content area allows touch scrolling */
    touch-action: pan-y pan-x;
    -webkit-overflow-scrolling: touch;
    /* Prevent horizontal overflow */
    overflow-x: hidden;
    width: 100%;
}

.card-style, .content-section {
    background: var(--current-glass-bg);
    backdrop-filter: blur(var(--backdrop-blur-amount));
    -webkit-backdrop-filter: blur(var(--backdrop-blur-amount));
    border: 1px solid var(--current-glass-border);
    padding: 25px 30px;
    margin-bottom: 2.5em;
    border-radius: var(--border-radius-main);
    box-shadow: var(--current-box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background var(--transition-speed) ease, border var(--transition-speed) ease;
    /* Allow touch scrolling through cards */
    touch-action: pan-y pan-x;
    /* Prevent content overflow */
    overflow-wrap: break-word;
    word-wrap: break-word;
    /* Prevent cards from blocking scroll gestures */
    pointer-events: auto;
}

.card-style:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: 0 12px 40px 0 var(--current-box-shadow); 
}

/* Ensure links and buttons within cards work properly while allowing scrolling */
.card-style a, .card-style button, .content-section a, .content-section button {
    /* Allow these elements to capture touch events for interaction */
    touch-action: auto;
    position: relative;
    z-index: 1;
}

/* Specific optimization for BibTeX and publication buttons */
.publication-links a, .publication-links-home a,
[onclick*="toggleBibtex"], [onclick*="copyBibtex"] {
    touch-action: auto !important;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1) !important;
    cursor: pointer;
}

/* ---=== Home Page Specific === */
.hero-section { 
    text-align: center;
    padding: 2.5em 1.5em;
    color: var(--current-text); 
}
.dark-mode .hero-section {
    color: var(--current-text-dark);
}
.hero-section h1 { 
    color: var(--current-theme-accent); 
    font-size: 3em;
    margin-bottom: 0.2em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}
.hero-section .subtitle, .hero-section .location { 
    font-size: 1.3em;
    margin-bottom: 0.5em;
    color: var(--current-text); 
}
.hero-section .location {
    font-size: 1em;
    margin-bottom: 1.5em;
}
.dark-mode .hero-section .subtitle, .dark-mode .hero-section .location {
    color: var(--current-text-dark);
}

.hero-section .profile-pic {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1em;
    border: 3px solid var(--current-glass-border); 
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}
.social-links {
    margin-top: 1.5em;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.social-links .btn, .btn {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--current-theme-accent);
    padding: 0.45em 0.85em;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.25s ease;
    border: 1px solid rgba(65, 105, 225, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: none;
    /* Base responsive sizing */
    font-size: clamp(0.7rem, 2vw, 0.8rem);
    min-height: 36px;
    min-width: fit-content;
    /* Flexible sizing */
    flex-shrink: 0;
    white-space: nowrap;
    /* Modern glass effect */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.dark-mode .social-links .btn, .dark-mode .btn {
     background-color: rgba(255, 255, 255, 0.05);
     color: var(--current-theme-accent);
     border: 1px solid rgba(88, 127, 231, 0.35);
}

.social-links .btn:hover, .btn:hover {
    background-color: var(--current-theme-accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(65, 105, 225, 0.25);
    color: white;
    text-decoration: none;
    border-color: var(--current-theme-accent);
}
.dark-mode .social-links .btn:hover, .dark-mode .btn:hover {
    background-color: var(--current-theme-accent);
    color: white;
    border-color: var(--current-theme-accent);
}

.btn-icon {
    padding: 0.4em 0.75em;
    background-color: transparent;
    color: var(--current-link-color);
    border: 1px solid rgba(65, 105, 225, 0.3);
    border-radius: 6px;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    /* Responsive sizing */
    font-size: clamp(0.7rem, 1.8vw, 0.8rem);
    min-height: 34px;
    white-space: nowrap;
    flex-shrink: 0;
    /* Better touch interaction */
    touch-action: auto;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    cursor: pointer;
}
/* Icon color for btn-icon is handled by global icon rule */

.btn-icon:hover {
    background-color: var(--current-link-color);
    color: white;
    border-color: var(--current-link-color);
    transform: translateY(-1px);
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 255, 0.2);
}
/* Ensure icon color changes on hover for btn-icon */
.btn-icon:hover i {
    color: white !important;
}


.news-list li {
    border-left: 3px solid var(--current-theme-accent); 
    padding-left: 15px;
    margin-bottom: 1em;
}
.news-list .date {
    font-weight: bold;
    color: var(--current-text-secondary);
    display: block;
    font-size: 0.9em;
}

/* ---=== New Publication Update Section on Homepage ===--- */
#publication-update .publication-item-home {
    padding: 10px 0; /* Add some padding if needed */
}
#publication-update .publication-title-home {
    font-size: 1.3em; /* Slightly smaller than main publication titles */
    color: var(--current-theme-accent);
    margin-bottom: 0.4em;
    word-break: break-word;
    overflow-wrap: break-word;
}
#publication-update .publication-authors-home {
    font-style: italic;
    color: var(--current-text-secondary);
    margin-bottom: 0.4em;
    font-size: 0.95em;
    word-break: break-word;
    overflow-wrap: break-word;
}
#publication-update .publication-authors-home strong {
    color: var(--current-text);
    font-weight: bold;
}
#publication-update .publication-venue-home {
    margin-bottom: 0.8em;
    font-size: 0.9em;
}
#publication-update .publication-links-home {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* Space between buttons */
    align-items: center;
}
#publication-update .publication-links-home .btn,
#publication-update .publication-links-home .btn-icon {
    font-size: 0.9em; /* Slightly smaller buttons for homepage section */
    padding: 0.5em 1em;
}


/* ---=== Publications Page ===--- */
.publication-item {
    margin-bottom: 2em;
    padding-bottom: 1.5em;
    border-bottom: 1px dashed var(--current-glass-border); 
}
.publication-item:last-child { border-bottom: none; }
.publication-title {
    font-size: 1.4em;
    margin-bottom: 0.3em;
    color: var(--current-theme-accent);
    word-break: break-word;
    overflow-wrap: break-word;
}
.publication-authors {
    font-style: italic;
    color: var(--current-text-secondary);
    margin-bottom: 0.3em;
    word-break: break-word;
    overflow-wrap: break-word;
}
.publication-authors strong { color: var(--current-text); font-weight: bold; }
.publication-venue {
    margin-bottom: 0.5em;
    word-break: break-word;
    overflow-wrap: break-word;
}

.interest-list li { margin-bottom: 0.8em; }

/* ---=== Education & Experience Page ===--- */
.entry {
    margin-bottom: 2em;
    position: relative;
    padding-left: 25px;
}
.entry::before { 
    content: '';
    position: absolute;
    left: 0px;
    top: 8px; 
    width: 12px;
    height: 12px;
    background: var(--current-theme-accent); 
    border-radius: 50%;
    border: 2px solid var(--current-bg); 
}
.entry h3 { margin-top: 0; margin-bottom: 0.2em; font-size: 1.3em; color: var(--current-theme-accent);}
.entry .institution { font-weight: bold; color: var(--current-text-secondary); margin-bottom: 0.2em; }
.entry .dates { font-size: 0.9em; color: var(--current-theme-accent); margin-bottom: 0.5em; } 
.entry ul { padding-left: 15px; list-style-type: disc; }
.entry ul li { font-size: 0.95em; }
.project-entry .tech-stack { font-style: italic; color: var(--current-text-secondary); margin-bottom: 0.5em; }
.project-entry .project-date { float: right; font-size: 0.9em; color: var(--current-theme-accent); } 

/* ---=== Blog Page ===--- */
.blog-post-summary {
    cursor: pointer; 
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.blog-post-summary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 var(--current-box-shadow);
}
.blog-post-summary h3 { 
    margin-top: 0;
    color: var(--current-theme-accent); 
    transition: color 0.3s ease;
}
.blog-post-summary:hover h3 { color: var(--current-theme-accent-hover); }

/* ===== BLOG SYSTEM CSS ===== */

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, #4A90E2, #357ABD);
    z-index: 1001;
    transition: width 0.1s ease;
}

.reading-progress-bar {
    width: 100%;
    height: 100%;
    background: inherit;
}

/* Simplified blog layout without ToC */
.blog-content-wrapper {
    width: 100%;
    max-width: none;
}

.blog-content-body {
    width: 100%;
    max-width: none;
}

/* Remove ToC width constraint from tables */
.blog-content-body .table-wrapper {
    max-width: 100%;
}

/* Blog Navigation - DISABLED
.blog-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 3em 0 2em 0;
    padding: 2em 0;
    border-top: 2px solid #e0e6ed;
    border-bottom: 2px solid #e0e6ed;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    color: #333;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    text-align: left;
    min-height: 80px;
}

.nav-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.15);
    border-color: #4A90E2;
    background: rgba(74, 144, 226, 0.02);
    text-decoration: none;
    color: #333;
}

.nav-button-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-title {
    color: #4A90E2;
    font-weight: 600;
    line-height: 1.3;
    font-size: 15px;
}

.prev-button i {
    color: #4A90E2;
    font-size: 18px;
}

.next-button {
    justify-content: flex-end;
    text-align: right;
}

.next-button i {
    color: #4A90E2;
    font-size: 18px;
}

.nav-button-placeholder {
    visibility: hidden;
}
*/

/* Blog Controls (Search and Sort) */
.blog-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.dark-mode .blog-controls {
    background: rgba(45, 52, 54, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e8eaed;
}

.search-container {
    position: relative;
    flex: 1 1 280px;
    min-width: 280px;
    max-width: 450px;
}

.search-container input {
    width: 100%;
    padding: 14px 18px 14px 50px;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    background: white;
    font-size: 14px;
    transition: all 0.3s ease;
    color: #2c3e50;
    box-sizing: border-box;
}

.dark-mode .search-container input {
    background: rgba(50, 60, 70, 0.95);
    border-color: rgba(255, 255, 255, 0.25);
    color: #e8eaed;
}

.dark-mode .search-container input::placeholder {
    color: #a0a7b3;
}

.search-container input:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-container i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 14px;
}

.dark-mode .search-container i {
    color: #a0a7b3;
}

.clear-search {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.dark-mode .clear-search {
    color: #a0a7b3;
}

.clear-search:hover {
    background: rgba(74, 144, 226, 0.1);
    color: #4A90E2;
}

.dark-mode .clear-search:hover {
    background: rgba(88, 127, 231, 0.2);
    color: #87CEEB;
}

.sort-container {
    flex: 0 1 220px;
    min-width: 220px;
    max-width: 280px;
}

.sort-container select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #2c3e50;
    box-sizing: border-box;
}

.dark-mode .sort-container select {
    background: rgba(50, 60, 70, 0.95);
    border-color: rgba(255, 255, 255, 0.25);
    color: #e8eaed;
}

.dark-mode .sort-container select option {
    background: #3c464e;
    color: #e8eaed;
}

.sort-container select:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Blog Meta Information */
.blog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    align-items: center;
    margin: 25px 0;
    padding: 18px 25px;
    background: rgba(248, 250, 252, 0.6);
    border: 1px solid #e0e6ed;
    border-radius: 10px;
    border-left: 4px solid #4A90E2;
    font-size: 14px;
    color: #5a6f82;
}

.dark-mode .blog-meta {
    background: rgba(45, 52, 54, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    color: #a0a7b3;
    border-left-color: #587FE7;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-item i {
    color: #4A90E2;
    font-size: 14px;
}

.reading-time {
    font-weight: 600;
    color: #4A90E2;
}

.math-indicator {
    background: rgba(74, 144, 226, 0.1);
    color: #4A90E2;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.dark-mode .math-indicator {
    background: rgba(74, 144, 226, 0.2);
    color: #87CEEB;
}

/* Blog Keywords */
.blog-keywords {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.blog-keywords i {
    color: #4A90E2;
    font-size: 14px;
}

.dark-mode .blog-keywords i {
    color: #587FE7;
}

.keyword {
    background: rgba(74, 144, 226, 0.1);
    color: #4A90E2;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(74, 144, 226, 0.2);
}

.dark-mode .keyword {
    background: rgba(88, 127, 231, 0.25);
    color: #87CEEB;
    border-color: rgba(88, 127, 231, 0.4);
}

/* Blog Actions */
.blog-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 2em 0;
    padding: 2em 0;
    border-top: 2px solid #e0e6ed;
    flex-wrap: wrap;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: white;
    border: 2px solid #4A90E2;
    color: #4A90E2;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.action-button:hover {
    background: #4A90E2;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.3);
    text-decoration: none;
}

.action-button i {
    font-size: 14px;
}

/* Blog Content Body Enhancements */
.blog-content-body {
    line-height: 1.8;
    font-size: 16px;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Additional fix for HTML entities in blog content */
.blog-content-body {
    /* Ensure proper word breaking for long text */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Fix for any remaining HTML entities in content */
.blog-content-body *:not(pre):not(code) {
    /* This will ensure text content is properly rendered */
    text-rendering: optimizeLegibility;
}

.blog-content-body h1 {
    color: #4A90E2;
    margin-top: 2em;
    margin-bottom: 1em;
    scroll-margin-top: 120px; /* Account for fixed header */
    font-size: 2em;
    position: relative;
    z-index: 1;
}

.blog-content-body h2,
.blog-content-body h3,
.blog-content-body h4 {
    color: #4A90E2;
    margin-top: 2.5em;
    margin-bottom: 1em;
    scroll-margin-top: 120px; /* Account for fixed header */
    position: relative;
    z-index: 1;
}

.blog-content-body h2 {
    padding-bottom: 0.3em;
    border-bottom: 2px solid #4A90E2;
}

/* Fix for code blocks and other content */
.blog-content-body pre,
.blog-content-body code,
.blog-content-body blockquote,
.blog-content-body p,
.blog-content-body ul,
.blog-content-body ol {
    position: relative;
    z-index: 1;
}

/* Specific fix for pre/code blocks that might overlap */
.blog-content-body pre {
    background-color: #f8f9fa;
    padding: 1.2em;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid #e0e6ed;
    margin: 1.5em 0;
    position: relative;
    z-index: 1;
    color: #2d3748;
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.5;
    /* Enhanced mobile scrolling */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    /* Improve touch scroll performance */
    transform: translateZ(0);
}

.dark-mode .blog-content-body pre {
    background-color: #2d3748;
    border-color: rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
}

.blog-content-body code {
    background-color: #f8f9fa;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    position: relative;
    z-index: 1;
    color: #2d3748;
    font-size: 0.9em;
    border: 1px solid #e0e6ed;
}

.dark-mode .blog-content-body code {
    background-color: #374151;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.15);
}

/* Fix for inline code within pre blocks */
.blog-content-body pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

/* HTML Details and Summary elements styling */
.blog-content-body details {
    background: rgba(248, 250, 252, 0.7);
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    margin: 1.5em 0;
    padding: 0;
    position: relative;
    z-index: 1;
}

.dark-mode .blog-content-body details {
    background: rgba(45, 52, 54, 0.7);
    border-color: rgba(255, 255, 255, 0.15);
}

.blog-content-body summary {
    background: rgba(74, 144, 226, 0.1);
    border-bottom: 1px solid #e0e6ed;
    border-radius: 8px 8px 0 0;
    color: #4A90E2;
    cursor: pointer;
    font-weight: 600;
    padding: 12px 18px;
    user-select: none;
    transition: all 0.3s ease;
}

.dark-mode .blog-content-body summary {
    background: rgba(88, 127, 231, 0.2);
    border-bottom-color: rgba(255, 255, 255, 0.15);
    color: #87CEEB;
}

.blog-content-body summary:hover {
    background: rgba(74, 144, 226, 0.15);
}

.dark-mode .blog-content-body summary:hover {
    background: rgba(88, 127, 231, 0.3);
}

.blog-content-body details[open] summary {
    border-radius: 8px 8px 0 0;
}

.blog-content-body details > *:not(summary) {
    padding: 15px 18px;
}

.blog-content-body details pre {
    margin: 0;
    border-radius: 0 0 8px 8px;
}

/* Markdown Tables */
.blog-content-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    background: rgba(248, 250, 252, 0.7);
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    font-size: 0.95em;
    display: table; /* Reset to proper table display */
}

/* Table wrapper for responsive scrolling */
.blog-content-body .table-wrapper {
    overflow-x: auto;
    margin: 1.5em 0;
    border-radius: 8px;
    border: 1px solid #e0e6ed;
    background: rgba(248, 250, 252, 0.7);
    /* Enhanced mobile scrolling */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    /* Improve touch scroll performance */
    transform: translateZ(0);
}

/* Enhanced table wrapper with scroll indicators */
.blog-content-body .table-wrapper {
    position: relative;
}

.blog-content-body .table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.blog-content-body .table-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.blog-content-body .table-wrapper::-webkit-scrollbar-thumb {
    background: #4A90E2;
    border-radius: 4px;
    border: 2px solid rgba(74, 144, 226, 0.1);
}

.blog-content-body .table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #357ABD;
}

/* Scroll shadow indicators */
.blog-content-body .table-wrapper::before,
.blog-content-body .table-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.blog-content-body .table-wrapper::before {
    left: 0;
    background: linear-gradient(to right, rgba(248, 250, 252, 0.8), transparent);
}

.blog-content-body .table-wrapper::after {
    right: 0;
    background: linear-gradient(to left, rgba(248, 250, 252, 0.8), transparent);
}

.dark-mode .blog-content-body .table-wrapper::before {
    background: linear-gradient(to right, rgba(45, 52, 54, 0.8), transparent);
}

.dark-mode .blog-content-body .table-wrapper::after {
    background: linear-gradient(to left, rgba(45, 52, 54, 0.8), transparent);
}

/* Hide shadows when not needed */
.blog-content-body .table-wrapper:not(.scrollable)::before,
.blog-content-body .table-wrapper:not(.scrollable)::after {
    opacity: 0;
}

.blog-content-body .table-wrapper table {
    margin: 0;
    border: none;
    background: transparent;
    min-width: 600px; /* Minimum width to prevent cramping */
}

.dark-mode .blog-content-body table {
    background: rgba(45, 52, 54, 0.7);
    border-color: rgba(255, 255, 255, 0.15);
}

.blog-content-body th,
.blog-content-body td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e0e6ed;
    vertical-align: top;
    position: relative;
    z-index: 1;
}

.dark-mode .blog-content-body th,
.dark-mode .blog-content-body td {
    border-bottom-color: rgba(255, 255, 255, 0.15);
}

.blog-content-body td, .blog-content-body th {
    word-break: break-word;
    hyphens: auto;
}

/* Math expressions in tables should not wrap */
.blog-content-body td mjx-container,
.blog-content-body th mjx-container {
    white-space: nowrap;
}

/* Floating Action Button (FAB) */
.floating-action-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: none;
    transition: transform 0.3s ease;
}

.fab-main {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.4);
    transition: all 0.3s ease;
    border: none;
}

.fab-main:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(74, 144, 226, 0.5);
}

.fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.floating-action-button.active .fab-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-action-button.active .fab-main {
    transform: rotate(45deg);
}

.fab-item {
    width: 50px;
    height: 50px;
    background: rgba(74, 144, 226, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.fab-item:hover {
    background: #357ABD;
    transform: scale(1.1);
}

/* Code block copy functionality */
.code-block-wrapper {
    position: relative;
    margin: 1.5em 0;
}

.copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.code-block-wrapper:hover .copy-code-btn {
    opacity: 1;
}

.copy-code-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.copy-code-btn.copied {
    background: #28a745;
    transform: scale(1.1);
}

/* Reading enhancements */
.reading-line {
    position: fixed;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4A90E2, transparent);
    pointer-events: none;
    z-index: 999;
    display: none;
    opacity: 0.7;
}

.highlighted-paragraph {
    background: linear-gradient(120deg, rgba(255, 255, 0, 0.3) 0%, rgba(255, 255, 0, 0.1) 100%);
    padding: 0.5em;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.highlighted-paragraph::before {
    content: '✨';
    position: absolute;
    left: -25px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
}

/* Focus mode */
.focus-mode header,
.focus-mode .blog-actions,
.focus-mode .reading-progress {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.focus-mode header:hover,
.focus-mode .blog-actions:hover {
    opacity: 1;
}

.focus-mode .blog-content-body {
    font-size: 18px;
    line-height: 1.9;
    max-width: 70ch;
    margin: 0 auto;
}

/* Highlight mode cursor */
.highlight-mode {
    cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><rect x="2" y="2" width="16" height="16" fill="yellow" opacity="0.5"/></svg>'), auto;
}

/* Notification system */
.notification {
    position: fixed;
    top: 100px;
    right: 30px;
    background: rgba(74, 144, 226, 0.95);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 1001;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* Dark mode adjustments for new features */
.dark-mode .fab-main {
    background: linear-gradient(135deg, #587FE7, #4A90E2);
}

.dark-mode .fab-item {
    background: rgba(88, 127, 231, 0.9);
}

.dark-mode .fab-item:hover {
    background: #4A90E2;
}

.dark-mode .highlighted-paragraph {
    background: linear-gradient(120deg, rgba(255, 255, 0, 0.2) 0%, rgba(255, 255, 0, 0.05) 100%);
}

.dark-mode .copy-code-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.dark-mode .copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.dark-mode .notification {
    background: rgba(88, 127, 231, 0.95);
}

/* Enhanced Site-wide Animation Styles */

/* Floating card animation */
@keyframes cardFloat {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    33% { 
        transform: translateY(0px) rotate(0deg); 
    }
    66% { 
        transform: translateY(0px) rotate(0deg); 
    }
}

/* Ripple effect */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    background-color: rgba(74, 144, 226, 0.3);
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Custom cursor styles */
.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    background: var(--current-theme-accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: all 0.1s ease;
    opacity: 0.7;
    mix-blend-mode: difference;
}

.custom-cursor.cursor-hover {
    transform: scale(1.5);
    background: #ff6b6b;
    opacity: 1;
}

.cursor-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--current-theme-accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.3;
    transition: all 0.2s ease;
}

/* Loading screen styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--current-bg) 0%, rgba(74, 144, 226, 0.1) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

.loading-spinner {
    text-align: center;
    color: var(--current-text);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(74, 144, 226, 0.1);
    border-left: 4px solid var(--current-theme-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-spinner p {
    font-size: 1.1em;
    font-weight: 600;
    opacity: 0.8;
    animation: fadeInOut 2s ease-in-out infinite;
}

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

/* Enhanced mobile menu animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Enhanced button hover effects */
.btn, .social-icon, .download-cv {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before, .social-icon::before, .download-cv::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.6s ease;
}

.btn:hover::before, .social-icon:hover::before, .download-cv:hover::before {
    left: 100%;
}

.btn:hover, .social-icon:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(74, 144, 226, 0.3);
}

/* Enhanced card hover effects */
.card-style {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card-style::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(74, 144, 226, 0.05), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.card-style:hover::before {
    opacity: 1;
    animation: shimmer 1.5s ease-in-out;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Enhanced hero section animations */
.hero-section h1 {
    animation: heroTitle 1s ease-out;
}

@keyframes heroTitle {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hero-section .subtitle {
    animation: heroSubtitle 1s ease-out 0.3s both;
}

@keyframes heroSubtitle {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-section .location {
    animation: heroLocation 1s ease-out 0.6s both;
}

@keyframes heroLocation {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.social-links a {
    animation: socialFadeIn 0.6s ease-out both;
}

.social-links a:nth-child(1) { animation-delay: 0.9s; }
.social-links a:nth-child(2) { animation-delay: 1.0s; }
.social-links a:nth-child(3) { animation-delay: 1.1s; }
.social-links a:nth-child(4) { animation-delay: 1.2s; }
.social-links a:nth-child(5) { animation-delay: 1.3s; }
.social-links a:nth-child(6) { animation-delay: 1.4s; }

@keyframes socialFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Enhanced news list animations */
.news-list li {
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    padding-left: 1em;
}

.news-list li:hover {
    border-left-color: var(--current-theme-accent);
    background: rgba(74, 144, 226, 0.05);
    transform: translateX(10px);
    padding-left: 1.5em;
}

.news-list .date {
    display: inline-block;
    transition: all 0.3s ease;
}

.news-list li:hover .date {
    color: var(--current-theme-accent);
    font-weight: 600;
    transform: scale(1.05);
}

/* Enhanced publication section */
.publication-item-home {
    transition: all 0.4s ease;
    position: relative;
}

.publication-item-home:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(74, 144, 226, 0.15);
}

.publication-title-home {
    transition: color 0.3s ease;
}

.publication-item-home:hover .publication-title-home {
    color: var(--current-theme-accent);
}

.publication-links-home a {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.publication-links-home a:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

/* Enhanced research interests */
#research-interests-home ul li {
    transition: all 0.3s ease;
    padding: 0.5em 0;
    border-left: 3px solid transparent;
    padding-left: 1em;
}

#research-interests-home ul li:hover {
    border-left-color: var(--current-theme-accent);
    background: rgba(74, 144, 226, 0.05);
    color: var(--current-theme-accent);
    transform: translateX(10px);
    font-weight: 600;
}

/* Parallax scrolling effect */
.hero-section {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
}

/* ---=== About Page Specific ===--- */
.about-facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 22px;
    margin-top: 1em;
}

.fact-item {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 18px 16px;
    background: var(--current-glass-bg);
    border: 1px solid var(--current-glass-border);
    border-radius: var(--border-radius-small);
    min-height: 120px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.07);
    transition: transform 0.25s ease, box-shadow 0.3s ease, background 0.3s ease;
    overflow: hidden;
}

.fact-item i {
    font-size: 1.4em;
    color: var(--current-theme-accent);
    flex-shrink: 0;
    margin-top: 2px;
}

.fact-item .label {
    font-size: 0.70em;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
    color: var(--current-text-secondary);
    margin-bottom: 4px;
}

.fact-item .value {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    min-width: 0;
}

.fact-item .value a {
    text-decoration: none;
    word-break: break-all;
}

.fact-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(74,144,226,0.18);
}

.dark-mode .fact-item {
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.dark-mode .fact-item:hover {
    box-shadow: 0 10px 28px rgba(74,144,226,0.35);
}


@media (max-width: 420px) {
    .about-facts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .fact-item {
        padding: 14px 16px;
        grid-template-columns: 36px 1fr;
        gap: 10px;
    }
    .contact-details-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .contact-detail-item {
        padding: 14px 16px;
        grid-template-columns: 36px 1fr;
        gap: 10px;
    }
}

/* Contact details grid */
.contact-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 22px;
    margin-top: 1.2em;
}
.contact-detail-item {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 14px;
    padding: 18px 20px;
    background: var(--current-glass-bg);
    border: 1px solid var(--current-glass-border);
    border-radius: var(--border-radius-small);
    box-shadow: 0 4px 18px rgba(0,0,0,0.06);
    transition: transform 0.25s ease, box-shadow 0.3s ease;
    overflow: hidden;
}
.contact-detail-item i {font-size: 1.3em; color: var(--current-theme-accent); margin-top: 2px;}
.contact-detail-item:hover {transform: translateY(-4px); box-shadow: 0 10px 30px rgba(74,144,226,0.18);}
.contact-detail-item .label {font-size: 0.7em; text-transform: uppercase; letter-spacing: 0.5px; font-weight:600; color: var(--current-text-secondary); margin-bottom:4px;}
.contact-detail-item .value {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    min-width: 0;
}
.contact-detail-item .value a {
    text-decoration: none;
    word-break: break-all;
}

/* auto-fit already handles column collapse; keep only smallest-phone tweak if needed later */

/* Improved focus states for accessibility */
button:focus, a:focus, input:focus {
    outline: 2px solid var(--current-theme-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Smooth transitions for theme switching */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Enhanced scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--current-glass-bg);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--current-theme-accent), #357ABD);
    border-radius: 10px;
    border: 2px solid var(--current-glass-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #357ABD, var(--current-theme-accent));
}

/* Progressive enhancement for reduced motion preference */
@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;
    }
    
    .particle {
        display: none;
    }
    
    .custom-cursor,
    .cursor-trail {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card-style {
        border: 2px solid var(--current-border-color);
    }
    
    .btn, .social-icon {
        border: 2px solid var(--current-theme-accent);
    }
}

/* Print styles */
@media print {
    .modern-footer,
    .footer-particles,
    .custom-cursor,
    .cursor-trail,
    .loading-screen {
        display: none !important;
    }
    
    .card-style {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* ===========================
   RESPONSIVE DESIGN & MOBILE
   =========================== */

/* Mobile-first responsive breakpoints */
@media screen and (max-width: 768px) {
    /* Root adjustments for mobile */
    :root {
        --border-radius-main: 12px;
        --border-radius-small: 8px;
    }

    /* Body adjustments */
    body {
        padding-top: 10px;
        font-size: 16px;
        line-height: 1.6;
        /* Enhanced mobile scrolling */
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        /* Prevent horizontal bounce/overscroll */
        overscroll-behavior-x: none;
        /* Improve touch scrolling performance */
        touch-action: pan-y pinch-zoom;
    }
    
    /* Optimize all scrollable elements for mobile */
    * {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Improve main container scrolling */
    main {
        /* Ensure smooth scrolling within main content */
        overscroll-behavior: contain;
        /* Better touch performance */
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }

    /* Header and Navigation */
    header {
        padding: 10px 0;
    }

    nav {
        margin: 0 10px;
        padding: 0.6em 1em;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    nav .logo a {
        font-size: 1.3em;
    }

    nav .logo svg {
        width: 24px;
        height: 24px;
        margin-right: 6px;
    }

    /* Hide desktop menu on mobile */
    nav ul {
        display: none;
    }

    /* Show mobile menu toggle */
    #mobile-menu-toggle {
        display: block !important;
        order: 3;
    }

    #theme-toggle {
        order: 2;
        margin-right: 10px;
    }

    /* Mobile menu improvements */
    #mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--current-glass-bg-navbar);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border: none;
        border-radius: 0;
        z-index: 9999;
        padding: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    #mobile-menu.active {
        transform: translateX(0);
        max-height: none;
        opacity: 1;
        padding: 2em;
    }

    #mobile-menu ul {
        display: block;
        text-align: center;
        width: 100%;
        max-width: 300px;
    }

    #mobile-menu ul li {
        margin-bottom: 1em;
        opacity: 0;
        transform: translateY(30px);
        transition: all 0.3s ease;
    }

    #mobile-menu.active ul li {
        opacity: 1;
        transform: translateY(0);
    }

    #mobile-menu.active ul li:nth-child(1) { transition-delay: 0.1s; }
    #mobile-menu.active ul li:nth-child(2) { transition-delay: 0.15s; }
    #mobile-menu.active ul li:nth-child(3) { transition-delay: 0.2s; }
    #mobile-menu.active ul li:nth-child(4) { transition-delay: 0.25s; }
    #mobile-menu.active ul li:nth-child(5) { transition-delay: 0.3s; }

    #mobile-menu ul li a {
        font-size: 1.3em;
        padding: 1em 1.5em;
        display: block;
        border-radius: 12px;
        margin: 0.5em 0;
        background: rgba(74, 144, 226, 0.1);
        border: 2px solid transparent;
        font-weight: 600;
    }

    #mobile-menu ul li a:hover,
    #mobile-menu ul li a.active {
        background: rgba(74, 144, 226, 0.2);
        border-color: var(--current-theme-accent);
        transform: scale(1.05);
    }

    /* Main content */
    main {
        margin: 1em auto;
        padding: 0 15px;
        max-width: 100%;
    }

    /* Card sections */
    .card-style, .content-section {
        padding: 20px 18px;
        margin-bottom: 1.5em;
        border-radius: var(--border-radius-main);
    }

    .card-style:hover {
        transform: translateY(-3px) scale(1.01);
    }

    /* Typography responsive adjustments */
    h1 {
        font-size: 2em !important;
        line-height: 1.2;
        margin-bottom: 0.5em;
    }

    h2 {
        font-size: 1.6em !important;
        line-height: 1.3;
        margin-top: 1em;
    }

    h3 {
        font-size: 1.3em !important;
        line-height: 1.4;
    }

    h4 {
        font-size: 1.1em !important;
    }

    p {
        font-size: 1em;
        line-height: 1.6;
        margin-bottom: 1em;
    }

    /* Hero section mobile */
    .hero-section {
        padding: 1.5em 1em;
        text-align: center;
    }

    .hero-section h1 {
        font-size: 2.2em !important;
        margin-bottom: 0.3em;
    }

    .hero-section .subtitle {
        font-size: 1.1em !important;
        margin-bottom: 0.5em;
        line-height: 1.4;
    }

    .hero-section .location {
        font-size: 0.95em !important;
        margin-bottom: 1.2em;
    }

    /* Social links mobile layout */
    .social-links {
        margin-top: 1.5em;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        justify-content: center;
        max-width: 320px;
        margin: 1.5em auto 0;
    }

    .social-links .btn {
        padding: 0.5em 0.9em;
        font-size: clamp(0.75rem, 2.5vw, 0.85rem);
        text-align: center;
        justify-content: center;
        white-space: nowrap;
        min-height: 40px;
        display: flex;
        align-items: center;
        /* Better spacing for mobile */
        margin: 0.2em;
        /* Improved mobile interaction */
        cursor: pointer;
        touch-action: auto;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }

    /* All buttons responsive sizing for mobile */
    .btn {
        padding: 0.5em 0.9em;
        font-size: clamp(0.75rem, 2.5vw, 0.85rem);
        min-height: 40px;
        /* Better mobile touch experience */
        touch-action: auto;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }

    .social-links .btn i {
        margin-right: 4px;
        font-size: 1em;
    }

    /* Publication sections mobile */
    .publication-item, .publication-item-home {
        padding-bottom: 1.2em;
        margin-bottom: 1.5em;
    }

    .publication-title, .publication-title-home {
        font-size: 1.2em !important;
        line-height: 1.3;
        margin-bottom: 0.5em;
    }

    .publication-authors, .publication-authors-home {
        font-size: 0.9em;
        line-height: 1.4;
        margin-bottom: 0.5em;
    }

    .publication-venue, .publication-venue-home {
        font-size: 0.85em;
        margin-bottom: 0.8em;
    }

    .publication-links, .publication-links-home {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }

    .publication-links .btn-icon,
    .publication-links-home .btn-icon,
    .publication-links .btn,
    .publication-links-home .btn {
        font-size: clamp(0.85rem, 2.8vw, 0.95rem);
        padding: 0.7em 1em;
        flex: 1;
        min-width: 80px;
        min-height: 44px;
        text-align: center;
        justify-content: center;
        /* Enhanced mobile touch - allow all interactions for clickable buttons */
        touch-action: auto;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
        cursor: pointer;
    }

    /* News list mobile */
    .news-list li {
        padding-left: 12px;
        margin-bottom: 1.2em;
        border-left-width: 2px;
    }

    .news-list .date {
        font-size: 0.85em;
        display: block;
        margin-bottom: 0.3em;
    }

    /* Tables mobile responsiveness */
    .blog-content-body table,
    table {
        font-size: 0.85em;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .blog-content-body .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        margin: 1em 0;
    }

    .blog-content-body th,
    .blog-content-body td,
    th, td {
        padding: 8px 12px;
        min-width: 120px;
    }

    /* Interest list mobile */
    .interest-list li {
        margin-bottom: 1em;
        font-size: 0.95em;
        line-height: 1.5;
    }

    /* Code blocks mobile */
    .blog-content-body pre,
    pre {
        padding: 1em;
        font-size: 0.85em;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .blog-content-body code,
    code {
        font-size: 0.85em;
        padding: 0.2em 0.3em;
    }

    /* Form elements mobile */
    input, select, textarea {
        font-size: 16px !important; /* Prevent zoom on iOS */
        -webkit-appearance: none;
        appearance: none;
        border-radius: var(--border-radius-small);
    }

    /* Blog controls mobile */
    .blog-controls {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }

    .search-container {
        min-width: 100%;
        max-width: 100%;
    }

    .sort-container {
        min-width: 100%;
        max-width: 100%;
    }

    /* Blog meta mobile */
    .blog-meta {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
        font-size: 0.9em;
    }

    .meta-item {
        justify-content: center;
    }

    /* Education entries mobile */
    .entry {
        padding-left: 20px;
        margin-bottom: 1.5em;
    }

    .entry::before {
        left: 0;
        width: 8px;
        height: 8px;
        top: 10px;
    }

    .entry h3 {
        font-size: 1.2em !important;
        line-height: 1.3;
    }

    .entry .institution {
        font-size: 0.95em;
        line-height: 1.4;
    }

    .entry .dates {
        font-size: 0.85em;
    }

    .entry ul {
        font-size: 0.9em;
        line-height: 1.5;
    }

    /* Project entries mobile */
    .project-entry .project-date {
        float: none;
        display: block;
        margin-bottom: 0.5em;
    }
}

/* Tablet styles */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    nav {
        margin: 0 20px;
        padding: 0.7em 1.3em;
    }

    main {
        margin: 1.5em auto;
        padding: 0 30px;
        max-width: 100%;
    }

    .card-style, .content-section {
        padding: 22px 25px;
    }

    .social-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        max-width: 600px;
        margin: 1.5em auto 0;
    }

    .social-links .btn {
        flex: 1;
        min-width: 120px;
        padding: 0.5em 0.95em;
        font-size: clamp(0.75rem, 2vw, 0.85rem);
        min-height: 38px;
        /* Better tablet interaction */
        touch-action: auto;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }

    /* All buttons responsive sizing for tablet */
    .btn {
        padding: 0.5em 0.95em;
        font-size: clamp(0.75rem, 2vw, 0.85rem);
        min-height: 38px;
    }

    h1 {
        font-size: 2.2em !important;
    }

    h2 {
        font-size: 1.8em !important;
    }

    .hero-section h1 {
        font-size: 2.6em !important;
    }
}

/* Large mobile devices */
@media screen and (max-width: 480px) {
    body {
        font-size: 15px;
    }

    nav {
        margin: 0 5px;
        padding: 0.5em 0.8em;
    }

    nav .logo a {
        font-size: 1.2em;
    }

    main {
        padding: 0 10px;
    }

    .card-style, .content-section {
        padding: 15px;
        margin-bottom: 1.2em;
    }

    .hero-section {
        padding: 1.2em 0.8em;
    }

    .hero-section h1 {
        font-size: 1.8em !important;
    }

    .hero-section .subtitle {
        font-size: 1em !important;
    }

    .social-links {
        grid-template-columns: 1fr;
        gap: 10px;
        max-width: 280px;
    }

    .social-links .btn {
        padding: 0.55em 0.95em;
        font-size: clamp(0.75rem, 3vw, 0.85rem);
        min-height: 42px;
        /* Enhanced mobile interaction */
        touch-action: auto;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
        /* Full width on small screens */
        width: 100%;
        justify-content: center;
    }

    /* All buttons for small mobile */
    .btn {
        padding: 0.55em 0.95em;
        font-size: clamp(0.75rem, 3vw, 0.85rem);
        min-height: 42px;
        touch-action: auto;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }

    .publication-links, .publication-links-home {
        flex-direction: column;
        align-items: stretch;
    }

    .publication-links .btn-icon,
    .publication-links-home .btn-icon,
    .publication-links .btn,
    .publication-links-home .btn {
        width: 100%;
        margin-bottom: 8px;
        /* Specific mobile touch optimizations */
        touch-action: auto;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
        min-height: 48px;
        font-size: 0.9rem;
    }

    h1 {
        font-size: 1.6em !important;
    }

    h2 {
        font-size: 1.4em !important;
    }

    h3 {
        font-size: 1.2em !important;
    }
}

/* Very small devices */
@media screen and (max-width: 320px) {
    nav .logo a {
        font-size: 1.1em;
    }

    nav .logo svg {
        width: 20px;
        height: 20px;
    }

    .hero-section h1 {
        font-size: 1.6em !important;
    }

    .social-links {
        max-width: 250px;
    }

    .card-style, .content-section {
        padding: 12px;
    }
}

/* Landscape mobile orientation */
@media screen and (max-height: 600px) and (orientation: landscape) {
    #mobile-menu {
        flex-direction: row;
        justify-content: center;
        padding: 1em;
    }

    #mobile-menu ul {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        max-width: 100%;
        gap: 10px;
    }

    #mobile-menu ul li {
        flex: 1;
        min-width: 120px;
    }

    #mobile-menu ul li a {
        font-size: 1em;
        padding: 0.8em 1em;
    }
}

/* High DPI displays */
@media screen and (-webkit-min-device-pixel-ratio: 2), 
       screen and (min-resolution: 192dpi) {
    nav .logo svg,
    .footer-logo svg {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark mode mobile adjustments */
@media screen and (max-width: 768px) {
    .dark-mode #mobile-menu {
        background: var(--glass-bg-dark);
    }

    .dark-mode #mobile-menu ul li a {
        background: rgba(88, 127, 231, 0.15);
        color: var(--current-text-dark);
    }

    .dark-mode #mobile-menu ul li a:hover,
    .dark-mode #mobile-menu ul li a.active {
        background: rgba(88, 127, 231, 0.25);
        border-color: var(--current-theme-accent);
    }
}

/* Accessibility improvements for mobile */
@media screen and (max-width: 768px) {
    /* Larger touch targets */
    button, .btn, .btn-icon, a {
        min-height: 44px;
        min-width: 44px;
    }

    /* Better focus indicators */
    button:focus, a:focus, input:focus {
        outline: 3px solid var(--current-theme-accent);
        outline-offset: 2px;
    }

    /* Improved readability */
    p, li {
        line-height: 1.6;
    }
}

/* Print media mobile */
@media print {
    .social-links {
        display: none;
    }

    #mobile-menu, #mobile-menu-toggle {
        display: none !important;
    }

    nav ul {
        display: flex !important;
    }

    .card-style {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 1em;
    }
}

/* =========================
   CLEAN, IMPRESSIVE FOOTER
   ========================= */

/* Modern Footer Base */
.modern-footer {
    position: relative;
    background: linear-gradient(135deg, 
        var(--current-glass-bg) 0%, 
        rgba(74, 144, 226, 0.08) 50%, 
        var(--current-glass-bg) 100%);
    color: var(--current-text);
    padding: 4em 0 2em 0;
    border-top: 2px solid rgba(74, 144, 226, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

/* Animated background particles */
.footer-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--current-theme-accent);
    border-radius: 50%;
    opacity: 0.3;
    animation: particleFloat 15s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100px) translateX(100px);
        opacity: 0;
    }
}

/* Interactive wave animation */
.footer-wave {
    position: absolute;
    top: -50px;
    left: 0;
    width: 100%;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z' opacity='.25' fill='%234A90E2'%3E%3C/path%3E%3Cpath d='M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V0Z' opacity='.5' fill='%234A90E2'%3E%3C/path%3E%3Cpath d='M0,0V5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z' fill='%234A90E2'%3E%3C/path%3E%3C/svg%3E") repeat-x;
    animation: waveMove 20s ease-in-out infinite;
}

@keyframes waveMove {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-50px); }
}

.footer-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2em;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 3em;
}

.footer-section {
    position: relative;
    padding: 1.5em;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    border: 1px solid rgba(74, 144, 226, 0.1);
    backdrop-filter: blur(5px);
    transition: all 0.4s ease;
    transform-style: preserve-3d;
}

.footer-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(74, 144, 226, 0.1), transparent);
    border-radius: 15px;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.footer-section:hover {
    transform: translateY(-8px) rotateX(5deg);
    box-shadow: 0 15px 40px rgba(74, 144, 226, 0.2);
    border-color: rgba(74, 144, 226, 0.3);
}

.footer-section:hover::before {
    opacity: 1;
}

.footer-logo {
    text-align: center;
    padding: 2em 1.5em;
}

.footer-logo h3 {
    color: var(--current-text);
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--current-theme-accent), #357ABD, #87CEEB);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.footer-tagline {
    color: var(--current-theme-accent);
    font-weight: 600;
    font-size: 1.1em;
    margin: 0.8em 0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden;
}

.footer-tagline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--current-theme-accent), transparent);
    animation: taglineSlide 4s ease-in-out infinite;
}

@keyframes taglineSlide {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: -100%; }
}

.footer-description {
    color: var(--current-text-secondary);
    line-height: 1.7;
    margin: 1em 0;
    font-size: 0.95em;
    animation: fadeInUp 1s ease-out;
}

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

.footer-section h4 {
    color: var(--current-text);
    font-size: 1.3em;
    font-weight: 700;
    margin: 0 0 1.5em 0;
    position: relative;
    padding-bottom: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--current-theme-accent), #357ABD);
    border-radius: 3px;
    animation: headerPulse 2s ease-in-out infinite;
}

@keyframes headerPulse {
    0%, 100% { transform: scaleX(1); }
    50% { transform: scaleX(1.2); }
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 1em;
    transform: translateX(-10px);
    opacity: 0;
    animation: slideInLeft 0.6s ease-out forwards;
}

.footer-links li:nth-child(1) { animation-delay: 0.1s; }
.footer-links li:nth-child(2) { animation-delay: 0.2s; }
.footer-links li:nth-child(3) { animation-delay: 0.3s; }
.footer-links li:nth-child(4) { animation-delay: 0.4s; }
.footer-links li:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInLeft {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.footer-links a {
    color: var(--current-text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8em 1em;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    font-size: 0.95em;
    position: relative;
    overflow: hidden;
}

.footer-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 144, 226, 0.2), transparent);
    transition: left 0.6s ease;
}

.footer-links a:hover::before {
    left: 100%;
}

.footer-links a:hover {
    color: var(--current-theme-accent);
    transform: translateX(12px) scale(1.02);
    background: rgba(74, 144, 226, 0.1);
    border-left: 3px solid var(--current-theme-accent);
    padding-left: 1.3em;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.2);
}

.footer-links a i {
    width: 20px;
    opacity: 0.7;
    transition: all 0.4s ease;
    font-size: 1.1em;
}

.footer-links a:hover i {
    opacity: 1;
    transform: rotate(10deg) scale(1.2);
    color: var(--current-theme-accent);
}

.research-tags {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
}

.research-tags li {
    background: rgba(74, 144, 226, 0.1);
    padding: 0.6em 1.2em;
    border-radius: 25px;
    border: 1px solid rgba(74, 144, 226, 0.2);
    font-size: 0.85em;
    font-weight: 600;
    color: var(--current-theme-accent);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    cursor: default;
    transform: translateY(10px);
    opacity: 0;
    animation: tagFadeIn 0.6s ease-out forwards;
}

.research-tags li:nth-child(1) { animation-delay: 0.1s; }
.research-tags li:nth-child(2) { animation-delay: 0.2s; }
.research-tags li:nth-child(3) { animation-delay: 0.3s; }
.research-tags li:nth-child(4) { animation-delay: 0.4s; }
.research-tags li:nth-child(5) { animation-delay: 0.5s; }

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

.research-tags li::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 144, 226, 0.3), transparent);
    transition: left 0.6s ease;
}

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

.research-tags li:hover {
    transform: translateY(-3px) scale(1.05);
    background: rgba(74, 144, 226, 0.2);
}

/* Footer Social Links */
.footer-social-links {
    display: flex;
    flex-direction: column;
    gap: 1em;
    margin-bottom: 2em;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 0.8em 1.2em;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(74, 144, 226, 0.05));
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 25px;
    color: var(--current-text);
    text-decoration: none;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    border-left: 3px solid transparent;
    transform: translateY(10px);
    opacity: 0;
    animation: socialFadeInUp 0.6s ease-out forwards;
}

.social-icon:nth-child(1) { animation-delay: 0.1s; }
.social-icon:nth-child(2) { animation-delay: 0.2s; }
.social-icon:nth-child(3) { animation-delay: 0.3s; }
.social-icon:nth-child(4) { animation-delay: 0.4s; }

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

.social-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.social-icon:hover::before {
    left: 100%;
}

.social-icon:hover {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.2), rgba(74, 144, 226, 0.1));
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.3);
    border-color: rgba(74, 144, 226, 0.4);
    border-left-color: var(--current-theme-accent);
}

.social-icon i {
    font-size: 1.1em;
    color: var(--current-theme-accent);
    transition: all 0.4s ease;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.social-icon:hover i {
    transform: scale(1.2) rotate(10deg);
    filter: brightness(1.2);
}

.social-icon span {
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
    color: var(--current-text-secondary);
}

.social-icon:hover span {
    color: var(--current-theme-accent);
}

.footer-download {
    margin-top: 1em;
}

.download-cv {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 1.2em 2em;
    background: linear-gradient(135deg, var(--current-theme-accent), #357ABD);
    border: none;
    border-radius: 30px;
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9em;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(74, 144, 226, 0.3);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.download-cv::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.6s ease;
}

.download-cv:hover::before {
    left: 100%;
}

.download-cv:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 35px rgba(74, 144, 226, 0.5);
}

.download-cv i {
    font-size: 1.1em;
    transition: all 0.4s ease;
}

.download-cv:hover i {
    transform: rotate(-10deg) scale(1.2);
}

/* Footer Copyright */
.footer-copyright {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2em 0 1em 0;
    margin-top: 2em;
    border-top: 1px solid rgba(74, 144, 226, 0.2);
}

.footer-copyright p {
    color: var(--current-text-secondary);
    font-size: 0.9em;
    margin: 0;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-copyright:hover p {
    opacity: 1;
}

/* Footer responsive styles */
@media screen and (max-width: 768px) {
    .modern-footer {
        padding: 2.5em 0 1.5em 0;
        text-align: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2em;
        padding: 0 1.5em;
        max-width: 100%;
    }

    .footer-section {
        padding: 1.2em;
        margin-bottom: 1em;
    }

    .footer-section:hover {
        transform: translateY(-4px);
    }

    .footer-logo {
        padding: 1.5em 1em;
    }

    .footer-logo h3 {
        font-size: 1.5em;
        margin-bottom: 0.5em;
    }

    .footer-tagline {
        font-size: 1em;
        letter-spacing: 1px;
    }

    .footer-description {
        font-size: 0.9em;
        line-height: 1.6;
    }

    .footer-section h4 {
        font-size: 1.1em;
        margin-bottom: 1em;
        text-align: center;
    }

    .footer-links ul {
        text-align: center;
    }

    .footer-links a {
        justify-content: center;
        padding: 0.7em 1em;
        margin: 0 auto 0.8em;
        max-width: 200px;
    }

    .footer-links a:hover {
        transform: translateY(-2px) scale(1.02);
        padding-left: 1em;
        border-left: none;
        border-bottom: 3px solid var(--current-theme-accent);
    }

    .research-tags {
        justify-content: center;
        gap: 0.8em;
    }

    .research-tags li {
        font-size: 0.8em;
        padding: 0.5em 1em;
        margin-bottom: 0.5em;
    }

    .footer-social-links {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .social-icon {
        width: 100%;
        max-width: 200px;
        justify-content: center;
        padding: 0.8em 1.2em;
    }

    .footer-download {
        margin-top: 1em;
        text-align: center;
    }

    .download-cv {
        width: 100%;
        max-width: 200px;
        justify-content: center;
        padding: 0.8em 1.2em;
    }

    .footer-wave {
        height: 40px;
        top: -30px;
    }

    .footer-decoration {
        margin-top: 1em;
    }

    .decoration-dots {
        justify-content: center;
    }
    
    .footer-copyright {
        padding: 1.5em 1em 0.8em 1em;
        margin-top: 1.5em;
    }
    
    .footer-copyright p {
        font-size: 0.85em;
    }

    /* Reduce particle density on mobile */
    .particle {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    .footer-content {
        padding: 0 1em;
        gap: 1.5em;
    }

    .footer-section {
        padding: 1em;
    }

    .footer-logo h3 {
        font-size: 1.3em;
    }

    .footer-tagline {
        font-size: 0.9em;
        letter-spacing: 0.5px;
    }

    .footer-description {
        font-size: 0.85em;
    }

    .footer-section h4 {
        font-size: 1em;
    }

    .footer-links a {
        font-size: 0.9em;
        padding: 0.6em 0.8em;
    }

    .research-tags li {
        font-size: 0.75em;
        padding: 0.4em 0.8em;
    }

    .social-icon, .download-cv {
        font-size: 0.9em;
        padding: 0.7em 1em;
    }
}

/* Footer dark mode mobile adjustments */
@media screen and (max-width: 768px) {
    .dark-mode .footer-section {
        background: rgba(45, 52, 54, 0.05);
        border-color: rgba(88, 127, 231, 0.2);
    }

    .dark-mode .footer-links a:hover {
        background: rgba(88, 127, 231, 0.15);
        border-color: var(--current-theme-accent);
    }

    .dark-mode .research-tags li {
        background: rgba(88, 127, 231, 0.2);
        border-color: rgba(88, 127, 231, 0.3);
    }
}

/* Footer landscape mobile */
@media screen and (max-height: 600px) and (orientation: landscape) and (max-width: 768px) {
    .modern-footer {
        padding: 1.5em 0 1em 0;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 1.5em;
    }

    .footer-section {
        padding: 0.8em;
    }

    .footer-logo {
        padding: 1em;
    }

    .footer-logo h3 {
        font-size: 1.2em;
    }

    .footer-description {
        display: none; /* Hide to save space */
    }
}

/* ===========================
   MOBILE ENHANCEMENTS & FIXES
   =========================== */

/* Enhanced mobile viewport height */
:root {
    --vh: 1vh; /* Fallback, will be updated by JS */
}

/* Touch improvements */
.touch-active {
    transform: scale(0.98) !important;
    opacity: 0.8 !important;
    transition: all 0.1s ease !important;
}

/* Improved ripple effect */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    background-color: rgba(74, 144, 226, 0.3);
    pointer-events: none;
    z-index: 10;
}

@keyframes ripple {
    from {
        transform: scale(0);
        opacity: 1;
    }
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Mobile-specific hover states (disable on touch devices) */
@media (hover: none) {
    .card-style:hover {
        transform: none !important;
        box-shadow: var(--current-box-shadow) !important;
    }
    
    /* Ensure cards allow touch scrolling */
    .card-style, .content-section {
        touch-action: pan-y pan-x !important;
        /* Remove any potential scroll blocking */
        -webkit-touch-callout: none;
        -webkit-user-select: text;
        user-select: text;
    }
    
    .btn:hover, .social-icon:hover, .btn-icon:hover {
        transform: none !important;
    }
    
    .footer-section:hover {
        transform: none !important;
    }
}

/* Improved focus states for keyboard navigation */
button:focus-visible, 
.btn:focus-visible, 
.btn-icon:focus-visible, 
a:focus-visible {
    outline: 3px solid var(--current-theme-accent);
    outline-offset: 2px;
    border-radius: 4px;
    z-index: 10;
}

/* High contrast mode improvements */
@media (prefers-contrast: high) {
    .card-style, .content-section {
        border: 2px solid var(--current-text);
    }
    
    .btn, .social-icon, .btn-icon {
        border: 2px solid var(--current-text);
        background: var(--current-bg);
        color: var(--current-text);
    }
    
    .btn:hover, .social-icon:hover {
        background: var(--current-text);
        color: var(--current-bg);
    }
}

/* Reduce motion for users who prefer it */
@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;
    }
    
    .card-style {
        animation: none !important;
    }
    
    .particle {
        display: none !important;
    }
    
    .floating-action-button {
        display: none !important;
    }
    
    .footer-wave {
        animation: none !important;
    }
    
    .footer-particles {
        display: none !important;
    }
}

/* Improved scrollbar for mobile */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 6px;
    }
    
    ::-webkit-scrollbar-track {
        background: transparent;
    }
    
    ::-webkit-scrollbar-thumb {
        background: rgba(74, 144, 226, 0.5);
        border-radius: 3px;
    }
}

/* Safe area adjustments for notched devices */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
    
    header {
        padding-top: max(20px, env(safe-area-inset-top));
    }
    
    .modern-footer {
        padding-bottom: max(2em, env(safe-area-inset-bottom));
    }
    
    #mobile-menu {
        padding-top: max(2em, env(safe-area-inset-top));
        padding-bottom: max(2em, env(safe-area-inset-bottom));
    }
}

/* Improved table responsiveness */
@media (max-width: 768px) {
    .blog-content-body .table-wrapper {
        position: relative;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--current-theme-accent) transparent;
        /* Enhanced mobile scrolling */
        overscroll-behavior-x: contain;
        transform: translateZ(0);
    }
    
    .blog-content-body .table-wrapper::after {
        content: '← Scroll →';
        position: absolute;
        bottom: 5px;
        right: 10px;
        font-size: 0.75em;
        color: var(--current-text-secondary);
        opacity: 0.7;
        pointer-events: none;
    }
    
    .blog-content-body table {
        min-width: 500px;
        width: auto;
    }
    
    /* Additional mobile scrolling improvements */
    .card-style, .content-section {
        /* Ensure smooth scrolling within cards */
        overscroll-behavior: contain;
        /* Allow touch scrolling on cards - this allows pan gestures for scrolling */
        touch-action: pan-y pan-x !important;
    }
    
    /* Improve modal/menu scrolling */
    #mobile-menu {
        /* Prevent bounce scroll when menu is open */
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Optimize footer scrolling */
    .modern-footer {
        overscroll-behavior: contain;
    }
    
    /* Better scroll performance for all elements */
    * {
        /* Optimize scrolling performance */
        scroll-behavior: smooth;
    }
}

/* Enhanced loading states */
.loading-skeleton {
    background: linear-gradient(90deg, 
        var(--current-glass-bg) 25%, 
        rgba(74, 144, 226, 0.1) 50%, 
        var(--current-glass-bg) 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

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

/* Dark mode enhancements */
.dark-mode .loading-skeleton {
    background: linear-gradient(90deg, 
        var(--glass-bg-dark) 25%, 
        rgba(88, 127, 231, 0.1) 50%, 
        var(--glass-bg-dark) 75%);
    background-size: 200% 100%;
}

/* Performance optimizations */
.card-style, .content-section {
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* GPU acceleration for animations */
.hero-section h1,
.hero-section .subtitle,
.hero-section .location,
.social-links a {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* Better mobile text selection */
@media (max-width: 768px) {
    * {
        -webkit-touch-callout: none;
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
    
    button, .btn, .btn-icon {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    body {
        /* Improve iOS scrolling performance */
        -webkit-overflow-scrolling: touch;
        /* Prevent bounce at document boundaries */
        overscroll-behavior: contain;
    }
    
    .card-style, .content-section {
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
        /* Improve scrolling within cards on iOS */
        -webkit-overflow-scrolling: touch;
    }
    
    #mobile-menu {
        -webkit-transform: translate3d(100%, 0, 0);
        transform: translate3d(100%, 0, 0);
        /* Better iOS mobile menu scrolling */
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    #mobile-menu.active {
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
    
    /* iOS-specific scrollable element optimizations */
    .blog-content-body .table-wrapper,
    .blog-content-body pre,
    [id^="bibtex-entry-"] pre {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }
}

/* Android Chrome specific fixes */
@media screen and (max-width: 768px) {
    input, textarea, select {
        font-size: 16px !important; /* Prevent zoom on focus */
        transform: translateZ(0); /* Force hardware acceleration */
    }
}

/* Edge cases and final responsive fixes */
@media screen and (max-width: 768px) and (max-height: 500px) {
    /* Very short mobile screens (landscape phones) */
    .hero-section {
        padding: 1em;
    }
    
    .card-style, .content-section {
        margin-bottom: 1em;
        padding: 15px;
    }
    
    .modern-footer {
        padding: 1.5em 0 1em 0;
    }
}

/* Final accessibility improvements */
@media (max-width: 768px) {
    /* Ensure adequate color contrast */
    .btn, .social-icon {
        font-weight: 600;
    }
    
    /* Better spacing for readability */
    p, li {
        margin-bottom: 1em;
    }
    
    /* Improved link visibility */
    a {
        text-decoration: underline;
        text-decoration-color: rgba(74, 144, 226, 0.3);
        text-underline-offset: 2px;
    }
    
    a:hover {
        text-decoration-color: var(--current-theme-accent);
    }
}

/* Publication links mobile layout improvements */
.publication-links, .publication-links-home {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 0.8em;
}

.publication-links .btn-icon,
.publication-links-home .btn-icon,
.publication-links .btn,
.publication-links-home .btn {
    font-size: 0.9em;
    padding: 0.5em 1em;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

/* BibTeX entry styling improvements */
[id^="bibtex-entry-"] {
    display: none;
    margin-top: 1em;
    background-color: var(--current-glass-bg);
    padding: 1em;
    border-radius: 8px;
    border: 1px solid var(--current-glass-border);
    position: relative;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

[id^="bibtex-entry-"] pre {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

[id^="bibtex-entry-"] code {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--current-text);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85em;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Copy button styling */
.copy-bibtex-btn {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    background: rgba(74, 144, 226, 0.8) !important;
    color: white !important;
    border: none !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    z-index: 10 !important;
    min-height: 32px !important;
    min-width: 60px !important;
}

.copy-bibtex-btn:hover {
    background: rgba(74, 144, 226, 1) !important;
    transform: scale(1.05) !important;
}

.copy-bibtex-btn:active {
    transform: scale(0.95) !important;
}

/* Dark mode adjustments for BibTeX */
.dark-mode [id^="bibtex-entry-"] {
    background-color: var(--glass-bg-dark);
    border-color: var(--glass-border-color-dark);
}

.dark-mode [id^="bibtex-entry-"] code {
    color: var(--current-text-dark);
}

/* Mobile-specific publication improvements */
@media (max-width: 768px) {
    .publication-links, .publication-links-home {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .publication-links .btn-icon,
    .publication-links-home .btn-icon,
    .publication-links .btn,
    .publication-links-home .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 0.7em 1em;
        font-size: 0.9em;
        min-height: 44px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* BibTeX entries mobile optimization */
    [id^="bibtex-entry-"] {
        margin: 1em 0;
        padding: 0.8em;
        border-radius: 6px;
    }

    [id^="bibtex-entry-"] code {
        font-size: 0.8em;
        line-height: 1.3;
    }

    .copy-bibtex-btn {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        margin-top: 10px !important;
        width: 100% !important;
        justify-content: center !important;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .publication-links .btn-icon,
    .publication-links-home .btn-icon {
        font-size: 0.85em;
        padding: 0.6em 0.8em;
    }

    [id^="bibtex-entry-"] {
        padding: 0.6em;
    }

    [id^="bibtex-entry-"] code {
        font-size: 0.75em;
    }
}

/* Button focus improvements for accessibility */
.publication-links a:focus,
.publication-links-home a:focus {
    outline: 2px solid var(--current-theme-accent);
    outline-offset: 2px;
    z-index: 10;
}

/* Prevent button text selection */
.publication-links a,
.publication-links-home a,
.copy-bibtex-btn {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Ensure buttons work properly on touch devices */
.publication-links a,
.publication-links-home a {
    -webkit-tap-highlight-color: rgba(74, 144, 226, 0.3);
}

/* Large desktop screens - enhanced button sizing */
@media screen and (min-width: 1025px) {
    .social-links .btn, .btn {
        padding: 0.45em 0.9em;
        font-size: clamp(0.75rem, 1vw, 0.85rem);
        min-height: 36px;
        /* Enhance desktop interaction */
        transition: all 0.25s ease;
    }

    .btn-icon {
        padding: 0.4em 0.8em;
        font-size: clamp(0.7rem, 0.95vw, 0.8rem);
        min-height: 34px;
    }

    /* Better hover states for desktop */
    .social-links .btn:hover, .btn:hover {
        transform: translateY(-1px);
    }

    .btn-icon:hover {
        transform: translateY(-1px);
    }

    /* Larger buttons for very wide screens */
    @media screen and (min-width: 1400px) {
        .social-links .btn, .btn {
            font-size: clamp(0.8rem, 1vw, 0.9rem);
            padding: 0.5em 1em;
        }

        .btn-icon {
            font-size: clamp(0.75rem, 0.95vw, 0.85rem);
            padding: 0.45em 0.85em;
        }
    }
}

/* Very wide screens responsiveness */
@media screen and (min-width: 1400px) {
    main {
        max-width: 1000px;
    }
    
    nav {
        max-width: 1000px;
    }
    
    .footer-content {
        max-width: 1000px;
    }
}

/* ---=== Featured Papers Grid ===--- */
.papers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.paper-card {
    background: var(--current-glass-bg);
    border: 1px solid var(--current-glass-border);
    border-radius: var(--border-radius-main);
    padding: 2rem;
    transition: all var(--transition-speed) ease;
    backdrop-filter: blur(var(--backdrop-blur-amount));
    box-shadow: var(--current-box-shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.paper-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 var(--current-glass-border);
    border-color: var(--current-theme-accent);
}

.paper-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--current-theme-accent), var(--current-theme-accent-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.paper-icon i {
    font-size: 28px;
    color: white;
}

.paper-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--current-text);
    margin: 0;
    line-height: 1.3;
}

.paper-card-subtitle {
    font-size: 1rem;
    color: var(--current-text-secondary);
    margin: 0;
    font-weight: 400;
    line-height: 1.4;
}

.paper-card-authors {
    font-size: 0.9rem;
    color: var(--current-text-secondary);
    margin: 0;
    line-height: 1.5;
}

.paper-card-meta {
    font-size: 0.9rem;
    color: var(--current-theme-accent);
    font-weight: 500;
    margin: 0;
}

.paper-card-description {
    font-size: 0.95rem;
    color: var(--current-text-secondary);
    line-height: 1.6;
    margin: 0;
    flex-grow: 1;
}

.paper-card-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.btn-paper-primary {
    flex: 1;
    min-width: 140px;
    background: var(--current-theme-accent);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius-small);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-speed) ease;
    border: 2px solid transparent;
    font-size: 0.95rem;
    white-space: nowrap;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.btn-paper-primary:hover {
    background: var(--current-theme-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.3);
}

.btn-paper-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(65, 105, 225, 0.2);
}

.btn-paper-secondary {
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius-small);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-speed) ease;
    background: transparent;
    border: 2px solid var(--current-theme-accent);
    color: var(--current-theme-accent);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    white-space: nowrap;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.btn-paper-secondary:hover {
    background: var(--current-theme-accent);
    color: white;
    transform: translateY(-2px);
}

.btn-paper-secondary:active {
    transform: translateY(0);
    background: var(--current-theme-accent-hover);
    color: white;
}

/* Responsive adjustments for paper cards */
@media screen and (max-width: 768px) {
    .papers-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .paper-card {
        padding: 1.5rem;
    }
    
    .paper-card-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-paper-primary,
    .btn-paper-secondary {
        width: 100%;
        padding: 0.65rem 0.9rem;
        font-size: 0.85rem;
        min-height: 40px;
        justify-content: center;
    }
    
    .btn-paper-primary i,
    .btn-paper-secondary i {
        font-size: 0.9rem;
    }
    
    .paper-card-title {
        font-size: 1.1rem;
    }
    
    .paper-card-subtitle {
        font-size: 0.9rem;
    }
    
    .paper-card-authors {
        font-size: 0.8rem;
    }
    
    .paper-card-meta {
        font-size: 0.8rem;
    }
    
    .paper-card-description {
        font-size: 0.85rem;
    }
}

/* Extra small devices */
@media screen and (max-width: 480px) {
    .paper-card {
        padding: 1.2rem;
    }
    
    .paper-card-actions {
        gap: 0.5rem;
    }
    
    .btn-paper-primary,
    .btn-paper-secondary {
        padding: 0.6rem 0.85rem;
        font-size: 0.8rem;
        min-height: 38px;
    }
    
    .btn-paper-primary i,
    .btn-paper-secondary i {
        font-size: 0.85rem;
    }
    
    .paper-card-title {
        font-size: 1.05rem;
        line-height: 1.3;
    }
    
    .paper-card-subtitle {
        font-size: 0.85rem;
    }
    
    .paper-icon {
        width: 48px;
        height: 48px;
    }
    
    .paper-icon i {
        font-size: 22px;
    }
}