:root {
    /* Base colors */
    --bg: #ffffff;
    --bg-secondary: #fafafa;
    --fg: #2e2e2e;
    --fg-secondary: #626262;
    --border: rgba(0, 0, 0, 0.12);
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #0f753a;
    --background-color: #f8f9fa;
    --text-color: #2c3e50;
    --border-color: #e9ecef;
}

@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css');

/* Base styles */
html, body {
    margin: 0;
    padding: 0;
    background: var(--background-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    min-height: 100vh;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}



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

/* Header */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 0;
}

.title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Navigation */
.nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

.nav .disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Hero Section */
.hero {
    position: relative;
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: url('Assets/bg.jpg') center/cover;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.6) 100%
    );
    z-index: 1;
}

.hero__content {
    position: relative;
    z-index: 2;
    color: white;
    max-width: 800px;
    padding: 0 2rem;
}

.hero__title {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero__subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.hero__separator {
    margin: 0 0.5rem;
    opacity: 0.7;
}

/* Sections */
.section {
    margin-bottom: 4rem;
}

.section__title {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 600;
    text-align: left;
}

.section__content {
    max-width: 800px;
    color: var(--text-color);
}

.section__content p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
    font-size: 1.1rem;
}

/* Tables */
.table-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    overflow-x: auto;
    display: block;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

th:hover {
    background-color: var(--secondary-color);
}

th::after {
    content: '↕';
    margin-left: 0.5rem;
    opacity: 0.5;
}

th.sort-asc::after {
    content: '↑';
    opacity: 1;
}

th.sort-desc::after {
    content: '↓';
    opacity: 1;
}

tr:hover {
    background-color: var(--background-color);
}

#booksTable {
    width: 100%;
    min-width: 1100px;
    table-layout: auto;
}

#booksTable td:first-child, #booksTable th:first-child {
    width: 18%;
    min-width: 120px;
    max-width: 200px;
    white-space: normal;
    word-break: break-word;
}

@media (max-width: 900px) {
    .table-container {
        padding: 0;
        overflow-x: auto;
        display: block;
    }
    table {
        width: max-content;
        min-width: 600px;
        font-size: 0.95em;
    }
    th, td {
        padding: 0.5rem;
        white-space: normal;
        word-break: break-word;
    }
}

@media (max-width: 600px) {
    .table-container {
        overflow-x: visible;
    }
    table, thead, tbody, th, td, tr {
        display: block;
        width: 100%;
    }
    thead {
        display: none;
    }
    tr {
        margin-bottom: 1.5em;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.03);
        background: var(--bg-secondary);
        padding: 0.5em 0.7em;
    }
    td {
        position: relative;
        padding-left: 7em;
        min-height: 2.5em;
        border: none;
        border-bottom: 1px solid var(--border-color);
        text-align: left;
        font-size: 1em;
        box-sizing: border-box;
        width: 100%;
    }
    td:last-child {
        border-bottom: none;
    }
    td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.7em;
        top: 0;
        width: 6em;
        min-width: 5em;
        max-width: 45vw;
        font-weight: 600;
        color: var(--secondary-color);
        white-space: normal;
        text-align: left;
        font-size: 0.98em;
        padding-right: 0.5em;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 480px) {
    table {
        width: max-content;
        min-width: 400px;
        font-size: 0.9em;
    }
    th, td {
        padding: 0.4rem;
    }
}

/* Search */
.search-container {
    margin: 2rem 0;
}

