/* Personal Website Styles - Generated from YAML Configuration */

/* CSS Variables */
:root {
    --bg-color: #fcfcfc;
    --text-color: #333333;
    --link-color: #4183C4;
    --link-hover-color: #316293;
    --header-text-color: #7A7573;
    --section-header-color: #333333;
    --year-filter-active: #d4524e;
    --year-filter-bg: #f8f8f8;
    --random-fact-color: #666666;
    --footer-color: #666666;
    --body-font: "Georgia", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --header-font: "Palatino", "KaiTi", monospace;
    --monospace-font: "Lucida Console", Consolas, "Courier", monospace;
    --page-width: 800px;
    --content-padding: 30px;
    --header-font-size: 32px;
    --body-font-size: 14px;
    --line-height: 1.75;
}

/* Base HTML and Body */
html {
    font-size: var(--body-font-size);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--body-font);
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    padding: var(--content-padding);
    box-sizing: border-box;
    outline: 0px !important;
    line-height: var(--line-height);
    height: auto;
    overflow-x: auto;
    background: inherit;
    tab-size: 4;
    font-variant-ligatures: no-common-ligatures;
}

/* Main Content */
.content {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 0;
}

#main {
    width: 100%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    position: relative;
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-weight: bold;
    line-height: 1.4;
    cursor: text;
    color: var(--section-header-color);
}

h1 {
    font-size: 2.25rem;
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.75rem;
    line-height: 1.225;
    margin: 35px 0 20px;
    padding-bottom: 0.3em;
}

h3 {
    font-size: 1.5rem;
    line-height: 1.43;
    margin: 20px 0 16px;
}

h4 {
    color: var(--section-header-color);
    font-size: 1.25rem;
    margin: 0.83rem 0;
}

h5 {
    font-size: 1rem;
    margin: 0.67rem 0;
}

h6 {
    font-size: 0.85rem;
    margin: 0.67rem 0;
}

p {
    line-height: calc(var(--line-height) * 1rem);
    word-spacing: 0.05rem;
    margin: 0.8rem 0;
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: none;
    outline: 0px;
}

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

/* Lists */
ul, ol {
    padding-left: 30px;
    margin: 0.8rem 0;
}

li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

/* Tables */
table {
    padding: 0;
    word-break: initial;
    border-collapse: collapse;
    border-spacing: 0;
}

/* Social Links Table - no borders, full width */
table:first-of-type {
    width: var(--page-width);
    margin: 0 auto;
    display: table;
    position: static;
}

table:first-of-type tr,
table:first-of-type tr th,
table:first-of-type tr td {
    border: none;
    background: none;
    padding: 6px 13px;
}

/* Industry Experience Tables - no borders */
.experience-table,
.experience-table tr,
.experience-table tr th,
.experience-table tr td {
    border: none;
    background: none;
    padding: 6px 13px;
}

/* Other tables with borders */
table.bordered tr {
    border: 1px solid #dfe2e5;
    margin: 0;
    padding: 0;
}

table.bordered tr:nth-child(2n),
table.bordered thead {
    background-color: #f8f8f8;
}

table.bordered tr th {
    font-weight: bold;
    border: 1px solid #dfe2e5;
    border-bottom: 0;
    margin: 0;
    padding: 6px 13px;
}

table.bordered tr td {
    border: 1px solid #dfe2e5;
    margin: 0;
    padding: 6px 13px;
}

table.bordered tr th:first-child,
table.bordered tr td:first-child {
    margin-top: 0;
}

table.bordered tr th:last-child,
table.bordered tr td:last-child {
    margin-bottom: 0;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border: 0;
}

/* About table styling - no borders like experience tables */
.about-table,
.about-table tr,
.about-table tr th,
.about-table tr td {
    border: none;
    background: none;
    padding: 6px 13px;
}

/* Profile photo in About section */
.about-photo img {
    width: 200px;
    height: auto;
    max-width: none;
    border-radius: 8px;
}

