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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    margin-bottom: 2rem;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    text-decoration: none;
}

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

.nav-link {
    font-size: 0.9rem;
    color: #666;
    text-decoration: none;
}

.nav-link:hover {
    text-decoration: underline;
    color: #1a1a1a;
}

.tagline {
    color: #666;
    font-size: 0.9rem;
}

/* Search */
.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search-form input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border: 2px solid #ccc;
    border-radius: 4px;
}

.search-form input:focus {
    outline: none;
    border-color: #333;
}

.search-form button {
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Results */
.results-list {
    list-style: none;
}

.results-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.results-list a {
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
}

.results-list a:hover {
    text-decoration: underline;
}

.year {
    color: #666;
    margin-left: 0.25rem;
}

.badge {
    font-size: 0.75rem;
    background: #eee;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    margin-left: 0.5rem;
}

.event-count {
    color: #888;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.no-results {
    color: #666;
    padding: 1rem 0;
}

/* Detail */
h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.content-meta {
    color: #666;
    margin-bottom: 1.5rem;
}

.events-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.events-table th {
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #888;
    padding: 0.5rem 0.5rem;
    border-bottom: 2px solid #ddd;
}

.events-table td {
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.episode-header td {
    font-weight: 700;
    background: #f5f5f5;
    padding-top: 0.75rem;
    border-bottom: 1px solid #ddd;
}

.intensity {
    font-size: 0.8rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

.intensity-low {
    background: #d4edda;
    color: #155724;
}

.intensity-medium {
    background: #fff3cd;
    color: #856404;
}

.intensity-high {
    background: #f8d7da;
    color: #721c24;
}

.back-link {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    text-decoration: underline;
}

/* Submit page */
.submit-intro {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.submit-section {
    margin-bottom: 2rem;
}

.submit-section h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.tmdb-search-wrap {
    position: relative;
}

.tmdb-search-wrap input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border: 2px solid #ccc;
    border-radius: 4px;
}

.tmdb-search-wrap input:focus {
    outline: none;
    border-color: #333;
}

.tmdb-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tmdb-item {
    display: flex;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    align-items: flex-start;
}

.tmdb-item:hover {
    background: #f5f5f5;
}

.tmdb-poster {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}

.tmdb-no-poster {
    background: #e0e0e0;
}

.tmdb-info {
    min-width: 0;
}

.tmdb-title {
    font-weight: 600;
}

.tmdb-overview {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.15rem;
    line-height: 1.3;
}

.tmdb-empty {
    color: #888;
    cursor: default;
}

.selected-content {
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f0f7ff;
    border: 1px solid #b3d4fc;
    border-radius: 4px;
    font-weight: 600;
}

.selected-content:not([hidden]) {
    display: flex;
}

.btn-small {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    background: none;
    border: 1px solid #999;
    border-radius: 3px;
    cursor: pointer;
    color: #666;
}

.inline-fields {
    display: flex;
    gap: 1rem;
}

.inline-fields label {
    font-size: 0.9rem;
    color: #444;
}

.inline-fields input {
    width: 5rem;
    margin-left: 0.25rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.trigger-form {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.form-row {
    margin-bottom: 0.75rem;
}

.form-row label {
    display: block;
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 0.25rem;
}

.form-row select,
.form-row input[type="text"] {
    width: 100%;
    padding: 0.4rem 0.5rem;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.time-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem 0.75rem;
    align-items: center;
}

.time-label {
    font-size: 0.9rem;
    color: #444;
}

.time-inputs:not([hidden]) {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.time-label[hidden] {
    display: none;
}

.time-sep {
    color: #999;
    font-weight: 600;
}

.time-inputs input {
    width: 3rem;
    padding: 0.4rem;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 3px;
    text-align: center;
}

.time-inputs input:focus {
    outline: none;
    border-color: #333;
}

.btn-link {
    background: none;
    border: none;
    color: #888;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0;
    text-decoration: underline;
}

.btn-link:hover {
    color: #444;
}

.btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn:disabled {
    background: #999;
    cursor: not-allowed;
}

.btn-primary {
    background: #2563eb;
    font-size: 1rem;
    padding: 0.6rem 1.5rem;
}

.pending-events {
    list-style: none;
    margin-top: 0.5rem;
}

.pending-events li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.btn-remove {
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    background: none;
    border: 1px solid #d66;
    color: #d66;
    border-radius: 3px;
    cursor: pointer;
}

.btn-remove:hover {
    background: #fee;
}

.feedback-success {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #d4edda;
    color: #155724;
    border-radius: 4px;
    font-size: 0.9rem;
}

.feedback-error {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f8d7da;
    color: #721c24;
    border-radius: 4px;
    font-size: 0.9rem;
}

footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    color: #999;
    font-size: 0.8rem;
}
