/* ============================================================================
   CSS Variables & Theme System
   ============================================================================ */

:root {
    /* Dark theme (default) */
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #16213e;
    --bg-primary: rgba(255, 255, 255, 0.08);
    --bg-secondary: rgba(255, 255, 255, 0.05);
    --bg-tertiary: rgba(0, 0, 0, 0.3);
    --bg-input: rgba(255, 255, 255, 0.1);
    --bg-input-focus: rgba(255, 255, 255, 0.15);
    --bg-dropdown: #2a2a3e;
    --bg-option: #1a1a2e;
    
    --text-primary: #eee;
    --text-secondary: #ccc;
    --text-muted: #aaa;
    --text-dim: #888;
    
    --accent: #4ecdc4;
    --accent-hover: #45b8b0;
    --accent-dark: #44a3a0;
    --accent-bg: rgba(78, 205, 196, 0.2);
    --accent-border: rgba(78, 205, 196, 0.4);
    
    --gold: #ffd700;
    --gold-bg: rgba(255, 215, 0, 0.2);
    
    --danger: #e74c3c;
    --danger-hover: #c0392b;
    --danger-bg: rgba(255, 107, 107, 0.2);
    
    --warning: #f39c12;
    --warning-bg: rgba(255, 193, 7, 0.2);
    
    --border: #444;
    --border-light: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-heavy: rgba(0, 0, 0, 0.5);
    
    --header-bg: rgba(255, 255, 255, 0.05);
    --card-bg: rgba(255, 255, 255, 0.05);
    --toast-bg: rgba(0, 0, 0, 0.9);
}

/* Light theme */
[data-theme="light"] {
    --bg-gradient-start: #f5f7fa;
    --bg-gradient-end: #e4e9f0;
    --bg-primary: rgba(0, 0, 0, 0.04);
    --bg-secondary: rgba(0, 0, 0, 0.02);
    --bg-tertiary: rgba(0, 0, 0, 0.06);
    --bg-input: rgba(0, 0, 0, 0.05);
    --bg-input-focus: rgba(0, 0, 0, 0.08);
    --bg-dropdown: #fff;
    --bg-option: #f5f7fa;
    
    --text-primary: #1a1a2e;
    --text-secondary: #333;
    --text-muted: #555;
    --text-dim: #777;
    
    --accent: #2a9d8f;
    --accent-hover: #248a7e;
    --accent-dark: #1f7a6f;
    --accent-bg: rgba(42, 157, 143, 0.15);
    --accent-border: rgba(42, 157, 143, 0.4);
    
    --gold: #e9a800;
    --gold-bg: rgba(233, 168, 0, 0.15);
    
    --danger: #d63031;
    --danger-hover: #b71c1c;
    --danger-bg: rgba(214, 48, 49, 0.1);
    
    --warning: #e17055;
    --warning-bg: rgba(225, 112, 85, 0.15);
    
    --border: #d0d5dd;
    --border-light: rgba(0, 0, 0, 0.1);
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-heavy: rgba(0, 0, 0, 0.15);
    
    --header-bg: rgba(255, 255, 255, 0.7);
    --card-bg: rgba(255, 255, 255, 0.8);
    --toast-bg: rgba(26, 26, 46, 0.95);
}

/* ============================================================================
   Global Styles
   ============================================================================ */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.2s ease;
}

/* ============================================================================
   Layout
   ============================================================================ */

#app-container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background: var(--header-bg);
    border-radius: 10px;
    position: relative;
}

header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5rem;
    color: var(--accent);
}

.subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.section {
    background: var(--bg-primary);
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px var(--shadow);
}

.section h2 {
    margin-top: 0;
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
}

/* ============================================================================
   Form Elements
   ============================================================================ */

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-secondary);
    font-weight: 500;
}

.search-container {
    position: relative;
}

input[type="text"],
select {
    width: 100%;
    padding: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 1rem;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

select {
    cursor: pointer;
}

select option {
    background: var(--bg-option);
    color: var(--text-primary);
}

/* ============================================================================
   Search Dropdown
   ============================================================================ */

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-dropdown);
    border: 2px solid var(--accent);
    border-radius: 5px;
    margin-top: 5px;
    z-index: 1000;
    box-shadow: 0 8px 16px var(--shadow-heavy);
}

.dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover,
.dropdown-item.selected {
    background: var(--accent-bg);
}

.dropdown-item-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-item-title {
    font-weight: 500;
    color: var(--text-primary);
}

.dropdown-item-title mark {
    background: var(--gold);
    color: var(--bg-gradient-start);
    padding: 2px 4px;
    border-radius: 3px;
}

.dropdown-item-year {
    color: var(--text-dim);
    margin-left: 10px;
    font-size: 0.9rem;
}

.rating-badge {
    background: var(--gold);
    color: var(--bg-gradient-start);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
    margin-left: 10px;
}

.dropdown-no-results {
    text-align: center;
    color: var(--text-dim);
    font-style: italic;
    cursor: default;
}

.dropdown-no-results:hover {
    background: transparent;
}

/* ============================================================================
   Movie Info & Rating
   ============================================================================ */

.movie-info {
    background: rgba(78, 205, 196, 0.1);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #4ecdc4;
    margin-top: 15px;
}

.movie-header {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
}

.movie-thumbnail {
    flex-shrink: 0;
}

.movie-thumbnail-placeholder {
    width: 100px;
    height: 150px;
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.3), rgba(68, 163, 160, 0.3));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(78, 205, 196, 0.5);
}

.movie-icon {
    font-size: 3rem;
    filter: grayscale(0.3);
}

.movie-title-section {
    flex: 1;
}

.movie-info h3 {
    margin: 0 0 10px 0;
    color: #4ecdc4;
    font-size: 1.5rem;
}

.movie-year-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 15px;
    border-radius: 20px;
    color: #aaa;
    font-size: 0.95rem;
    margin: 0;
}

/* Movie Attributes Table */
.movie-attributes-section {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.movie-attributes-section h4 {
    margin: 0 0 15px 0;
    color: #4ecdc4;
    font-size: 1.1rem;
}

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

.attributes-table th,
.attributes-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.attributes-table th {
    color: #4ecdc4;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.attributes-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.attribute-type-badge {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(78, 205, 196, 0.2);
    border-radius: 12px;
    font-size: 0.75rem;
    color: #4ecdc4;
    text-transform: uppercase;
}

.attribute-mini-bar {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    min-width: 120px;
}

.attribute-mini-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4, #44a3a0);
    transition: width 0.3s ease;
}

.attribute-mini-bar-label {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: bold;
    color: #eee;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.rating-buttons {
    margin-top: 20px;
}

.rating-buttons label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #4ecdc4;
}

.stars {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.star-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #555;
    border-radius: 5px;
    color: #eee;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.star-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    transform: scale(1.05);
}

.star-btn.active {
    background: rgba(255, 215, 0, 0.3);
    border-color: #ffd700;
    color: #ffd700;
    font-weight: bold;
}

/* ============================================================================
   Profile Display
   ============================================================================ */

.chart-container {
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#taste-radar-chart {
    width: 100%;
    max-width: 500px;
    height: 400px;
    border-radius: 8px;
}

