/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base variables */
:root {
    --max-width: 1000px;
}

/* Dark theme variables (default) */
:root,
[data-theme="dark"] {
    --primary-color: #007acc;
    --text-color: #ffffff;
    --secondary-text: #cccccc;
    --background-color: #1a1a1a;
    --card-background: #2a2a2a;
    
    /* RGB values for scroll animations */
    --background-color-rgb: 26, 26, 26;
    --border-color-rgb: 68, 68, 68;
    --border-color: #404040;
    --badge-blue: #007acc;
}

/* Light theme variables */
[data-theme="light"] {
    --primary-color: #007acc;
    --text-color: #333333;
    --secondary-text: #666666;
    --background-color: #ffffff;
    --card-background: #f8f9fa;
    
    /* RGB values for scroll animations */
    --background-color-rgb: 255, 255, 255;
    --border-color-rgb: 221, 221, 221;
    --border-color: #e0e0e0;
    --badge-blue: #007acc;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 14px;
}

/* Navigation */
.navbar {
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 20px 0;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-toggle {
    display: none !important;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px 0;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* Social Icons */
.social-icons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.social-icon {
    color: var(--text-color);
    text-decoration: none;
    padding: 8px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
}

.social-icon:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.social-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* Email icon needs to be slightly larger to match others */
.social-icon:first-child svg {
    width: 28px;
    height: 28px;
}

/* Name Link (Publications Page) */
.name-section {
    display: flex;
    align-items: center;
}

.name-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 400;
    transition: color 0.3s ease;
}

.name-link:hover {
    color: var(--primary-color);
}

/* Navigation Right */
.nav-right {
    display: flex;
    align-items: center;
}

.nav-menu {
    list-style: none;
    display: flex !important;
    gap: 30px;
    padding: 20px 0;
    margin: 0;
    align-items: center;
    height: 40px;
    position: static !important;
    width: auto !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 400;
    transition: color 0.3s ease;
    position: relative;
    font-size: .9rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: " (current)";
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.3s ease;
    margin-left: 10px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.theme-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.theme-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Main Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 20px;
}

.section {
    margin-bottom: 60px;
}

/* About Section */
.name-title {
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 25px;
    color: var(--text-color);
}

.profile-section {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 30px;
}

.profile-content {
    flex: 1;
    order: 1;
}

.profile-image {
    order: 2;
    flex-shrink: 0;
    width: 250px;
}

.avatar {
    width: 100%;
    height: 250px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: block;
}

.profile-image .contact-info {
    margin-top: 10px;
    margin-bottom: 0;
    width: 100%;
    text-align: center;
}

.email {
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 0;
    word-wrap: break-word;
    line-height: 1.2;
    font-family: 'Courier New', monospace;
    width: 100%;
    text-align: center;
    padding: 6px 0;
    background-color: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bio-section p {
    margin-bottom: 12px;
    line-height: 1.5;
    color: var(--secondary-text);
    font-size: 0.95rem;
}

.advisor-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 400;
}

.advisor-link:hover {
    text-decoration: underline;
}

/* Publications Section */
.section-title {
    font-size: 1.6rem;
    font-weight: 400;
    margin-bottom: 25px;
    color: var(--text-color);
}

.page-title {
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 30px;
    color: var(--text-color);
    text-align: left;
}

.publication-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.publication-item {
    padding: 15px 0;
    background-color: transparent;
    border: none;
    display: block;
    position: relative;
    width: 100%;
    clear: both;
}

.conference-badge {
    display: block;
    background-color: var(--badge-blue);
    color: white;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 0.80rem;
    font-weight: 550;
    margin-bottom: 0px;
    text-transform: uppercase;
    float: left;
    margin-right: 20px;
    margin-top: 0px;
    width: 250px;
    text-align: center;
    box-sizing: border-box;
}

.publication-content {
    overflow: hidden;
    margin-left: 270px;
}

.pub-title {
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 5px;
    color: var(--text-color);
    clear: none;
}

.authors {
    margin-bottom: 5px;
    color: var(--secondary-text);
    clear: none;
    font-size: 0.9rem;
}

.your-name {
    font-weight: 400;
    text-decoration: underline;
    color: var(--text-color);
}

.venue {
    font-style: italic;
    margin-bottom: 6px;
    color: var(--secondary-text);
    clear: none;
    font-size: 0.9rem;
}

.award {
    background-color: transparent;
    color: var(--primary-color);
    padding: 4px 0;
    margin-bottom: 8px;
    border: none;
    clear: left;
}

.pub-links {
    display: flex;
    gap: 15px;
    clear: left;
    margin-top: 5px;
}

.pub-link {
    display: inline-block;
    padding: 4px 8px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.75rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-weight: 400;
}

.pub-link:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* CV Section */
.cv-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 400;
}

