/* Chooz4Me - Desktop Grid UI */

:root {
    --bg-primary: #0d1522;
    --bg-secondary: #141d2e;
    --bg-card: #1a2538;
    --bg-hover: #243044;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border-radius: 12px;
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 50;
}

.logo { display: flex; align-items: center; cursor: pointer; }
.logo-img { height: 75px; width: auto; }

.nav-tabs {
    margin-left: auto;
}

/* User Menu */
.user-menu {
    position: relative;
    margin-left: 16px;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.user-menu-btn:hover {
    background: var(--bg-hover);
    border-color: rgba(255,255,255,0.2);
}

.user-menu-btn .user-name {
    font-size: 14px;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-btn .dropdown-arrow {
    transition: transform 0.2s;
}

.user-menu.open .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 100;
}

.user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-user-info {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: none;
}

.dropdown-user-info.show {
    display: block;
}

.dropdown-email {
    font-size: 13px;
    color: var(--text-secondary);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

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

.dropdown-item svg {
    color: var(--text-secondary);
}

.dropdown-item.trakt-item.connected {
    color: #ed1c24;
}

.dropdown-item.trakt-item.connected svg {
    color: #ed1c24;
}

/* Search Box */
.search-container {
    position: relative;
    flex: 1;
    max-width: 450px;
    margin: 0 24px;
}

.search-mode-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.search-mode-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: var(--bg-card);
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.search-mode-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

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

.search-mode-btn svg {
    flex-shrink: 0;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: 10px;
    padding: 0 12px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.search-box:focus-within {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.search-box.ai-mode {
    border-color: var(--accent-secondary);
}

.search-icon {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    padding: 12px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.search-submit-btn {
    background: var(--accent-primary);
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-submit-btn:hover {
    background: var(--accent-secondary);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: 10px;
    margin-top: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-results.show {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

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

.search-result-item:first-child {
    border-radius: 10px 10px 0 0;
}

.search-result-item:last-child {
    border-radius: 0 0 10px 10px;
}

.search-result-poster {
    width: 40px;
    height: 60px;
    border-radius: 4px;
    background: var(--bg-secondary);
    overflow: hidden;
    flex-shrink: 0;
}

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

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.search-result-type {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--accent-primary);
    color: white;
    text-transform: uppercase;
    font-weight: 600;
}

.search-result-reason {
    font-size: 11px;
    color: var(--accent-secondary);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chooser-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.chooser-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.chooser-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
}

.chooser-thinking {
    font-size: 14px;
    color: var(--accent-secondary);
}

.search-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation Tabs */
.nav-tabs { display: flex; gap: 8px; margin-left: auto; }
.nav-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.nav-tab:hover { color: var(--text-primary); background: var(--bg-card); }
.nav-tab.active { color: var(--text-primary); background: var(--accent-primary); }

/* Main Content */
.main-content { flex: 1; padding: 24px 0; }

/* Content Sections */
.content-section { margin-bottom: 48px; }
.content-section.hidden { display: none; }

.section-header { margin-bottom: 20px; }
.section-header h2 { font-size: 24px; font-weight: 600; margin-bottom: 4px; }
.section-subtitle { color: var(--text-secondary); font-size: 14px; }

/* Placeholder for Recommendations */
.placeholder-message {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 60px 40px;
    text-align: center;
    border: 1px dashed rgba(255,255,255,0.1);
}
.placeholder-icon { font-size: 48px; display: block; margin-bottom: 16px; }
.placeholder-message h3 { font-size: 20px; margin-bottom: 8px; }
.placeholder-message p { color: var(--text-secondary); }

/* Recommendations Grid - 8 cards layout */
.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.rec-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.3s, box-shadow 0.2s;
}

.rec-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
}

.rec-card.fade-out {
    opacity: 0;
    transform: scale(0.9);
}

.rec-card.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.rec-poster {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--bg-secondary);
}

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

.rec-info {
    padding: 12px;
}

.rec-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rec-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.rec-overview {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rec-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rec-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-hover);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.rec-btn:hover {
    transform: scale(1.1);
}

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

.rec-btn.watchlist-btn:hover {
    background: var(--accent-primary);
}

.rec-stars {
    display: flex;
    gap: 2px;
}

.rec-stars .star {
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.1s, transform 0.1s;
}

.rec-stars .star:hover,
.rec-stars .star.hover {
    color: var(--warning);
    transform: scale(1.2);
}

.rec-stars .star.half-hover {
    background: linear-gradient(90deg, var(--warning) 50%, var(--text-secondary) 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transform: scale(1.2);
}

.rec-stars .star.filled {
    color: var(--warning);
}

/* Content Type Toggle */
.content-type-toggle {
    display: flex;
    gap: 12px;
}

.type-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.type-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.type-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-color: transparent;
}

.type-btn svg {
    opacity: 0.8;
}

.type-btn.active svg {
    opacity: 1;
}

/* Browse Filters */
.browse-filters {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 24px;
}

.filter-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
}

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

.filter-select {
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    outline: none;
    min-width: 150px;
}
.filter-select:hover { border-color: var(--accent-primary); }
.filter-select:disabled { opacity: 0.5; cursor: not-allowed; }

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

@media (min-width: 1400px) { .content-grid { grid-template-columns: repeat(8, 1fr); } }
@media (min-width: 1200px) and (max-width: 1399px) { .content-grid { grid-template-columns: repeat(7, 1fr); } }
@media (min-width: 1000px) and (max-width: 1199px) { .content-grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 800px) and (max-width: 999px) { .content-grid { grid-template-columns: repeat(5, 1fr); } }

/* Content Card */
.content-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.3s ease;
}

.content-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.4); }

