/* --- Global Styles & Variables --- */
:root {
    --bg-color: #1a1a1a;
    --primary-color: #2a2a2a;
    --secondary-color: #3b82f6; 
    --text-color: #e5e7eb;
    --subtle-text-color: #9ca3af;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    font-size: 16px;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

h1, h2, h3 { font-family: var(--font-heading); color: #fff; margin-bottom: 1rem; }
h1 { font-size: 3.5rem; line-height: 1.2; }
h2 { font-size: 3rem; text-align: center; margin-bottom: 3rem; }
h3 { font-family: var(--font-body); font-weight: 600; font-size: 1.25rem; }

a { color: var(--secondary-color); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: #60a5fa; }

.section { padding: 6rem 0; }
.section:not(.hero) { border-top: 1px solid #333; }
.hero { padding: 4rem 0; }

/* --- Header & Navigation --- */
header {
    background: rgba(26, 26, 26, 0.8); backdrop-filter: blur(10px);
    padding: 1rem 0; position: sticky; top: 0; width: 100%; z-index: 1000;
    border-bottom: 1px solid #333;
}
header .container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; color: #fff; }
nav ul { display: flex; list-style: none; }
nav ul li { margin-left: 2rem; }
nav ul li a { color: var(--text-color); font-weight: 600; padding-bottom: 5px; position: relative; }
nav ul li a::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 0; height: 2px; background-color: var(--secondary-color);
    transition: width 0.3s ease;
}
nav ul li a:hover::after { width: 100%; }

/* --- CSS-based Active Page Highlighting --- */
.home-page .nav-home a,
.research-page .nav-research a,
.publications-page .nav-publications a {
    color: var(--secondary-color);
}
.home-page .nav-home a::after,
.research-page .nav-research a::after,
.publications-page .nav-publications a::after {
    width: 100%;
}

.hamburger { display: none; background: none; border: none; color: var(--text-color); font-size: 1.5rem; cursor: pointer; }

/* --- Page Specific Styles --- */
.home-layout { display: grid; grid-template-columns: 2fr 1fr; align-items: center; gap: 3rem; }
.home-text .subtitle { font-size: 1.5rem; color: var(--subtle-text-color); margin-bottom: 1.5rem; font-weight: 400; font-family: var(--font-body); }
.home-text .bio { font-size: 1.1rem; }
.home-img img { max-width: 100%; border-radius: 50%; border: 5px solid var(--primary-color); box-shadow: 0 0 20px rgba(59, 130, 246, 0.2); }
.research-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.project-card { background: var(--primary-color); padding: 2rem; border-radius: 10px; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.project-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); }
.project-card h3 { color: var(--secondary-color); }
.project-links { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 1.5rem; }
.project-links .link i { margin-left: 0.3rem; }
.publication-list { list-style: none; }
.publication-list li { background: var(--primary-color); padding: 1.5rem; margin-bottom: 1rem; border-radius: 5px; border-left: 4px solid var(--secondary-color); }
.publication-list span { display: block; }
.publication-list .title { font-weight: 600; color: #fff; margin: 0.2rem 0; font-size: 1.1rem; }
.publication-list .venue { font-style: italic; color: var(--subtle-text-color); }
.publication-list .links { margin-top: 0.5rem; }
.text-center { text-align: center; }
.social-icons a, .social-icons .info-tooltip { 
    font-size: 2rem; 
    color: var(--subtle-text-color); 
    margin: 0 1rem; 
}
/* The brand hover color is now handled further down, so this default can be simplified */
.social-icons a:hover, .social-icons .info-tooltip:hover { 
    color: var(--secondary-color); 
}
footer { padding: 2rem 0; text-align: center; color: var(--subtle-text-color); background: #111; }

/* --- Tooltip Styles (Final Unified Version) --- */
/* Base positioning for all elements that have a tooltip */
.link-tooltip,
.info-tooltip,
.project-links .link,
.publication-list .links a,
.social-icons a {
    position: relative;
}

/* Dotted underline ONLY for text-based links */
.link-tooltip,
.info-tooltip,
.project-links .link,
.publication-list .links a {
    border-bottom: 1px dotted var(--secondary-color);
    text-decoration: none;
}

/* Pointer cursor for clickable items */
.link-tooltip,
.project-links .link,
.publication-list .links a,
.social-icons a {
    cursor: pointer; 
}
/* Help cursor for informational items */
.info-tooltip { 
    cursor: pointer; 
}

/* The invisible tooltip box that appears on hover */
.link-tooltip::after,
.info-tooltip::after,
.project-links .link::after,
.publication-list .links a::after,
.social-icons a::after {
    position: absolute; bottom: 125%; left: 50%; transform: translateX(-50%);
    background-color: #333; color: #fff; padding: 8px 12px; border-radius: 5px;
    font-size: 0.9rem; z-index: 10;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* The hover trigger to show the tooltip */
.link-tooltip:hover::after,
.info-tooltip:hover::after,
.project-links .link:hover::after,
.publication-list .links a:hover::after,
.social-icons a:hover::after {
    opacity: 1;
    visibility: visible;
}

/* --- Specific Tooltip Content --- */
/* For ALL clickable links */
.link-tooltip::after,
.project-links .link::after,
.publication-list .links a::after,
.social-icons a::after {
    font-family: var(--font-body), "Font Awesome 6 Free";
    font-weight: 600;
    content: 'Visit \00a0 \f0c1';
    white-space: nowrap;
}

/* For the informational tooltip (data-driven content) */
.info-tooltip::after {
    content: attr(data-tooltip);
    font-family: var(--font-body);
    width: 220px;
    text-align: center;
}
.info-tooltip::before {
    content: ''; position: absolute; bottom: calc(125% - 5px); left: 50%;
    transform: translateX(-50%); border-width: 5px; border-style: solid;
    border-color: #333 transparent transparent transparent;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.info-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* --- Contact Section Styles --- */
#contact-info {
    padding: 3rem 0;
    background-color: var(--primary-color);
    border-top: 1px solid #333;
}
#contact-info h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}
#contact-info p {
    max-width: 600px;
    margin: 0 auto 1.5rem auto;
    font-size: 1.0rem;
    color: var(--subtle-text-color);
}
.email-link {
    font-size: 1.1rem;
    display: inline-block;
    margin-bottom: 1.5rem;
    background: var(--primary-color);
    padding: 10px 20px;
    border-radius: 5px;
}

/* --- Responsive Design --- */
@media(max-width: 900px) {
    .home-layout { grid-template-columns: 1fr; text-align: center; }
    .home-img { grid-row: 1; margin-bottom: 2rem; }
    .home-img img { width: 200px; height: 200px; margin: 0 auto; }
}
@media(max-width: 768px) {
    h1 { font-size: 2.8rem; }
    h2 { font-size: 2.2rem; }
    .hamburger { display: block; }
    nav {
        display: none; position: absolute; top: 100%; right: 0; width: 100%;
        background: var(--primary-color);
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    }
    nav.active { display: block; }
    nav ul { flex-direction: column; align-items: stretch; }
    nav ul li { margin-left: 0; }
    nav ul li a { display: block; text-align: center; padding: 1rem; border-bottom: 1px solid #333; }
    nav ul li a::after { content: none; }
}

/* --- Brand Colors for Social Icons on Hover --- */
.social-icons a[aria-label="GitHub"]:hover { color: #FFFFFF; }
.social-icons a[aria-label="LinkedIn"]:hover { color: #0A66C2; }
.social-icons .info-tooltip[aria-label="Address"]:hover {
    color: #E74C3C;border-bottom: none;}
.social-icons a[aria-label="Google Scholar"]:hover { color: #4285F4; }

