/* Streamora - Media Decision Platform */
:root {
    --bg: #0f0f0f;
    --surface: #1a1a2e;
    --surface-light: #25253e;
    --primary: #6c63ff;
    --primary-hover: #5a52d5;
    --accent: #ff6584;
    --text: #e0e0e0;
    --text-muted: #8888a0;
    --border: #2a2a4a;
    --success: #4caf50;
    --danger: #f44336;
    --warning: #ff9800;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Navigation */
.navbar {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav-brand a {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo {
    height: 28px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}

.nav-links a:hover {
    background: var(--surface-light);
    color: var(--text);
}

.nav-links a.active {
    background: var(--primary);
    color: white;
}

/* Nav dropdown for Personal Queue */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-dropdown-trigger {
    cursor: pointer;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}

.nav-dropdown-trigger:hover {
    background: var(--surface-light);
    color: var(--text);
}

.nav-dropdown-trigger.active {
    background: var(--primary);
    color: white;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 140px;
    z-index: 100;
    box-shadow: var(--shadow);
    padding: 0.25rem 0;
    margin-top: 0.25rem;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.4rem 0.75rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 0;
}

.nav-dropdown-menu a:hover {
    background: var(--surface-light);
}

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

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-group-trigger {
    font-weight: 500;
    color: var(--text) !important;
}

.nav-dropdown-divider {
    border-top: 1px solid var(--border);
    margin-top: 0.25rem;
    padding-top: 0.4rem;
}

.nav-user select {
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 600;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-weight: 500;
}

.btn:active { transform: scale(0.97); }

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

.btn-secondary {
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

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

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

/* Thumb buttons (interested / not interested) */
.btn-thumb {
    background: var(--surface-light);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s, opacity 0.2s, transform 0.1s;
    opacity: 0.5;
    line-height: 1;
}

.btn-thumb:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.btn-thumb.thumb-active {
    opacity: 1;
    border-color: var(--success);
    background: rgba(76, 175, 80, 0.15);
}

.btn-thumb.thumb-down-active {
    border-color: var(--danger);
    background: rgba(244, 67, 54, 0.15);
}

/* Watched toggle button */
.btn-watched {
    background: var(--surface-light);
    border: 2px solid var(--border);
    color: var(--text-muted);
}

.btn-watched:hover {
    border-color: var(--success);
}

.btn-watched.btn-watched-active {
    background: rgba(76, 175, 80, 0.15);
    border-color: var(--success);
    color: var(--success);
}

/* Filters */
.tonight-filters, .library-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.reverse-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}

.tonight-filters select,
.tonight-filters input,
.library-filters select,
.library-filters input {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
}

/* Media Grid */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.media-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    transition: border-color 0.2s;
    cursor: pointer;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.media-card:hover {
    border-color: var(--primary);
}

.media-card .card-poster {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.media-card .card-body {
    flex: 1;
    min-width: 0;
}

.media-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.media-card .card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.media-card .card-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.tag {
    background: var(--surface-light);
    color: var(--text-muted);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.tag-primary {
    background: rgba(108, 99, 255, 0.2);
    color: var(--primary);
}

.media-card .card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.card-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.card-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
}

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

.card-cast {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    font-style: italic;
}

/* List poster */
.list-poster {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Media List */
.media-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
}

.list-item .item-info {
    flex: 1;
}

.list-item .item-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.list-item .item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Random Picker / Now Showing */
.random-result {
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.random-result h2 {
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.pick-card {
    font-size: 1.2rem;
    font-weight: 600;
}

.pick-card .pick-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.now-showing-card {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    justify-content: center;
    text-align: left;
}

.now-showing-poster {
    max-width: 300px;
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.now-showing-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.now-showing-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.now-showing-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.now-showing-links .btn {
    text-decoration: none;
}

.now-showing-description {
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-top: 0.5rem;
}

.now-showing-notes {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 0.25rem;
}

/* Votes Grid */
.votes-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.vote-chip {
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.vote-chip .vote-user {
    color: var(--accent);
    font-weight: 600;
}

/* Section */
.section {
    margin-top: 2rem;
}

.section h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text);
}

/* Modal */
.modal {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.modal::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

.modal h2 {
    margin-bottom: 1.25rem;
}

.modal label {
    display: block;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.modal input,
.modal select,
.modal textarea {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.modal textarea { resize: vertical; }

.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: var(--text);
    margin: 0;
    cursor: pointer;
}

.checkbox-grid input[type="checkbox"] {
    width: auto;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Lookup (OMDb search in modal) */
.lookup-section {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.lookup-bar {
    display: flex;
    gap: 0.5rem;
}

.lookup-bar input {
    flex: 1;
    margin: 0;
}

.lookup-results {
    max-height: 240px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

.lookup-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
}

.lookup-item:hover {
    background: var(--surface);
}

.lookup-thumb {
    width: 36px;
    height: 52px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.lookup-no-poster {
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.lookup-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lookup-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lookup-item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.lookup-loading, .lookup-empty {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
    margin: 0;
}

/* Groups Management */
.groups-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.group-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.group-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.group-card-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.group-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.group-members h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.group-member {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}

.group-member:last-child {
    border-bottom: none;
}

.group-member select {
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

/* Chat (Assistant) */
.chat-container {
    max-width: 700px;
}

.chat-messages {
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-msg {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    max-width: 85%;
    white-space: pre-wrap;
}

.chat-msg.user {
    background: var(--primary);
    color: white;
    align-self: flex-end;
}

.chat-msg.assistant {
    background: var(--surface);
    border: 1px solid var(--border);
    align-self: flex-start;
}

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

.chat-form input {
    flex: 1;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
}

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

/* Login page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.login-brand {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.login-logo {
    height: 64px;
    width: auto;
    margin-bottom: 1rem;
}

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

.cognito-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.btn-large {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    border-radius: var(--radius);
    display: block;
}

.login-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}


/* Navbar username */
.nav-username {
    color: var(--text);
    font-weight: 500;
    margin-right: 0.5rem;
    text-decoration: none;
}

.nav-username:hover {
    color: var(--primary);
}

/* Profile page */
.profile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 500px;
}

.profile-card label {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.profile-card input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
}

.profile-card input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.field-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.profile-actions {
    margin-top: 1.5rem;
}

.profile-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.profile-section h3 {
    margin-bottom: 0.5rem;
}

/* Docs */
.docs-content {
    max-width: 720px;
}

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

.docs-section h2 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.docs-section p,
.docs-section li {
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

.docs-section ul,
.docs-section ol {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 1rem;
        gap: 0.75rem;
    }
    .nav-user { margin-left: 0; }
    .nav-right { margin-left: 0; }
    .container { padding: 1rem; }
    .media-grid {
        grid-template-columns: 1fr;
    }
}
