/* Dark mode variables */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --accent: #2563eb;
    --border: #e5e7eb;
    --card-shadow: rgba(0, 0, 0, 0.03);
    --card-hover-shadow: rgba(0, 0, 0, 0.03);
    --row-hover: #f3f4f6;
}

html.dark {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #60a5fa;
    --border: #404040;
    --card-shadow: rgba(0, 0, 0, 0.15);
    --card-hover-shadow: rgba(0, 0, 0, 0.15);
    --row-hover: #333333;
}

html {
    scroll-behavior: smooth;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover {
    color: var(--accent);
    background-color: var(--bg-secondary);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }
html.dark .theme-toggle .sun-icon { display: block; }
html.dark .theme-toggle .moon-icon { display: none; }

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Geist","Geist Fallback",Arial,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Navigation */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.nav a:hover {
    color: var(--accent);
}

.nav svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Header */
.header {
    margin-bottom: 3rem;
    padding: 1rem 0;
}

.header h1 {
    font-family: 'Libre Baskerville', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.header p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 800px;
}

/* Projects List Style */
.projects-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 3rem;
    overflow: hidden;
}

.projects-table th {
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.projects-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.projects-table tr:last-child td {
    border-bottom: none;
}

.projects-table tr {
    transition: background-color 0.2s ease;
}

.projects-table tr:hover {
    background-color: var(--row-hover);
}

.project-title-cell {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.project-logo {
    border-radius: 4px;
}

.project-description-cell {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 500px;
}

.project-links-cell {
    white-space: nowrap;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-right: 0.5rem;
    background: var(--bg-secondary);
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: background 0.2s ease, color 0.2s ease;
}

.project-link:hover {
    background: var(--accent);
    color: white;
}

.project-link svg {
    width: 16px;
    height: 16px;
}

/* Talks Grid */
.talks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.talk-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.talk-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid var(--border);
}

.talk-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.talk-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.talk-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.talk-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.talk-date, .talk-event {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.talk-meta svg {
    width: 16px;
    height: 16px;
}

.talk-links {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.talk-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--bg-primary);
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: background 0.2s ease, color 0.2s ease;
}

.talk-link:hover {
    background: var(--accent);
    color: white;
}

.talk-link svg {
    width: 18px;
    height: 18px;
}

/* Filter Section */
.filter-section {
    margin-bottom: 2.5rem;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-option {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: 100px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

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

.filter-option:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Footer */
.footer {
    margin-top: 4rem;
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
}

.footer a {
    color: var(--accent);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.heart {
    color: #e11d48;
    display: inline-block;
    margin: 0 0.25rem;
}

/* Markdown Alerts */
.markdown-alert {
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 6px;
}

.markdown-alert-note {
    border-left: 3px solid #0969da;
    background-color: rgba(9, 105, 218, 0.05);
}

.markdown-alert-warning {
    border-left: 3px solid #9a6700;
    background-color: rgba(0, 0, 0, 0.05);
}

.markdown-alert-important {
    border-left: 3px solid #8250df;
    background-color: rgba(0, 0, 0, 0.05);
}

.markdown-alert-tip {
    border-left: 3px solid #1a7f37;
    background-color: rgba(0, 0, 0, 0.05);
}

.markdown-alert-caution {
    border-left: 3px solid #cf222e;
    background-color: rgba(0, 0, 0, 0.05);
}

.markdown-alert > p:first-child {
    margin: 0;
    font-weight: 500;
}

.markdown-alert-note > p:first-child {
    color: #0969da;
}

.markdown-alert-warning > p:first-child {
    color: #9a6700;
}

.markdown-alert-important > p:first-child {
    color: #8250df;
}

.markdown-alert-tip > p:first-child {
    color: #1a7f37;
}

.markdown-alert-caution > p:first-child {
    color: #cf222e;
}

.markdown-alert > p:first-child > span:first-child {
    margin-right: 8px;
}

.markdown-alert > p:last-child {
    margin: 8px 0 0 0;
}

/* Replying-to indicator */
.replying-to {
    display: none;
}

.replying-to.visible {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* External link icon */
.external-link-icon {
    display: inline-block;
    margin-left: 0.25rem;
    vertical-align: middle;
}

/* DigitalOcean brand color */
.digitalocean-prefix {
    color: #0080FF;
}

/* Project logo container and image */
.project-logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.project-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 1.25rem;
    }

    .nav {
        flex-direction: row;
        align-items: center;
        margin-bottom: 1.5rem;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: flex-end;
    }

    .nav a {
        font-size: 0.875rem;
        gap: 0;
    }

    .nav a span {
        display: none;
    }

    .nav svg {
        display: block;
        width: 24px;
        height: 24px;
    }

    .header {
        margin-bottom: 2rem;
    }

    .header h1 {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .header p {
        font-size: 1rem;
    }

    /* Responsive Table */
    .projects-table {
        display: block;
    }
    
    .projects-table thead {
        display: none;
    }
    
    .projects-table tbody, 
    .projects-table tr {
        display: block;
    }
    
    .projects-table tr {
        margin-bottom: 1.5rem;
        border: 1px solid var(--border);
        border-radius: 8px;
        overflow: hidden;
        background-color: var(--bg-secondary);
    }
    
    .projects-table td:before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.75rem;
        color: var(--text-secondary);
        margin-bottom: 0.75rem;
        padding-top: 0.5rem;
    }
    
    .projects-table td {
        display: block;
        text-align: left;
        padding: 0 1rem 0.75rem 1rem;
        border-bottom: 1px solid var(--border);
    }
    
    .projects-table td:last-child {
        border-bottom: none;
    }
    
    .project-links-cell {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .project-link {
        margin-right: 0;
        margin-top: 0.5rem;
    }

    .talks-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}
