/* ==========================
   THEME VARIABLES
   ========================== */

:root {
    --bg: #4a4a4a;
    --text: #f2f2f2;
    --content-text: #f0f0f0;
    --secondary-text: #e3e3e3;
    --muted-text: #dddddd;
    --sidebar-text: #f5f5f5;
    --border: #777;
    --link: #00b7ff;
}

body.light-mode {
    --bg: #ffffff;
    --text: #222222;
    --content-text: #333333;
    --secondary-text: #444444;
    --muted-text: #666666;
    --sidebar-text: #333333;
    --border: #d0d0d0;
    --link: #0066cc;
}

/* ==========================
   GLOBAL
   ========================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Times New Roman", Times, serif;
}

body {
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    transition: background 0.3s ease, color 0.3s ease;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ==========================
   PHD BANNER
   ========================== */

.phd-banner {
    background: #ffffff;
    color: green;
    border: 4px solid green;
    padding: 12px;
    margin-bottom: 25px;
    text-align: center;
    font-weight: bold;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.3;
    }
}

/* ==========================
   NAVIGATION
   ========================== */

.navbar {
    height: 72px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 1000;
}

.nav-wrapper {
    width: 1400px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}

.site-title {
    font-size: 1rem;
    font-weight: 700;
    border-bottom: 2px solid var(--text);
    padding-bottom: 10px;
}

nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

nav a {
    color: var(--text);
    font-size: 1rem;
}

nav a.active {
    border-bottom: 2px solid var(--text);
    padding-bottom: 10px;
    font-weight: 700;
}

/* ==========================
   LAYOUT
   ========================== */

.container {
    max-width: 1400px;
    margin: auto;
    display: flex;
}

/* ==========================
   SIDEBAR
   ========================== */

.sidebar {
    width: 280px;
    border-right: 1px solid var(--border);
    padding: 35px 25px;
    min-height: calc(100vh - 72px);
}

.profile-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 3px solid #d8d8d8;
    object-fit: cover;
    margin-bottom: 25px;
}

.sidebar h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.bio {
    color: var(--secondary-text);
    margin-bottom: 22px;
}

.sidebar-links {
    list-style: none;
}

.sidebar-links li {
    margin-bottom: 14px;
    color: var(--sidebar-text);
}

.sidebar-links i {
    width: 20px;
    margin-right: 8px;
    text-align: center;
    vertical-align: middle;
}

/* ==========================
   CONTENT
   ========================== */

.content {
    flex: 1;
    padding: 35px 55px;
}

.content h1 {
    font-size: 3rem;
    margin-bottom: 18px;
    line-height: 1.2;
    font-weight: 700;
}

.content h2 {
    font-size: 2rem;
    margin-bottom: 14px;
    font-weight: 700;
}

.content p {
    margin-bottom: 16px;
    color: var(--content-text);
    max-width: 850px;
}

/* ==========================
   PUBLICATIONS
   ========================== */

.section-title {
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
    margin-bottom: 35px;
}

.publication {
    margin-bottom: 45px;
}

.publication h3 {
    font-size: 1.5rem;
    margin-bottom: 6px;
    font-weight: 700;
}

.publication-meta {
    color: var(--secondary-text);
    margin-bottom: 14px;
}

.citation {
    color: var(--content-text);
    margin-bottom: 10px;
}

.download-links a {
    margin-right: 12px;
}

/* ==========================
   FOOTER
   ========================== */

footer {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    margin-top: 60px;
    color: var(--muted-text);
}

.footer-top {
    margin-bottom: 12px;
    font-weight: 700;
}

/* ==========================
   CV PAGE
   ========================== */

.cv-page {
    height: 100vh;
    overflow: hidden;
}

.pdf-container {
    width: 100%;
    height: calc(100vh - 72px);
}

.pdf-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================
   MOBILE
   ========================== */

@media (max-width: 900px) {

    .nav-wrapper {
        flex-direction: column;
        justify-content: center;
        gap: 12px;
        padding: 12px 20px;
    }

    .navbar {
        height: auto;
        padding: 10px 0;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 18px;
    }

    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        text-align: center;
    }

    .profile-img {
        width: 150px;
        height: 150px;
    }

    .sidebar-links {
        padding-left: 0;
    }

    .content {
        padding: 30px 22px;
    }

    .content h1 {
        font-size: 2.2rem;
    }

    .content h2 {
        font-size: 1.8rem;
    }

    .publication h3 {
        font-size: 1.25rem;
    }

    .pdf-container {
        height: calc(100vh - 110px);
    }

    .theme-switch {
        margin-top: 8px;
    }
}

/* ==========================
   RED STAPLER STYLE TOGGLE
   ========================== */

.theme-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 18px;
}

.theme-switch input {
    display: none;
}

.slider {
    position: absolute;
    inset: 0;
    background: #2d2d2d;
    border-radius: 18px;
    cursor: pointer;
}

.knob {
    position: absolute;
    width: 14px;
    height: 14px;
    left: 2px;
    top: 2px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-switch input:checked + .slider .knob {
    transform: translateX(18px);
}

.knob img {
    width: 8px;
    height: 8px;
}

.theme-switch input:checked + .slider .moon-icon {
    opacity: 0.3;
}

.theme-switch input:not(:checked) + .slider .sun-icon {
    opacity: 0.3;
}