/* Company logos in experience tables only */
.experience-table td:last-child img {
    height: 80px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

/* Text Formatting */
strong, b {
    font-weight: bold;
}

em, i {
    font-style: italic;
}

u {
    text-decoration: underline;
}

/* Publication Filtering */
.publication-filters {
    margin: 20px 0;
    text-align: left;
}

.year-filter {
    background: var(--year-filter-bg);
    border: 1px solid #ddd;
    padding: 5px 12px;
    margin-right: 5px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 3px;
    transition: all 0.2s;
}

.year-filter:hover {
    background: #e8e8e8;
}

.year-filter.active {
    background: var(--year-filter-active);
    color: white;
    border-color: var(--year-filter-active);
}

.year-section {
    margin: 20px 0;
}

.year-section[style*="display: none"] {
    display: none !important;
}

.publication-year {
    color: #666;
    font-size: 1.1em;
    margin: 15px 0 10px 0;
    font-weight: normal;
}

.publication-entry {
    margin: 12px 0;
}

.publication-entry p {
    margin: 5px 0;
}

.publication-highlight {
    color: #e74c3c;
    font-weight: 600;
    font-style: italic;
    margin: 5px 0;
    font-size: 13px;
}

/* News Styling */
.news-item {
    margin: 10px 0;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
}

.news-date {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 4px 10px;
    margin-right: 8px;
    font-size: 11px;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    flex-shrink: 0;
    white-space: nowrap;
}

.news-content {
    flex: 1;
    min-width: 0;
}

.news-links {
    margin-left: 8px;
}

.news-link {
    display: inline-block;
    background: var(--link-color);
    color: white;
    padding: 3px 10px;
    margin-left: 4px;
    font-size: 12px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.news-link:hover {
    background: var(--link-hover-color);
    color: white;
    text-decoration: none;
}

/* Awards Styling */
.award-item {
    margin: 10px 0;
    line-height: 1.6;
}

.award-date {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 4px 10px;
    margin-right: 8px;
    font-size: 11px;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.award-content {
    display: inline;
}

/* Bibliography Modal */
.bib-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.bib-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    max-height: 70vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.bib-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 15px;
    top: 10px;
    cursor: pointer;
}

.bib-close:hover,
.bib-close:focus {
    color: #000;
    text-decoration: none;
}

.bib-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-right: 40px;
}

.bib-content {
    font-family: var(--monospace-font);
    font-size: 13px;
    background: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    white-space: pre-wrap;
    line-height: 1.4;
    border: 1px solid #ddd;
}

.bib-copy-btn {
    background: var(--link-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 12px;
    transition: background 0.2s;
}

.bib-copy-btn:hover {
    background: var(--link-hover-color);
}

/* Teaching & Services Styling */
.service-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 8px 0;
    line-height: 1.6;
}

.service-content {
    flex: 1;
    text-align: left;
}

.service-date {
    flex-shrink: 0;
    text-align: right;
    color: #666;
    font-style: italic;
    min-width: 100px;
    margin-left: 20px;
}

/* Publication Links */
.publication-links {
    margin-left: 8px;
}

.publication-link {
    display: inline-block;
    background: var(--link-color);
    color: white;
    padding: 3px 10px;
    margin-left: 4px;
    font-size: 12px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

/* Different colors for different link types based on data-type attribute */
.publication-link[data-type="pdf"] {
    background: #e74c3c;  /* Red for PDF */
}

.publication-link[data-type="code"] {
    background: #2ecc71;  /* Green for Code */
}

.publication-link[data-type="bib"] {
    background: #f39c12;  /* Orange for BibTeX */
}

.publication-link[data-type="slides"] {
    background: #9b59b6;  /* Purple for Slides */
}

.publication-link[data-type="video"] {
    background: #e67e22;  /* Orange for Video */
}

.publication-link[data-type="demo"] {
    background: #16a085;  /* Teal for Demo */
}

/* Fallback: maintain URL-based rules for backwards compatibility */
.publication-link[href*="github"]:not([data-type]) {
    background: #2ecc71;  /* Green for GitHub URLs without data-type */
}

.publication-link:hover {
    opacity: 0.8;
    color: white;
    text-decoration: none;
}

/* Random Facts */
#randomFact {
    font-size: 12px;
    text-align: center;
    color: var(--random-fact-color);
    margin: 20px 0;
}

/* Footer */
footer, .footer-content {
    text-align: center;
    font-size: 9px;
    color: var(--footer-color);
    margin-top: 40px;
}

/* Header Styling */
.header-name {
    font-family: var(--header-font);
    font-size: var(--header-font-size);
}

.header-email {
    color: var(--header-text-color);
}

/* Responsive Design */
/* Mobile-first approach with better layout */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .content {
        max-width: 100%;
        padding: 0 10px;
    }
    
    /* Header adjustments */
    .header-name {
        font-size: 24px;
        line-height: 1.2 !important;
    }
    
    .header-email {
        font-size: 12px !important;
    }
    
    /* About section - stack vertically on mobile */
    .about-table {
        width: 100% !important;
        display: block;
        margin-bottom: 30px !important;
    }
    
    .about-table tbody,
    .about-table tr {
        display: block;
        width: 100%;
        height: auto !important;
    }
    
    .about-table td {
        display: block;
        width: 100% !important;
        text-align: center !important;
        padding: 10px 0 !important;
        vertical-align: top !important;
        height: auto !important;
    }
    
    /* Profile photo mobile styling */
    .about-photo img {
        width: 150px;
        margin: 10px 0;
    }
    
    /* Social links - simple vertical column on mobile */
    table:first-of-type {
        width: 100% !important;
        display: block !important;
        margin: 20px 0 !important;
        text-align: center !important;
    }
    
    table:first-of-type thead,
    table:first-of-type tbody,
    table:first-of-type tr {
        display: block !important;
        width: 100% !important;
    }
    
    table:first-of-type th {
        display: block !important;
        width: 80% !important;
        max-width: 200px !important;
        margin: 8px auto !important;
        padding: 12px !important;
        font-size: 14px !important;
        text-align: center !important;
        border: 1px solid #ddd !important;
        border-radius: 6px !important;
        background: #f9f9f9 !important;
    }
    
    table:first-of-type th:hover {
        background: #e9e9e9 !important;
    }
    
    /* Experience tables - better mobile layout */
    .experience-table {
        width: 100% !important;
        display: block;
        margin: 15px 0;
    }
    
    .experience-table tbody,
    .experience-table tr {
        display: block;
        width: 100%;
    }
    
    .experience-table td {
        display: block;
        width: 100% !important;
        text-align: left !important;
        padding: 10px 0 !important;
        vertical-align: top !important;
    }
    
    /* Company logos on mobile */
    .experience-table td:last-child {
        text-align: center !important;
        padding-top: 15px !important;
    }
    
    .experience-table td:last-child img {
        height: 40px !important;
        max-width: 120px !important;
    }
    
    /* Publication filters */
    .publication-filters {
        text-align: center;
        margin: 15px 0;
    }
    
    .year-filter {
        display: inline-block;
        margin: 3px;
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* News styling - mobile */
    .news-item {
        margin: 8px 0;
        line-height: 1.5;
        display: flex;
        flex-direction: column;
    }
    
    .news-date {
        margin-bottom: 4px;
        margin-right: 0;
        align-self: flex-start;
    }
    
    .news-content {
        flex: none;
    }
    
    .news-links {
        margin-left: 0;
        margin-top: 4px;
        display: block;
    }
    
    .news-link {
        margin: 2px 4px 2px 0;
        padding: 3px 8px;
        font-size: 11px;
    }
    
    /* Publication links - mobile */
    .publication-links {
        margin-left: 0;
        margin-top: 4px;
        display: block;
    }
    
    .publication-link {
        margin: 2px 4px 2px 0;
        padding: 3px 8px;
        font-size: 11px;
    }
    
    /* Awards styling - mobile */
    .award-item {
        margin: 8px 0;
        line-height: 1.5;
    }
    
    .award-date {
        display: block;
        margin-bottom: 4px;
        margin-right: 0;
        width: fit-content;
    }
    
    .award-content {
        display: block;
    }
    
    /* Service items - mobile */
    .service-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .service-content {
        margin-bottom: 2px;
    }
    
    .service-date {
        margin-left: 0;
        text-align: left;
        min-width: auto;
        font-size: 12px;
    }
    
    /* Typography adjustments */
    h1 {
        font-size: 1.8rem;
        text-align: center;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    h4 {
        font-size: 1.1rem;
        text-align: center;
        margin: 20px 0 15px 0;
    }
    
    /* Better text readability */
    p {
        font-size: 14px;
        line-height: 1.6;
        margin: 10px 0;
    }
    
    /* Lists and content spacing */
    ul, ol {
        padding-left: 20px;
    }
    
    li {
        margin: 8px 0;
        line-height: 1.5;
    }
}

@media screen and (max-width: 480px) {
    body {
        padding: 8px;
    }
    
    .content {
        padding: 0 5px;
    }
    
    /* Even smaller screens */
    .header-name {
        font-size: 20px;
    }
    
    .header-email {
        font-size: 11px !important;
        line-height: 1.4;
    }
    
    /* Social links - keep vertical on smaller screens */
    table:first-of-type th {
        width: 70% !important;
        margin: 6px auto !important;
        padding: 10px !important;
        font-size: 13px !important;
    }
    
    /* Smaller profile photo */
    .about-photo img {
        width: 120px;
    }
    
    /* Smaller company logos */
    .experience-table td:last-child img {
        height: 35px !important;
        max-width: 100px !important;
    }
    
    /* Compact typography */
    .header-name {
        font-size: 18px;
    }
    
    h4 {
        font-size: 1rem;
        margin: 15px 0 10px 0;
    }
    
    p {
        font-size: 13px;
    }
    
    .year-filter {
        padding: 5px 8px;
        font-size: 11px;
        margin: 2px;
    }
}

/* Very small screens - extra narrow */
@media screen and (max-width: 320px) {
    body {
        padding: 5px;
    }
    
    .content {
        padding: 0 2px;
    }
    
    /* Social links - even more compact on very narrow screens */
    table:first-of-type th {
        width: 90% !important;
        margin: 4px auto !important;
        padding: 8px !important;
        font-size: 12px !important;
    }
    
    /* Very compact header */
    .header-name {
        font-size: 16px;
    }
    
    .header-email {
        font-size: 10px !important;
    }
    
    /* Very small profile photo */
    .about-photo img {
        width: 100px;
    }
}

/* Landscape tablets and small desktops */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    body {
        padding: 20px;
    }
    
    .content {
        max-width: 90%;
    }
    
    .about-photo img {
        width: 180px;
    }
}

/* Print Styles */
@media print {
    body {
        padding: 0;
    }
    
    .publication-filters {
        display: none;
    }
    
    .year-section[style*="display: none"] {
        display: block !important;
    }
}