/* ---------- Global ---------- */
body {
    margin: 0;
    font-family: "Georgia", "Times New Roman", serif;
    background-color: #ffffff;
    color: #222;
    line-height: 1.7;
    transition: background-color 0.3s, color 0.3s;
}

/* ---------- Container Grid ---------- */
.container {
    display: grid;
    grid-template-columns: 120px 1fr 350px;
    gap: 20px;
    max-width: 1300px;
    margin: 20px auto;
    padding: 0 20px;
}

/* ---------- Columns ---------- */
.column-left {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.column-main {
    overflow: visible;
}

.column-right {
    
    top: 20px;
    height: fit-content;
}

/* ---------- Vertical Navigation ---------- */
.vertical-nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.vertical-nav a {
    text-decoration: none;
    font-size: 1.2em;
    font-weight: bold;
    color: #1a4cff;
    transition: color 0.3s, transform 0.2s;
}

.vertical-nav a:hover {
    color: #0d2acb;
    transform: translateX(5px);
}

/* ---------- Dark Mode Button (Sidebar) ---------- */
.theme-toggle {
    margin-top: 30px;
    width: 100%;
    padding: 10px 14px;

    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;

    background: linear-gradient(135deg, #f5f5f5, #e6e6e6);
    color: #333;

    border: 1px solid #ccc;
    border-radius: 10px;

    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    transition: all 0.25s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.18);
}

/* Dark mode appearance */
body.dark .theme-toggle {
    background: linear-gradient(135deg, #2a2a2a, #1e1e1e);
    color: #e0e0e0;
    border-color: #444;
}


/* ---------- Profile ---------- */
.profile {
    text-align: center;
    margin-bottom: 40px;
}

.profile-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 2px solid #1a4cff;
}

/* ---------- Sections ---------- */
section {
    margin-bottom: 40px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0px 1px 6px rgba(0,0,0,0.1);
}

/* ---------- Projects Grid ---------- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.project img {
    width: 100%;
    border-radius: 6px;
}

.project h3 {
    margin: 10px 0 5px 0;
}

/* ---------- News Column ---------- */
.news {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0px 1px 6px rgba(0,0,0,0.1);
}

/* ---------- Dark Mode ---------- */
body.dark {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark section, body.dark .news {
    background-color: #1e1e1e;
    box-shadow: 0px 2px 8px rgba(0,0,0,0.3);
}

body.dark .vertical-nav a {
    color: #8ab4f8;
}

body.dark #theme-toggle {
    background: #222;
    color: #e0e0e0;
    border: 1px solid #555;
}

body.dark #theme-toggle:hover {
    background: #333;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: 180px 1fr 200px;
    }
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }

    .column-left, .column-right {
        position: relative;
        top: 0;
        height: auto;
        margin-bottom: 20px;
    }

    .vertical-nav {
        flex-direction: row;
        gap: 15px;
        border-bottom: 1px solid #ddd;
        padding-bottom: 10px;
        overflow-x: auto;
    }
}

/* ---------- BibTeX Modal ---------- */
.bibtex-content {
    display: none;
}

.bibtex-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
}

.bibtex-box {
    background: #ffffff;
    max-width: 600px;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    position: relative;
}

body.dark .bibtex-box {
    background: #1e1e1e;
}

.bibtex-box pre {
    white-space: pre-wrap;
    font-size: 0.9em;
    max-height: 300px;
    overflow-y: auto;
}

#bibtex-close {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 1.2em;
    background: none;
    border: none;
    cursor: pointer;
}

/* ---------- Mobile Layout ---------- */
@media (max-width: 768px) {

    .container {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .column-left,
    .column-right {
        position: relative;
        top: 0;
        width: 100%;
        margin-bottom: 20px;
    }

    .vertical-nav {
        flex-direction: row;
        justify-content: center;
        gap: 15px;
        overflow-x: auto;
        padding-bottom: 10px;
        border-bottom: 1px solid #ddd;
    }

    body {
        overflow-x: hidden;
    }
}
