:root {
    --bg-base: #0a0a0c;
    --bg-surface: #141418;
    --bg-hover: #1e1e24;
    --border: #2a2a32;
    --border-hover: #3a3a44;
    --border-active: #5a5a66;
    --text-primary: #f0f0f2;
    --text-body: #c8c8d0;
    --text-muted: #8888a0;
    --text-subtle: #5a5a6e;
    --text-faint: #3a3a4a;
    --text-link: #7a8aaa;
    --text-link-hover: #a0b0d0;
    --accent: #6366f1;
    --accent-soft: rgba(99, 102, 241, 0.15);
    --accent-glow: rgba(99, 102, 241, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-base);
    color: var(--text-body);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
    width: 100%;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 4rem 0 1rem;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.subtitle {
    color: var(--text-body);
    font-size: 1rem;
    line-height: 1.7;
    max-width: 480px;
    margin: 0 auto;
}

.header-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

.header-link:hover h1 {
    color: var(--accent);
    transition: color 0.2s;
}

.header-nav {
    margin-top: 1.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.header-nav a {
    font-size: 0.85rem;
    color: var(--text-link);
    text-decoration: none;
    transition: color 0.15s;
}

.header-nav a:hover {
    color: var(--text-link-hover);
}

.nav-sep {
    color: var(--text-faint);
    font-size: 0.75rem;
}

/* About page */
.about-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 0.5rem 0;
}

.about-callout {
    text-align: center;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    font-size: 0.93rem;
    line-height: 1.7;
    color: var(--text-body);
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: 12px;
}

.about-callout a {
    color: var(--text-link-hover);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid var(--accent);
    transition: color 0.15s;
}

.about-callout a:hover {
    color: var(--text-primary);
}

.about-section {
    margin-bottom: 2rem;
    padding: 1.75rem;
    background: var(--bg-surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
}

.about-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: 0.01em;
}

.about-section p {
    line-height: 1.8;
    margin-bottom: 0.85rem;
    color: var(--text-body);
    font-size: 0.93rem;
}

.about-section p:last-child {
    margin-bottom: 0;
}

.about-section ul,
.about-section ol {
    line-height: 1.8;
    margin-bottom: 0.85rem;
    padding-left: 1.5rem;
    color: var(--text-body);
    font-size: 0.93rem;
}

.about-section ul:last-child,
.about-section ol:last-child {
    margin-bottom: 0;
}

.about-section li {
    margin-bottom: 0.6rem;
}

.about-section li:last-child {
    margin-bottom: 0;
}

.about-section strong {
    color: var(--text-primary);
    font-weight: 600;
}

.about-section em {
    color: var(--text-muted);
    font-style: italic;
}

.about-section a {
    color: var(--text-link-hover);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: color 0.15s, border-color 0.15s;
}

.about-section a:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

#embedding-count {
    font-size: 0.88rem;
    color: var(--text-subtle);
    padding-left: 1.5rem;
}

.about-section h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.about-section pre {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    margin-bottom: 0.85rem;
}

.about-section code {
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 0.85rem;
    color: var(--text-link-hover);
}

.about-section p code {
    background: var(--bg-base);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.back-link {
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.back-link a {
    color: var(--text-link);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s;
}

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

/* Search tabs */
.search-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.search-tab {
    padding: 0.45rem 1.25rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.search-tab:hover {
    color: var(--text-link-hover);
    border-color: var(--border-hover);
    background: var(--bg-surface);
}

.search-tab.active {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* Search */
.search-section {
    margin-bottom: 3rem;
}

.search-wrapper {
    position: relative;
    max-width: 580px;
    margin: 0 auto;
}

#actor-search {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#actor-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

#actor-search::placeholder {
    color: var(--text-subtle);
}

/* Suggestions dropdown */
.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 320px;
    overflow-y: auto;
    display: none;
    z-index: 10;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.suggestions.active {
    display: block;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    cursor: pointer;
    transition: background 0.15s;
}

.suggestion-item:hover {
    background: var(--bg-hover);
}

.suggestion-item.no-results {
    color: var(--text-subtle);
    cursor: default;
}

.suggestion-item.no-results:hover {
    background: transparent;
}

.suggestion-thumb {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

/* Results */
.results-section {
    margin-top: 1rem;
}

.query-actor {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.query-actor-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.query-actor-tmdb {
    font-size: 0.8rem;
    color: var(--text-subtle);
    text-decoration: none;
    transition: color 0.15s;
}

.query-actor-tmdb:hover {
    color: var(--text-link-hover);
}

.results-section h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 1rem;
}

.actor-card {
    background: var(--bg-surface);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
}

.actor-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--border);
}

.actor-image {
    position: relative;
}

.actor-image img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
}

.actor-image .no-image {
    width: 100%;
    aspect-ratio: 2/3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    color: var(--text-subtle);
    font-size: 0.85rem;
}

.tmdb-link {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    text-decoration: none;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.2s, color 0.15s;
}

.actor-card:hover .tmdb-link {
    opacity: 1;
}

.tmdb-link:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.9);
}

.actor-info {
    padding: 0.75rem 0.85rem;
}

.actor-info h3 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.similarity-score {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.character-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.actor-card:not([hx-get]) {
    cursor: default;
    opacity: 0.4;
}

.actor-card:not([hx-get]):hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.show-more {
    text-align: center;
    margin-top: 1.75rem;
}

.show-more button {
    padding: 0.6rem 2rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.show-more button:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--accent-soft);
}

p.no-results {
    color: var(--text-subtle);
    text-align: center;
    padding: 3rem;
}

/* Footer / TMDB attribution */
footer {
    margin-top: auto;
    padding: 2rem 1.5rem 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

footer .tmdb-logo {
    height: 14px;
    opacity: 0.5;
    margin-bottom: 0.5rem;
}

footer p {
    font-size: 0.72rem;
    color: var(--text-faint);
}