/* Chart Legend */
.chart-legend {
    margin-bottom: 30px;
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.legend-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.legend-item.selected {
    background: rgba(78, 205, 196, 0.2);
    border-color: #4ecdc4;
}

.legend-color-box {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.legend-label {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.legend-name {
    font-weight: 500;
    color: #eee;
}

.legend-value {
    font-weight: bold;
    color: #4ecdc4;
    font-size: 0.9rem;
}

/* Attribute Contributors */
.attribute-contributors {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(78, 205, 196, 0.1);
    border-radius: 8px;
    border-left: 4px solid #4ecdc4;
}

.attribute-contributors h4 {
    margin: 0 0 10px 0;
    color: #4ecdc4;
}

.contributors-description {
    margin: 0 0 15px 0;
    color: #aaa;
    font-size: 0.9rem;
}

.contributors-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contributor-item {
    display: flex;
    gap: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    align-items: center;
}

.contributor-rank {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4ecdc4;
    min-width: 30px;
    text-align: center;
}

.contributor-info {
    flex: 1;
}

.contributor-title {
    font-weight: bold;
    color: #eee;
    margin-bottom: 5px;
}

.contributor-details {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #aaa;
}

.contributor-details span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.profile-attributes {
    margin-bottom: 20px;
}

.attribute-row {
    display: grid;
    grid-template-columns: 200px 1fr 60px;
    gap: 15px;
    align-items: center;
    margin-bottom: 12px;
}

.attribute-label {
    display: flex;
    flex-direction: column;
}

/* ============================================================================
   Import Section & Progress Indicators
   ============================================================================ */

.import-section {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(78, 205, 196, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(78, 205, 196, 0.3);
}

.import-section h3 {
    margin-top: 0;
    color: #4ecdc4;
}

.help-text {
    color: #aaa;
    font-size: 0.95rem;
    margin: 10px 0 20px 0;
    line-height: 1.5;
}

.help-text a {
    color: #4ecdc4;
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

.import-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.progress-container {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4 0%, #44a8a0 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    margin: 0;
    color: #aaa;
    font-size: 0.9rem;
    text-align: center;
}

.message-area {
    margin-top: 15px;
    min-height: 40px;
}

.message {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.message.success {
    background: rgba(78, 205, 196, 0.2);
    border: 1px solid rgba(78, 205, 196, 0.4);
    color: #4ecdc4;
}

.message.error {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.4);
    color: #ff6b6b;
}

.message.info {
    background: rgba(108, 117, 125, 0.2);
    border: 1px solid rgba(108, 117, 125, 0.4);
    color: #aaa;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 10000;
    max-width: 350px;
    font-size: 0.95rem;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #4ecdc4;
}

.toast-error {
    border-left: 4px solid #ff6b6b;
}

.toast-info {
    border-left: 4px solid #6c757d;
}

/* Profile Cards */
.profile-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 8px;
}

.profile-card h3 {
    margin-top: 0;
    color: #4ecdc4;
}

.profile-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.profile-stats span {
    color: #aaa;
    font-size: 0.9rem;
}

.profile-section {
    margin-bottom: 20px;
}

.profile-section h4 {
    margin: 0 0 10px 0;
    color: #ddd;
    font-size: 1rem;
}

.genre-tags,
.era-tags,
.theme-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    padding: 6px 12px;
    background: rgba(78, 205, 196, 0.2);
    border: 1px solid rgba(78, 205, 196, 0.4);
    border-radius: 20px;
    font-size: 0.85rem;
    color: #4ecdc4;
}

/* Recommendations */
.recommendations-header {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 10px;
    background: rgba(78, 205, 196, 0.2);
    border-radius: 12px;
    font-size: 0.85rem;
    color: #4ecdc4;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.recommendation-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(78, 205, 196, 0.2);
}

.rec-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.rec-header h4 {
    margin: 0;
    color: #eee;
    font-size: 1rem;
    flex: 1;
}

.match-score {
    font-size: 0.85rem;
    color: #4ecdc4;
    font-weight: bold;
    white-space: nowrap;
    margin-left: 10px;
}

.rec-reasoning {
    color: #aaa;
    font-size: 0.9rem;
    margin: 10px 0;
    line-height: 1.4;
}

.rec-genres {
    color: #888;
    font-size: 0.85rem;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.empty-state-card {
    padding: 30px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.empty-state-card h3 {
    color: #4ecdc4;
    margin-bottom: 15px;
}

.empty-state-card ol {
    text-align: left;
    max-width: 400px;
    margin: 20px auto;
    color: #aaa;
}

.empty-state-card li {
    margin: 8px 0;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .section {
        padding: 15px;
    }

    .import-controls {
        flex-direction: column;
    }

    .import-controls button {
        width: 100%;
    }

    .recommendations-grid {
        grid-template-columns: 1fr;
    }

    .toast {
        right: 10px;
        left: 10px;
        bottom: 10px;
        max-width: none;
    }

    .profile-stats {
        flex-direction: column;
        gap: 10px;
    }
}

.attribute-name {
    font-weight: bold;
    color: #eee;
}

.attribute-type {
    font-size: 0.85rem;
    color: #888;
}

.attribute-bar-container {
    background: rgba(255, 255, 255, 0.1);
    height: 24px;
    border-radius: 12px;
    overflow: hidden;
}

.attribute-bar {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4, #44a3a0);
    transition: width 0.5s ease;
}

.attribute-value {
    text-align: right;
    font-weight: bold;
    color: #4ecdc4;
}

.dominant-attributes {
    margin-top: 20px;
    padding: 15px;
    background: rgba(78, 205, 196, 0.1);
    border-radius: 8px;
    border-left: 4px solid #4ecdc4;
}

.dominant-attributes h3 {
    margin-top: 0;
    color: #4ecdc4;
}

.dominant-attributes ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.dominant-attributes li {
    margin-bottom: 5px;
    color: #eee;
}

.profile-stats {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #444;
    display: flex;
    gap: 30px;
}

.profile-stats p {
    margin: 0;
    color: #ccc;
}

/* ============================================================================
   Recommendations
   ============================================================================ */

.recommendations-list {
    display: grid;
    gap: 15px;
}

.recommendation-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #444;
    transition: all 0.3s;
}

.recommendation-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #4ecdc4;
    transform: translateX(5px);
}

.recommendation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.recommendation-header h3 {
    margin: 0;
    color: #eee;
    font-size: 1.2rem;
}

.similarity-badge {
    background: var(--accent);
    color: var(--bg-gradient-start);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

.movie-year {
    margin: 0 0 15px 0;
    color: var(--text-dim);
}

/* ============================================================================
   Buttons
   ============================================================================ */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-hover);
    transform: scale(1.02);
}

.btn-secondary {
    background: var(--border);
    color: var(--text-primary);
    margin-left: 10px;
}

.btn-secondary:hover {
    background: var(--text-dim);
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-gradient-start);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.actions-grid .btn {
    margin: 0;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.rate-btn {
    background: #4ecdc4;
    color: #1a1a2e;
}

.rate-btn:hover {
    background: #44a3a0;
}

/* ============================================================================
   States & Messages
   ============================================================================ */

.empty-state {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px;
}

.loading-message {
    text-align: center;
    color: #4ecdc4;
    padding: 20px;
    font-style: italic;
}

.error-message {
    background: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 5px;
    margin: 20px;
    text-align: center;
}

.feedback-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4ecdc4;
    color: #1a1a2e;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    font-weight: bold;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.feedback-message.feedback-warning {
    background: #f39c12;
    color: white;
}

.feedback-message.feedback-error {
    background: #e74c3c;
    color: white;
}

.feedback-message.fade-out {
    animation: fadeOut 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ============================================================================
   Debug Section
   ============================================================================ */

.debug-section {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #555;
}

.debug-section h3 {
    margin-top: 0;
    color: #ffd700;
}

#debug-output {
    background: #000;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    font-size: 0.85rem;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    #taste-radar-chart {
        height: 300px;
    }
    
    .legend-items {
        grid-template-columns: 1fr;
    }
    
    .attribute-row {
        grid-template-columns: 150px 1fr 50px;
        gap: 10px;
    }
    
    .stars {
        flex-direction: column;
    }
    
    .star-btn {
        width: 100%;
    }
    
    .profile-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .contributor-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .contributor-rank {
        font-size: 1.2rem;
    }
}

/* ============================================================================
   Data Indicators (Header)
   ============================================================================ */

.data-indicators {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.indicator {
    padding: 6px 14px;
    background: rgba(78, 205, 196, 0.2);
    border: 1px solid rgba(78, 205, 196, 0.4);
    border-radius: 20px;
    font-size: 0.9rem;
    color: #4ecdc4;
    font-weight: 500;
}

.indicator.unsaved {
    background: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.4);
    color: #ffc107;
}

.indicator.unsaved::before {
    content: "● ";
}

/* ============================================================================
   Exploration UI
   ============================================================================ */

.exploration-subsection {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.exploration-subsection h3 {
    margin-top: 0;
    color: #4ecdc4;
    font-size: 1.3rem;
}

/* Filter Controls */
.filter-controls {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.filter-header h3 {
    margin: 0;
    color: #4ecdc4;
}

.filter-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    cursor: pointer;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group h4 {
    margin: 0 0 10px 0;
    color: #aaa;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-checkbox:hover {
    background: rgba(78, 205, 196, 0.1);
    border-color: rgba(78, 205, 196, 0.3);
}

.filter-checkbox input[type="checkbox"] {
    cursor: pointer;
    margin: 0;
}

.filter-checkbox input[type="checkbox"]:checked ~ .filter-label {
    color: #4ecdc4;
    font-weight: 600;
}

.filter-label {
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-stats {
    margin-top: 15px;
    padding: 12px;
    background: rgba(78, 205, 196, 0.1);
    border-radius: 5px;
    text-align: center;
}

.filter-stat-text {
    margin: 0;
    color: #4ecdc4;
    font-size: 0.95rem;
}

.filter-stat-text strong {
    font-size: 1.2em;
    color: #4ecdc4;
}

/* Taste Clusters */
.cluster-display {
    margin-top: 15px;
}

.clusters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.cluster-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(78, 205, 196, 0.3);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
}

.cluster-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.2);
    border-color: rgba(78, 205, 196, 0.5);
}

.cluster-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cluster-header h4 {
    margin: 0;
    color: #4ecdc4;
    font-size: 1.1rem;
}

.cluster-badge {
    background: #4ecdc4;
    color: #1a1a2e;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.9rem;
}

.cluster-stats {
    margin-bottom: 10px;
    color: #aaa;
    font-size: 0.9rem;
}

.cluster-stats p {
    margin: 4px 0;
}

.cluster-rating {
    color: #ffc107;
    font-weight: 500;
}

.cluster-movies {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cluster-movie {
    font-size: 0.85rem;
    color: #ccc;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cluster-more {
    font-size: 0.85rem;
    color: #4ecdc4;
    font-style: italic;
    padding: 4px 8px;
}

/* Taste Journey Timeline */
.timeline-container {
    margin-top: 15px;
}

.timeline-header {
    margin-bottom: 20px;
}

.timeline-header h3 {
    margin: 0 0 5px 0;
    color: #4ecdc4;
}

.timeline-subtitle {
    margin: 0;
    color: #aaa;
    font-size: 0.9rem;
}

.timeline-content {
    position: relative;
    padding-left: 30px;
}

.timeline-period {
    position: relative;
    margin-bottom: 30px;
}

.timeline-marker {
    position: absolute;
    left: -26px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: #4ecdc4;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(78, 205, 196, 0.2);
}

.timeline-period::before {
    content: '';
    position: absolute;
    left: -21px;
    top: 17px;
    width: 2px;
    height: calc(100% + 10px);
    background: rgba(78, 205, 196, 0.3);
}

.timeline-period:last-child::before {
    display: none;
}

.timeline-period-content {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #4ecdc4;
}

.timeline-period-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.timeline-date {
    font-weight: 600;
    color: #4ecdc4;
    font-size: 1.05rem;
}

.timeline-count {
    color: #aaa;
    font-size: 0.9rem;
}

.timeline-avg {
    color: #ffc107;
    font-size: 0.9rem;
}

.timeline-movies {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-movie {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    transition: background 0.2s;
}

.timeline-movie:hover {
    background: rgba(255, 255, 255, 0.1);
}

.timeline-movie-title {
    color: #eee;
    font-size: 0.9rem;
}

.timeline-movie-rating {
    font-size: 0.8rem;
}

/* Trend Analysis */
.trend-analysis {
    margin-top: 30px;
    padding: 20px;
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid rgba(78, 205, 196, 0.3);
    border-radius: 8px;
}

.trend-analysis h4 {
    margin: 0 0 15px 0;
    color: #4ecdc4;
}

.trend-changes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trend-change {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

.trend-arrow {
    font-size: 1.5rem;
}

.trend-text {
    color: #eee;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-checkboxes {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .clusters-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .timeline-period-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Filter notice in recommendations */
.filter-notice {
    padding: 10px 15px;
    background: rgba(78, 205, 196, 0.15);
    border: 1px solid rgba(78, 205, 196, 0.4);
    border-radius: 5px;
    margin-bottom: 15px;
    color: #4ecdc4;
    font-size: 0.9rem;
    text-align: center;
}

/* ============================================================================
   Theme Toggle
   ============================================================================ */

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle-btn {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.2s;
}

.theme-toggle-btn:hover {
    background: var(--accent-bg);
    border-color: var(--accent);
}

.theme-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-bg);
}

.theme-icon {
    font-size: 1.1rem;
}

.theme-label {
    font-weight: 500;
}

/* Hide label on small screens */
@media (max-width: 500px) {
    .theme-label {
        display: none;
    }
    
    .theme-toggle {
        top: 10px;
        right: 10px;
    }
    
    .theme-toggle-btn {
        padding: 8px 10px;
    }
}

/* ============================================================================
   API Recommendations with Posters
   ============================================================================ */

.api-recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mood-notice,
.cache-notice {
    padding: 8px 12px;
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--accent);
    text-align: center;
}

.cache-notice {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-muted);
}

.api-recommendation-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.api-recommendation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--shadow);
    border-color: var(--accent-border);
}