.search-input {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Tags */
.tag {
    display: inline-block;
    background: #23272f;
    color: #fff;
    border-radius: 0.8em;
    padding: 0.15em 0.7em;
    font-size: 0.8em;
    font-weight: 500;
    margin-right: 0.15em;
    margin-bottom: 0.1em;
    max-width: 7em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* Talks */
.talk-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.talk-speaker {
    font-style: italic;
    color: var(--secondary-color);
}

.talk-video {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--accent-color);
    text-decoration: none;
}

.talk-video:hover {
    text-decoration: underline;
}

.affiliation {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Buttons */
.button {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    background-color: var(--accent-color);
    color: white;
    border: none;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.button--disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.7;
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Contact */
.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.contact-list a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-list a:hover {
    color: var(--primary-color);
}

.contact-list i {
    color: var(--secondary-color);
    font-size: 1.25rem;
}

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

/* Form styles */
.form-section {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 2.2em 2em;
    max-width: 600px;
    margin: 2em auto;
    border: 1px solid var(--border);
}

.form-section h2 {
    margin-bottom: 1.2em;
}

.form-group {
    margin-bottom: 1.3em;
}

.form-group label {
    display: block;
    margin-bottom: 0.5em;
    color: var(--fg-secondary);
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--bg);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.7em 1em;
    font-size: 1em;
    margin-bottom: 0.2em;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.chip-input {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
    margin-top: 0.3em;
}

.chip-preview {
    margin-top: 0.5em;
}

.form-actions {
    display: flex;
    gap: 1em;
    margin-top: 1.5em;
}

.form-actions button {
    min-width: 120px;
}

.info {
    color: var(--fg-secondary);
    font-size: 0.98em;
    margin-bottom: 1.2em;
}

/* Photo Credit */
.photo-credit {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: var(--fg-secondary);
}

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

.photo-credit a:hover {
    text-decoration: underline;
}

/* Status Chips */
.chip.status-chip {
    padding: 0.2em 0.7em;
    border-radius: 1em;
    font-size: 0.85em;
    font-weight: 600;
    display: inline-block;
    margin-right: 0.2em;
    margin-bottom: 0.15em;
    color: #fff;
    letter-spacing: 0.01em;
    min-width: 3.5em;
    text-align: center;
}

.status-done {
    background: #14532d;
}

.status-active {
    background: #1e3a8a;
}

.status-inactive {
    background: #7c4700;
}

.status-unread {
    background: #374151;
}

.status-other {
    background: #4b006e;
}

/* Skip Link */
.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    background: #fff;
    color: #2c3e50;
    padding: 0.5em 1em;
    z-index: 1000;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: left 0.3s;
}

.skip-link:focus {
    left: 0;
    width: auto;
    height: auto;
    outline: 2px solid #0f753a;
}

/* Visually Hidden */
.visually-hidden {
    position: absolute !important;
    height: 1px; width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

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

    .hero {
        height: 50vh;
    }

    .hero__title {
        font-size: 2rem;
    }

    .hero__subtitle {
        font-size: 1rem;
    }

    .section {
        padding: 2rem 0;
    }

    .section__title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .button-group {
        flex-direction: column;
    }

    .button {
        width: 100%;
        text-align: center;
    }

    .nav ul {
        gap: 1rem;
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.8rem;
    }
}

@media (max-width: 600px) {
    .table-container {
        overflow-x: visible;
    }
    table, thead, tbody, th, td, tr {
        display: block;
        width: 100%;
    }
    thead {
        display: none;
    }
    tr {
        margin-bottom: 1.5em;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.03);
        background: var(--bg-secondary);
        padding: 0.5em 0.7em;
    }
    td {
        position: relative;
        padding-left: 7em;
        min-height: 2.5em;
        border: none;
        border-bottom: 1px solid var(--border-color);
        text-align: left;
        font-size: 1em;
        box-sizing: border-box;
        width: 100%;
    }
    td:last-child {
        border-bottom: none;
    }
    td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.7em;
        top: 0;
        width: 6em;
        min-width: 5em;
        max-width: 45vw;
        font-weight: 600;
        color: var(--secondary-color);
        white-space: normal;
        text-align: left;
        font-size: 0.98em;
        padding-right: 0.5em;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 480px) {
    .hero__title {
        font-size: 1.75rem;
    }

    .hero__subtitle {
        font-size: 0.9rem;
    }

    .contact-list li {
        gap: 0.5rem;
    }
}
