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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    color: #333;
    background: #fafafa;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

h2 {
    font-size: 1.3rem;
    margin: 24px 0 12px;
}

h3 {
    font-size: 1.1rem;
    margin: 16px 0 8px;
}

a {
    color: #77bdee;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* header */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ddd;
}

.site-header h1 {
    margin: 0;
    font-family: 'Quicksand', sans-serif;
}

.header-text {
    flex: 1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.header-about {
    font-size: 0.75rem;
    color: #999;
    text-decoration: none;
}

.header-about:hover {
    text-decoration: underline;
}

.header-avatar-link {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

/* breadcrumb */
.breadcrumb {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 16px;
}

.breadcrumb a {
    color: #666;
}

.breadcrumb .separator {
    margin: 0 6px;
}

/* search */
.search-container {
    margin-bottom: 24px;
}

.search-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
}

.search-tab {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 0.9rem;
}

.search-tab:first-child {
    border-radius: 6px 0 0 6px;
}

.search-tab:last-child {
    border-radius: 0 6px 6px 0;
}

.search-tab.active {
    background: #77bdee;
    color: #fff;
    border-color: #77bdee;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
}

.search-input:focus {
    border-color: #77bdee;
    box-shadow: 0 0 0 2px rgba(119, 189, 238, 0.25);
}

.search-results {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

.search-results li {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.search-result-thumb {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 4px;
}

.search-result-thumb.placeholder {
    background: #e0e0e0;
}

.search-result-text {
    margin-top: 6px;
}

.search-result-title {
    font-weight: 600;
    font-size: 0.85rem;
}

.search-result-meta {
    font-size: 0.75rem;
    color: #666;
    margin-top: 2px;
}

/* tables */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin: 12px 0 24px;
}

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

.age-table th {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 2px solid #ddd;
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.age-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

.age-table tbody tr:hover {
    background: #eef6fc;
}

/* detail page header */
.detail-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.detail-header-text {
    flex: 1;
}

.detail-header .subtitle {
    color: #666;
    font-size: 0.95rem;
    margin-top: 4px;
}

.detail-poster {
    width: 100px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.detail-still {
    width: 180px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.detail-profile {
    width: 100px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* age highlight */
.age-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* actor cell with thumbnail */
.actor-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.actor-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* season list */
.season-list {
    list-style: none;
    margin: 8px 0;
}

.season-list li {
    margin-bottom: 4px;
}

.season-toggle {
    cursor: pointer;
    padding: 6px 0;
    font-weight: 500;
}

.season-toggle:hover {
    color: #77bdee;
}

.episode-list {
    list-style: none;
    margin: 4px 0 12px 16px;
}

.episode-list li {
    padding: 4px 0;
}

/* loading and error */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.error {
    text-align: center;
    padding: 40px;
    color: #dc2626;
}

/* summary stat */
.age-summary {
    background: #eef6fc;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

/* section tabs for show view */
.view-tabs {
    display: flex;
    gap: 0;
    margin: 16px 0;
}

.view-tab {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 0.9rem;
}

.view-tab:first-child {
    border-radius: 6px 0 0 6px;
}

.view-tab:last-child {
    border-radius: 0 6px 6px 0;
}

.view-tab.active {
    background: #77bdee;
    color: #fff;
    border-color: #77bdee;
}

/* footer */
.site-footer {
    margin-top: 48px;
    padding-top: 16px;
    border-top: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: #999;
}

.tmdb-logo {
    height: 16px;
    opacity: 0.6;
}

.site-footer:hover .tmdb-logo {
    opacity: 1;
}