.cv-link:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background-color: var(--card-background);
    border-top: 1px solid var(--border-color);
    padding: 30px 20px;
    text-align: center;
    color: var(--secondary-text);
    font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding: 10px 20px;
    }
    
    .social-icons {
        order: 1;
        gap: 15px;
    }
    
    .nav-right {
        position: relative !important;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        z-index: 1600 !important;
    }
    
    .nav-toggle {
        display: block !important;
        align-self: flex-end;
        z-index: 1601 !important;
        position: relative !important;
        background: none;
        border: none;
        cursor: pointer;
        padding: 10px;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
        position: absolute !important;
        top: 100% !important;
        right: 10px;
        width: 200px;
        max-width: calc(100vw - 30px);
        background-color: var(--background-color) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
        z-index: 1600 !important;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .theme-toggle {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .profile-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .profile-content {
        order: 2;
    }
    
    /* Keep bio text left-aligned on mobile */
    .bio-section {
        text-align: left;
    }
    
    .bio-section p {
        text-align: left;
    }
    
    .profile-image {
        order: 1;
        width: 240px;
    }
    
    .profile-image .contact-info {
        margin-top: 12px;
        width: 100%;
    }
    
    .avatar {
        width: 100%;
        height: 220px;
    }
    
    .name-title {
        font-size: 2rem;
        text-align: center;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .publication-item {
        padding: 20px;
    }
    
    .pub-title {
        font-size: 1.1rem;
    }
    
    .pub-links {
        flex-wrap: wrap;
    }
    
    .conference-badge {
        float: none;
        display: block;
        width: auto;
        margin-bottom: 10px;
        margin-right: 0;
    }
    
    .publication-content {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 8px 15px;
        position: relative;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-direction: row !important;
    }
    
    .social-icons {
        order: 1 !important;
        gap: 10px !important;
    }
    
    .nav-right {
        order: 2 !important;
        position: relative !important;
        z-index: 2000 !important;
        margin-left: auto !important;
    }
    
    .nav-toggle {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        z-index: 2001 !important;
        position: relative !important;
        background: var(--text-color) !important;
        border: none !important;
        cursor: pointer !important;
        padding: 8px !important;
        border-radius: 4px !important;
        width: 40px !important;
        height: 32px !important;
        margin: 0 !important;
    }
    
    .nav-toggle span {
        display: block !important;
        width: 24px !important;
        height: 3px !important;
        background-color: var(--background-color) !important;
        border-radius: 1px !important;
        transition: all 0.3s ease !important;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        gap: 15px;
        width: 180px;
        padding: 15px;
        right: 0px;
        max-width: calc(100vw - 30px);
        z-index: 2000 !important;
        position: absolute !important;
        top: 100% !important;
        background-color: var(--background-color) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
        margin-top: 8px !important;
    }
    
    .nav-menu.active {
        display: flex !important;
    }
    
    .container {
        padding: 20px 15px;
    }
    
    .name-title {
        font-size: 1.75rem;
    }
    
    /* Ensure bio text stays left-aligned on small mobile */
    .bio-section {
        text-align: left !important;
    }
    
    .bio-section p {
        text-align: left !important;
    }
    
    .profile-image {
        width: 220px;
    }
    
    .avatar {
        width: 100%;
        height: 220px;
    }
    
    .email {
        font-size: 1rem;
        word-break: break-all;
    }
    
    .theme-toggle {
        padding: 6px 10px;
        margin-left: 5px;
    }
    
    .conference-badge {
        float: none;
        display: block;
        width: auto;
        margin-bottom: 8px;
        margin-right: 0;
        text-align: center;
    }
    
    .publication-content {
        margin-left: 0;
    }
}

/* CV Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background-color: var(--background-color);
    margin: 2% auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    position: relative;
}

.close {
    color: var(--secondary-text);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 10px;
}

.close:hover,
.close:focus {
    color: var(--text-color);
    text-decoration: none;
}

#cv-iframe {
    border: none;
    border-radius: 4px;
    background-color: white;
}
