/* =========================================
   1. CORE STYLES & ANIMATIONS
   ========================================= */
html { scroll-behavior: smooth; }

body {
    font-family: 'Raleway', sans-serif;
    color: #333;
    line-height: 1.7;
    font-size: 14px;
    margin: 0;
    background-color: #fafafa;
    transition: background-color 0.3s, color 0.3s;
    animation: fadeInPage 0.6s ease-out;
}

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

.main-wrapper {
    position: relative;
    max-width: 800px;
    margin: 60px auto;
    background: #fff;
    padding: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border-radius: 8px;
    transition: background-color 0.3s, box-shadow 0.3s;
}

/* =========================================
   2. HEADER & PROFILE
   ========================================= */
header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
}

.avatar {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 3px solid #fff;
}

.header-content h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 5px 0;
    letter-spacing: -0.5px;
    color: #222;
}

.header-content p { margin: 0; color: #666; font-size: 14px; }
.header-content .phone { font-size: 12px; color: #888; margin-top: 5px; }

.social-links { margin-top: 15px; display: flex; gap: 6px; }

.social-links a {
    margin-right: 0;
    font-weight: 600;
    font-size: 16px;
    color: #555;
    text-decoration: none;
    border-bottom: none;
}
.social-links a:hover { color: #0056b3; border-bottom: none; }
.social-links i { margin-right: 0; }

/* =========================================
   3. LINKS
   ========================================= */
a {
    color: #0056b3;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

a:hover {
    color: #003d82;
    border-bottom: 1px solid #003d82;
    background-color: rgba(0, 86, 179, 0.05);
}

/* =========================================
   4. SECTIONS (always open)
   ========================================= */
section { margin-bottom: 45px; }

h3 {
    font-size: 24px;
    text-transform: none;
    letter-spacing: 0;
    color: #222;
    margin: 0 0 25px 0;
    font-weight: 300;
    border-bottom: 1px solid #eee;
    padding: 10px;
}

.section-content { padding: 10px 10px 20px 10px; }

.interests { font-size: 13px; list-style-type: square; padding-left: 20px; }

/* =========================================
   5. TIMELINE & LISTS
   ========================================= */
.timeline {
    border-left: 2px solid #f0f0f0;
    padding-left: 20px;
    margin-left: 5px;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    padding: 15px;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.timeline-item:hover {
    background-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 20px;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 2px solid #444;
    border-radius: 50%;
}

.t-title { font-weight: 700; margin: 0; font-size: 15px; color: #222; }
.t-role  { font-weight: 600; font-size: 14px; margin: 2px 0; color: #555; }
.t-date  { font-size: 12px; color: #888; float: right; font-weight: 600; text-transform: uppercase; }
.t-desc  { margin-top: 8px; color: #555; font-size: 13px; }
.t-desc ul { margin: 5px 0; padding-left: 18px; }
.t-desc li { margin-bottom: 4px; }

/* =========================================
   6. NEWS, PUBLICATIONS & QUOTES
   ========================================= */
.news-item { display: flex; margin-bottom: 15px; font-size: 13px; }
.news-date { min-width: 90px; font-weight: 600; color: #b04a3c; font-size: 13px; text-transform: none; padding-top: 0; }

.pub-year { font-weight: 300; font-size: 20px; color: #222; padding-bottom: 10px; border-bottom: 1px solid #e6e6e6; margin-bottom: 16px; }
.pub-item { padding: 0; margin-bottom: 20px; }
.pub-item p { margin: 2px 0; }
.pub-title { font-weight: 600; font-size: 14px; color: #222; }
.pub-authors { color: #333; font-size: 13px; }
.pub-venue { color: #555; font-size: 13px; font-style: italic; margin-bottom: 8px !important; }
.pub-links { margin-top: 10px !important; }
a.pub-btn { display: inline-block; border: 1px solid #ccc; border-radius: 4px; padding: 1px 14px; font-size: 11px; color: #777; margin-right: 6px; line-height: 1.6; }
a.pub-btn:hover { color: #0056b3; border-color: #0056b3; border-bottom: 1px solid #0056b3; background: transparent; }

.quote-block {
    margin: 25px 0 0;
    padding: 15px;
    background-color: #fcfcfc;
    border-left: 3px solid #eee;
    border-radius: 4px;
}
.quote-text   { font-style: italic; color: #555; margin-bottom: 5px; display: block; }
.quote-author { font-size: 12px; font-weight: 700; text-align: right; color: #333; display: block; }

/* =========================================
   7. THEME TOGGLE BUTTON
   ========================================= */
.theme-toggle-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #666;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s, color 0.2s;
}
.theme-toggle-btn:hover { background-color: rgba(0,0,0,0.06); color: #222; }
.theme-toggle-btn:focus-visible { outline: 2px solid #8ab4f8; outline-offset: 2px; }
body.dark-mode .theme-toggle-btn { color: #ccc; }
body.dark-mode .theme-toggle-btn:hover { background-color: rgba(255,255,255,0.1); color: #fff; }

/* =========================================
   8. DARK MODE
   ========================================= */
body.dark-mode { background-color: #121212; color: #e0e0e0; }

body.dark-mode .main-wrapper {
    background-color: #1e1e1e;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

body.dark-mode .header-content h1,
body.dark-mode .t-title,
body.dark-mode .pub-title,
body.dark-mode .news-date,
body.dark-mode .quote-author { color: #fff; }

body.dark-mode .header-content p,
body.dark-mode .t-role,
body.dark-mode .t-desc,
body.dark-mode .pub-authors,
body.dark-mode .pub-venue,
body.dark-mode .quote-text { color: #b0b0b0; }

body.dark-mode .t-date { color: #999; }
body.dark-mode .avatar { border-color: #333; }
body.dark-mode h3 { border-bottom-color: #333; }
body.dark-mode .social-links a { color: #ccc; }
body.dark-mode .social-links a:hover { color: #8ab4f8; }

body.dark-mode a { color: #8ab4f8; }
body.dark-mode a:hover { background-color: rgba(138, 180, 248, 0.1); border-bottom-color: #8ab4f8; }

body.dark-mode .timeline { border-left-color: #333; }
body.dark-mode .timeline-item:hover { background-color: #252525; box-shadow: none; }
body.dark-mode .timeline-item::before { background-color: #1e1e1e; border-color: #888; }
body.dark-mode .quote-block { background-color: #252525; border-left-color: #444; }

/* =========================================
   9. MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 600px) {
    .main-wrapper { margin: 0; padding: 20px; border-radius: 0; box-shadow: none; }
    header { flex-direction: column; text-align: center; gap: 15px; }
    .t-date { float: none; display: block; margin-bottom: 4px; }
    .news-item { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
}

body.dark-mode .pub-year { color: #fff; border-bottom-color: #333; }
body.dark-mode .news-date { color: #e08a7c; }
body.dark-mode a.pub-btn { color: #aaa; border-color: #555; }

body.dark-mode h3 { color: #e8e8e8; }

/* Publication status pills and topic tags */
.pub-year-2 { margin-top: 34px; }
.pub-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 6px 0 0 !important; }
.status { font-size: 11px; font-weight: 600; color: #b04a3c; background: #fbeeec; border-radius: 20px; padding: 1px 10px; }
.status-pub { color: #1d6a8a; background: #e8f3f8; }
.tags { font-size: 12px; color: #888; }

body.dark-mode .status { color: #e08a7c; background: rgba(224, 138, 124, 0.15); }
body.dark-mode .status-pub { color: #7fc4de; background: rgba(127, 196, 222, 0.15); }
body.dark-mode .tags { color: #999; }