.card-poster-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.card-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    border: 2px solid white;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
}

.content-card:hover .card-play-btn {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.card-play-btn:hover {
    background: var(--danger);
    border-color: var(--danger);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Card Details */
.card-details {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
}

.card-rating { display: flex; align-items: center; gap: 2px; color: var(--warning); }

.card-reason {
    font-size: 10px;
    color: var(--accent-primary);
    font-weight: 500;
    margin-top: 2px;
}

.card-info {
    padding: 8px 10px;
}

.card-info .card-title {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.card-info .card-meta {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
}

.card-type {
    background: var(--accent-primary);
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Card Actions */
.card-actions { display: flex; gap: 6px; }

.card-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.card-action-btn.like { background: var(--success); color: white; }
.card-action-btn.watchlist { background: var(--accent-primary); color: white; }
.card-action-btn.skip { background: rgba(255,255,255,0.1); color: var(--text-secondary); }
.card-action-btn.skip:hover { background: var(--danger); color: white; }
.card-action-btn:hover { transform: scale(1.1); }

/* Card Star Ratings */
.card-rating-stars { display: flex; align-items: center; }
.card-rating-stars .stars { display: flex; gap: 1px; }

.star {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.star:hover, .star.hover { color: var(--warning); transform: scale(1.15); }
.star.hover svg, .star:hover svg { fill: var(--warning); }
.star.filled { color: var(--warning); }
.star.filled svg { fill: var(--warning); }
.star.half-hover svg, .star.half-filled svg { fill: var(--warning); clip-path: inset(0 50% 0 0); }

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 32px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) { background: var(--accent-secondary); }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.pagination-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pagination-info span { font-size: 14px; }
.total-count { color: var(--text-secondary); font-size: 12px !important; }

/* Loading & Empty States */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 0;
    color: var(--text-secondary);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--bg-card);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.empty-state { text-align: center; padding: 80px 40px; }
.empty-icon { font-size: 64px; margin-bottom: 16px; display: block; }
.empty-state h2 { margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); margin-bottom: 24px; }

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4); }