.rec-poster {
    flex-shrink: 0;
    width: 92px;
    height: 138px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.rec-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-poster {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-muted);
}

.rec-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rec-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.rec-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.match-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    background: var(--accent-bg);
    color: var(--accent);
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.rec-meta {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.rec-director {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.rec-reasoning {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.4;
}

.rec-rating {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: var(--gold);
}

/* Mood Selector */
.mood-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mood-selector label {
    font-weight: 500;
    color: var(--text-secondary);
}

.mood-select {
    padding: 8px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    min-width: 180px;
}

.mood-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

/* Recommendation Filters Panel */
.recommendation-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 140px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-bg);
}

.btn-primary {
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    padding: 10px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* Active Filters Display */
.active-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 8px 12px;
    background: var(--accent-bg);
    border-radius: 8px;
    flex-wrap: wrap;
}

.active-filters-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-tag {
    padding: 4px 10px;
    background: var(--accent);
    color: white;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Filters notice in results */
.filters-notice {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 600px) {
    .api-recommendation-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .rec-header {
        flex-direction: column;
        align-items: center;
    }
    
    .mood-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mood-select {
        width: 100%;
    }
    
    .recommendation-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
}

/* ============================================================================
   Enhanced Explanation Styles
   ============================================================================ */

.card-explanation {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

.explanation-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.because-of {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.film-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: var(--accent-bg);
    border-radius: 4px;
    margin: 0 2px;
    font-weight: 500;
}

.connection-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 12px;
    background: var(--bg-tertiary);
    margin-top: 0.5rem;
}

.connection-badge.director { background: #e8d5b7; color: #5c4a2a; }
.connection-badge.theme { background: #d5e8d5; color: #2a5c2a; }
.connection-badge.mood { background: #d5d5e8; color: #2a2a5c; }
.connection-badge.genre { background: #e8e8d5; color: #5c5c2a; }
.connection-badge.actor { background: #e8d5e8; color: #5c2a5c; }
.connection-badge.era { background: #d5e8e8; color: #2a5c5c; }

/* P4: Badges row */
.badges-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.badges-row .connection-badge {
    margin-top: 0;
}

/* P4: Serendipity badge for discovery picks */
.serendipity-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #000;
    font-weight: 600;
    cursor: help;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.8); }
}

/* P4: Diversity summary */
.diversity-summary {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.diversity-tag {
    padding: 0.25rem 0.5rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    color: var(--text-secondary);
}

/* ============================================================================
   Watchlist Styles
   ============================================================================ */

.rec-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.save-btn {
    padding: 0.4rem 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-btn:hover {
    background: var(--accent-bg);
    border-color: var(--accent);
}

.save-btn.saved {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.save-btn.saved:hover {
    background: #c0392b;
    border-color: #c0392b;
}

/* Watchlist count badge in header */
.watchlist-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--accent-bg);
    border-radius: 16px;
    font-size: 0.85rem;
}

#watchlist-count {
    font-weight: bold;
    color: var(--accent);
}

/* ============================================================================
   Taste Insights Dashboard
   ============================================================================ */

.taste-insights {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.taste-insights h3 {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.insight-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.insight-card {
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border);
    text-align: center;
}

.insight-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.insight-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
}

.insight-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.insight-value .director-item {
    display: block;
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.insight-value .director-item .count {
    font-weight: normal;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.insight-value .diversity-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.insight-value .diversity-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.insight-value .percentage {
    font-size: 1.5rem;
    color: var(--accent);
}

/* Film tag hover and click styles */
.film-tag {
    cursor: pointer;
    transition: all 0.2s ease;
}

.film-tag:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.05);
}

/* Highlight pulse animation for scrolled-to elements */
@keyframes highlight-pulse {
    0% { box-shadow: 0 0 0 0 rgba(78, 205, 196, 0.7); }
    50% { box-shadow: 0 0 0 10px rgba(78, 205, 196, 0); }
    100% { box-shadow: 0 0 0 0 rgba(78, 205, 196, 0); }
}

.highlight-pulse {
    animation: highlight-pulse 1s ease-out 2;
    border-color: var(--accent) !important;
}

/* ============================================================================
   Watch Providers
   ============================================================================ */

.watch-providers {
    display: flex;
    align-items: center;
    gap: 4px;
}

.loading-providers {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.provider-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
}

.providers-link {
    display: flex;
    gap: 4px;
    text-decoration: none;
}

.providers-link:hover .provider-logo {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.no-providers {
    font-size: 1rem;
    opacity: 0.5;
    cursor: pointer;
}

/* ============================================================================
   Chat Input (Natural Language Query)
   ============================================================================ */

.chat-input-container {
    max-width: 700px;
    margin: 0 auto 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.chat-icon {
    font-size: 1.2rem;
}

.chat-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

.chat-input::placeholder {
    color: var(--text-dim);
}

.chat-submit {
    padding: 0.75rem 1.25rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: background 0.2s, transform 0.1s;
}

.chat-submit:hover {
    background: var(--accent-hover, var(--accent));
    transform: scale(1.02);
}

.chat-submit:active {
    transform: scale(0.98);
}

.chat-interpretation {
    margin-top: 0.75rem;
    padding: 0.75rem;
    font-style: italic;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.9rem;
}

.chat-interpretation.hidden {
    display: none;
}

.chat-loading {
    opacity: 0.6;
    pointer-events: none;
}

.chat-loading .chat-submit {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================================================
   Filmmaker Buttons
   ============================================================================ */

.filmmaker-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.filmmaker-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.filmmaker-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ============================================================================
   Toast Notification
   ============================================================================ */

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============================================================================
   Discover New Movies
   ============================================================================ */

.discover-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover, var(--accent)) 100%);
    border-radius: 12px;
    color: white;
}

.discover-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
}

.discover-summary {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

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

.discover-card {
    position: relative;
    border: 2px solid var(--accent);
}

.discover-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.similar-tag {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.btn-accent {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
}

.btn-accent:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-1px);
}

/* ============================================================================
   Score Breakdown (P3)
   ============================================================================ */

.score-breakdown {
    margin: 0.75rem 0;
    font-size: 0.85rem;
}

.score-breakdown summary {
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem 0;
    user-select: none;
}

.score-breakdown summary:hover {
    color: var(--accent);
}

.score-breakdown[open] summary {
    margin-bottom: 0.5rem;
}

.breakdown-content {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.score-component {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.component-icon {
    flex-shrink: 0;
    width: 1.2rem;
    text-align: center;
}

.component-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.component-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.component-value {
    flex-shrink: 0;
    width: 2rem;
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.75rem;
}
