@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --clr-primary:       #4f46e5;
    --clr-primary-dark:  #3730a3;
    --clr-primary-light: #e0e7ff;
    --clr-navbar:        #1e1b4b;
    --clr-search-bg:     #312e81;
    --clr-body-bg:       #f5f6fb;
    --clr-surface:       #ffffff;
    --clr-muted:         #6b7280;
    --clr-border:        #e5e7eb;
    --clr-mark-bg:       #fef08a;
    --clr-mark-text:     #78350f;
    --clr-footer-bg:     #f1f5f9;

    --radius-sm: 0.4rem;
    --radius-md: 0.6rem;
    --radius-lg: 0.75rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--clr-body-bg);
    color: #111827;
    font-size: 0.9375rem;
}

.navbar-custom {
    background-color: var(--clr-navbar);
    border-bottom: 3px solid var(--clr-primary);
    padding: 0.7rem 0;
}

.navbar-custom .navbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
    text-decoration: none;
    gap: 0.5rem;
    display: flex;
    align-items: center;
}

.navbar-custom .navbar-brand:hover {
    color: var(--clr-primary-light);
}

.navbar-custom .navbar-brand .bi-film {
    font-size: 1.3rem;
    color: #a5b4fc;
}

.navbar-meta {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
}

.search-section {
    background: linear-gradient(150deg, var(--clr-navbar) 0%, var(--clr-search-bg) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.search-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
}

.search-input {
    width: 100%;
    height: 3rem;
    padding: 0 1rem 0 2.5rem;
    font-size: 1rem;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-md);
    outline: none;
    background: #ffffff;
    color: #111827;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.2s;
}

.search-input:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.4), 0 2px 8px rgba(0, 0, 0, 0.12);
}

.btn-search {
    height: 3rem;
    padding: 0 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    background-color: var(--clr-primary);
    border-color: var(--clr-primary);
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
}

.btn-search:hover,
.btn-search:focus {
    background-color: var(--clr-primary-dark);
    border-color: var(--clr-primary-dark);
}

.btn-back {
    height: 3rem;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    border-radius: var(--radius-md);
    border-color: rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-back:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
}

.stats-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.3rem 1rem;
    margin-bottom: 0.85rem;
    font-size: 0.82rem;
    color: var(--clr-muted);
    min-height: 1.8rem;
}

.stats-bar strong {
    color: #111827;
}

.stats-bar .search-term {
    color: var(--clr-primary-dark);
    font-style: italic;
}

.stats-right {
    color: var(--clr-muted);
}

.table-responsive {
    border-radius: var(--radius-lg);
    overflow: hidden;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

.results-table {
    font-size: 0.85rem;
    margin-bottom: 0;
    min-width: 900px;
}

.results-table thead tr {
    background-color: var(--clr-navbar);
}

.results-table thead th {
    background-color: var(--clr-navbar) !important;
    color: #c7d2fe;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    padding: 0.8rem 0.75rem;
    border-bottom: 2px solid var(--clr-primary);
    border-top: none;
}

.results-table tbody tr {
    transition: background-color 0.12s ease;
}

.results-table tbody td {
    padding: 0.55rem 0.75rem;
    border-color: var(--clr-border);
    vertical-align: middle;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1f2937;
}

.results-table tbody tr:hover td {
    background-color: var(--clr-primary-light) !important;
}

.col-num {
    width: 2.8rem !important;
    min-width: 2.8rem !important;
    text-align: center;
    color: var(--clr-muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

mark {
    background-color: var(--clr-mark-bg);
    color: var(--clr-mark-text);
    padding: 0.1em 0.25em;
    border-radius: 3px;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--clr-muted);
}

.empty-state .bi-search {
    font-size: 4.5rem;
    opacity: 0.2;
    display: block;
    margin-bottom: 1.25rem;
}

.empty-state h4 {
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.empty-state p {
    font-size: 0.925rem;
    line-height: 1.6;
    max-width: 28rem;
    margin: 0 auto 1.25rem;
}

.pagination {
    gap: 0.2rem;
}

.page-link {
    border-radius: var(--radius-sm) !important;
    color: var(--clr-primary);
    border-color: var(--clr-border);
    font-size: 0.875rem;
    padding: 0.45rem 0.8rem;
    min-width: 2.2rem;
    text-align: center;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.page-link:hover {
    background-color: var(--clr-primary-light);
    border-color: var(--clr-primary);
    color: var(--clr-primary-dark);
}

.page-item.active .page-link {
    background-color: var(--clr-primary);
    border-color: var(--clr-primary);
    color: #fff;
    font-weight: 600;
}

.page-item.disabled .page-link {
    color: #d1d5db;
    background-color: transparent;
    border-color: var(--clr-border);
}

.page-jump-input {
    width: 5rem;
    text-align: center;
}

.site-footer {
    background-color: var(--clr-footer-bg);
    border-top: 1px solid var(--clr-border);
    padding: 0.85rem 0;
    font-size: 0.8rem;
    color: var(--clr-muted);
    margin-top: auto;
}

.mobile-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.15s;
}

.mobile-card:has(.mobile-card-header[aria-expanded="true"]) {
    border-color: #a5b4fc;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12), 0 1px 4px rgba(0, 0, 0, 0.08);
}

.mobile-card-header {
    display: grid;
    grid-template-columns: 1.8rem 1fr auto auto;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 0.85rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.12s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-card-header:active {
    background-color: var(--clr-primary-light);
}

.mobile-card-header[aria-expanded="true"] {
    background-color: #eef2ff;
    border-bottom: 1px solid #c7d2fe;
}

.mobile-card-num {
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    color: var(--clr-muted);
    text-align: center;
}

.mobile-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
    word-break: break-word;
}

.mobile-card-meta {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.badge-year,
.badge-country {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15em 0.45em;
    border-radius: 999px;
    white-space: nowrap;
}

.badge-year {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-country {
    background-color: #dcfce7;
    color: #166534;
}

.mobile-card-chevron {
    font-size: 0.85rem;
    color: var(--clr-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.mobile-card-header[aria-expanded="true"] .mobile-card-chevron {
    transform: rotate(180deg);
    color: var(--clr-primary);
}

.mobile-card-body {
    padding: 0.65rem 0.85rem 0.85rem;
    background-color: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.mobile-field {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 0.3rem;
    align-items: baseline;
    font-size: 0.83rem;
    line-height: 1.4;
}

.mobile-field-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--clr-muted);
    padding-top: 0.05rem;
}

.mobile-field-value {
    color: #1f2937;
    word-break: break-word;
}

.table-responsive::-webkit-scrollbar       { height: 5px; }
.table-responsive::-webkit-scrollbar-track { background: #f1f5f9; }
.table-responsive::-webkit-scrollbar-thumb { background: #c4b5fd; border-radius: 3px; }
.table-responsive::-webkit-scrollbar-thumb:hover { background: var(--clr-primary); }

@media (max-width: 575.98px) {
    .btn-search {
        padding: 0 0.9rem;
    }

    .stats-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.65rem;
        min-width: 2rem;
    }

    .page-jump-input {
        width: 4rem;
    }
}

@media (min-width: 768px) {
    .results-table tbody td {
        max-width: 280px;
    }
}

@media (min-width: 992px) {
    .results-table {
        font-size: 0.875rem;
    }

    .results-table tbody td {
        max-width: 320px;
    }

    .results-table thead th {
        font-size: 0.75rem;
    }
}