.btn-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action svg { flex-shrink: 0; }
.btn-trailer { background: var(--danger); color: white; }
.btn-trailer:hover { background: #dc2626; }
.btn-like { background: var(--success); color: white; }
.btn-like:hover { background: #1da34d; }
.btn-watchlist { background: var(--accent-primary); color: white; }
.btn-watchlist:hover { background: #5558e3; }
.btn-skip { background: var(--bg-card); color: var(--text-secondary); border: 1px solid rgba(255,255,255,0.1); }
.btn-skip:hover { background: var(--danger); color: white; border-color: var(--danger); }

/* Detail Page */
.detail-page {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 100;
    overflow-y: auto;
}

.detail-backdrop {
    height: 280px;
    background-size: cover;
    background-position: center top;
    position: relative;
}

.detail-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, var(--bg-primary) 100%);
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.back-btn:hover { background: rgba(0,0,0,0.8); }

.detail-content {
    max-width: 1400px;
    margin: -180px auto 0;
    padding: 0 32px 40px;
    position: relative;
    z-index: 10;
}

.detail-header {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.detail-poster {
    width: 200px;
    height: 300px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow-lg);
    flex-shrink: 0;
}

.detail-info { flex: 1; padding-top: 0; }

.detail-info h1 {
    font-size: 28px;
    margin-bottom: 8px;
    line-height: 1.2;
}

.detail-meta {
    display: flex;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 10px;
}

.detail-rating { color: var(--warning); }

.detail-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.detail-genres span {
    background: var(--bg-card);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.detail-user-rating {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-user-rating .rating-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-user-rating .stars { display: flex; gap: 4px; }
.detail-user-rating .star { padding: 4px; }

/* Detail Body */
.detail-body { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }

.detail-section { margin-bottom: 16px; }
.detail-section h2 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 6px;
}

.detail-section p {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 13px;
}

/* Watch Options */
.watch-options { display: flex; flex-direction: column; gap: 12px; }

.watch-category h3 {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.provider-list { display: flex; flex-wrap: wrap; gap: 6px; }

.provider-item {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.2s;
}

.provider-item:hover { transform: scale(1.1); }

.watch-attribution {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.watch-attribution a { color: var(--accent-primary); text-decoration: none; }

/* Cast */
.cast-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.cast-item {
    flex-shrink: 0;
    width: 70px;
    text-align: center;
}

.cast-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    margin: 0 auto 4px;
    background-color: var(--bg-card);
}

.cast-name { font-size: 10px; font-weight: 500; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cast-character { font-size: 9px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Crew */
.crew-info { display: flex; flex-wrap: wrap; gap: 16px; }
.crew-role { font-size: 10px; color: var(--text-secondary); margin-bottom: 1px; }
.crew-name { font-size: 12px; font-weight: 500; }

/* Trailer Modal */
.trailer-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trailer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 10;
}

.trailer-container {
    width: 90%;
    max-width: 1000px;
    aspect-ratio: 16/9;
}

.trailer-container iframe {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* AI Search Modal */
.ai-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.ai-search-content {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.ai-search-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.ai-search-close:hover {
    color: var(--text-primary);
}

.ai-search-content h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.ai-search-subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.ai-search-input-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-search-input-container textarea {
    width: 100%;
    min-height: 100px;
    padding: 16px;
    background: var(--bg-primary);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
}

.ai-search-input-container textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.ai-search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-search-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.ai-search-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ai-search-results {
    margin-top: 24px;
}

.ai-search-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.ai-search-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-hover);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.ai-results-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.ai-result-card {
    background: var(--bg-primary);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.ai-result-card:hover {
    transform: translateY(-4px);
}

.ai-result-poster {
    aspect-ratio: 2/3;
    background: var(--bg-secondary);
}

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

.ai-result-info {
    padding: 10px;
}

.ai-result-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-result-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.ai-result-reason {
    font-size: 10px;
    color: var(--accent-primary);
    margin-top: 4px;
}

/* Utilities */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 900px) {
    .detail-header { flex-direction: column; align-items: center; text-align: center; }
    .detail-poster { width: 200px; height: 300px; }
    .detail-body { grid-template-columns: 1fr; }
    .detail-actions { justify-content: center; }
    .detail-genres { justify-content: center; }
}

@media (max-width: 768px) {
    .app-container { padding: 0 12px; }
    
    .header { 
        flex-wrap: wrap; 
        gap: 8px; 
        padding: 12px 0;
    }
    
    .logo-img { height: 50px; }
    
    .content-type-toggle { 
        order: 2;
        margin-left: auto;
    }
    
    .type-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .type-btn svg { width: 16px; height: 16px; }
    
    .search-container {
        order: 4;
        width: 100%;
        max-width: 100%;
        margin: 8px 0 0 0;
    }
    
    .search-mode-toggle { margin-bottom: 4px; }
    .search-mode-btn { padding: 4px 8px; font-size: 11px; }
    .search-mode-btn svg { width: 14px; height: 14px; }
    
    .search-box { padding: 0 10px; }
    .search-box input { padding: 10px 8px; font-size: 14px; }
    
    .search-result-reason { font-size: 10px; }
    
    .nav-tabs { 
        order: 3; 
        width: auto; 
        justify-content: center; 
        margin-left: 0;
        gap: 4px;
    }
    
    .nav-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .user-menu {
        order: 2;
        margin-left: 0;
    }
    
    .user-menu-btn {
        padding: 6px 8px;
    }
    
    .user-menu-btn .user-name {
        display: none;
    }
    
    .user-menu-btn .dropdown-arrow {
        display: none;
    }
    
    .filter-row { 
        flex-direction: column; 
        gap: 8px;
    }
    
    .filter-group { width: 100%; }
    .filter-select { width: 100%; font-size: 14px; }
    
    .content-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px; 
    }
    
    .content-card { border-radius: 8px; }
    .card-poster { border-radius: 8px 8px 0 0; }
    .card-info { padding: 8px; }
    .card-title { font-size: 12px; }
    .card-meta { font-size: 10px; }
    
    .pagination { 
        flex-direction: column; 
        gap: 12px;
        padding: 16px 0;
    }
    
    /* For You section mobile */
    .for-you-container { padding: 16px 0; }
    .for-you-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px;
    }
    
    /* Detail page mobile */
    .detail-page { padding: 12px; }
    .detail-header { gap: 16px; padding: 16px 0; }
    .detail-poster { width: 150px; height: 225px; }
    .detail-title { font-size: 20px; }
    .detail-tagline { font-size: 14px; }
    .detail-meta { font-size: 12px; gap: 8px; }
    .detail-rating { font-size: 14px; }
    .detail-genres { gap: 6px; }
    .detail-genres span { font-size: 11px; padding: 3px 8px; }
    
    .detail-actions { gap: 6px; }
    .action-btn { 
        padding: 8px 12px; 
        font-size: 12px;
    }
    .action-btn svg { width: 16px; height: 16px; }
    
    .detail-body { padding: 16px 0; gap: 20px; }
    .detail-section h2 { font-size: 16px; }
    .detail-overview { font-size: 14px; line-height: 1.6; }
    
    .cast-list { gap: 10px; }
    .cast-card { width: 70px; }
    .cast-photo { width: 70px; height: 70px; }
    .cast-name { font-size: 10px; }
    .cast-character { font-size: 9px; }
    
    /* AI Search modal mobile */
    .ai-search-modal { padding: 12px; }
    .ai-search-content { 
        padding: 20px; 
        max-height: 95vh;
    }
    .ai-search-content h2 { font-size: 20px; }
    .ai-search-subtitle { font-size: 14px; }
    .ai-search-input-container textarea { 
        min-height: 80px; 
        font-size: 14px;
        padding: 12px;
    }
    .ai-search-submit { 
        padding: 12px 20px; 
        font-size: 14px;
    }
    .ai-results-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px;
    }
    .ai-result-info { padding: 8px; }
    .ai-result-title { font-size: 11px; }
    .ai-result-meta { font-size: 10px; }
    .ai-result-reason { font-size: 9px; }
    
    /* Search results dropdown mobile */
    .search-results { max-height: 300px; }
    .search-result-item { padding: 8px 10px; gap: 10px; }
    .search-result-poster { width: 35px; height: 52px; }
    .search-result-title { font-size: 13px; }
    .search-result-meta { font-size: 11px; }
    .search-result-type { font-size: 9px; padding: 2px 5px; }
}

/* Extra small screens */
@media (max-width: 480px) {
    .app-container { padding: 0 8px; }
    
    .logo-img { height: 40px; }
    
    .type-btn span { display: none; }
    .type-btn { padding: 8px; }
    
    .nav-tab { padding: 6px 10px; font-size: 12px; }
    
    .content-grid { gap: 8px; }
    .card-info { padding: 6px; }
    .card-title { font-size: 11px; }
    
    .for-you-grid { gap: 8px; }
    
    .detail-poster { width: 120px; height: 180px; }
    .detail-title { font-size: 18px; }
    
    .ai-results-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
}
