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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #e4e4e4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

header h1 {
    font-size: 1.8rem;
    color: #fff;
}

#user-info {
    font-size: 0.9rem;
    color: #888;
}

/* Navigation */
#nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: #2a2a4a;
    color: #aaa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #3a3a5a;
    color: #fff;
}

.tab-btn.active {
    background: #e94560;
    color: #fff;
}

/* Cards */
.card {
    background: #1f1f3a;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    background: #2a2a4a;
    color: #e4e4e4;
}

.btn:hover {
    transform: translateY(-2px);
    background: #3a3a5a;
}

.btn-primary {
    background: #e94560;
    color: #fff;
}

.btn-primary:hover {
    background: #ff6b6b;
}

.btn-secondary {
    background: #2a2a4a;
    border: 1px solid #e94560;
    color: #e94560;
}

.btn-secondary:hover {
    background: #3a3a5a;
}

/* Recommendation Filters */
.recs-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #1a1a2e;
    color: #e4e4e4;
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 140px;
}

.filter-select:hover {
    border-color: #e94560;
}

.filter-select:focus {
    outline: none;
    border-color: #e94560;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.1rem;
    min-width: 200px;
}

/* Home Actions */
.home-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    margin-top: 20px;
}

@media (min-width: 600px) {
    .home-actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* Movie Card */
.movie-card {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.movie-card img {
    width: 200px;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    background: #333;
}

.movie-info {
    flex: 1;
}

.movie-info h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #fff;
}

.movie-meta {
    color: #888;
    margin-bottom: 8px;
}

.movie-overview {
    line-height: 1.6;
    color: #bbb;
    margin-top: 15px;
}

.selection-reason {
    margin-top: 15px;
    padding: 10px;
    background: #2a2a4a;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #888;
}

/* Rating Section */
.rating-section {
    margin-top: 20px;
}

.rating-section h3 {
    margin-bottom: 15px;
    color: #fff;
}

.seen-buttons, .rating-scale {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.seen-btn, .rating-btn {
    flex: 1;
    min-width: 100px;
    padding: 15px;
    font-size: 1rem;
}

.seen-btn.selected, .rating-btn.selected {
    background: #e94560;
    color: #fff;
}

#why-section {
    margin-top: 20px;
}

#why-section label {
    display: block;
    margin-bottom: 8px;
    color: #888;
}

#why-text, #modal-why {
    width: 100%;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #2a2a4a;
    color: #e4e4e4;
    font-size: 1rem;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 15px;
}

/* Rating Navigation */
.rating-nav {
    margin-top: 20px;
    display: flex;
    justify-content: flex-start;
}

.rating-nav button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: #2a2a4a;
    border-radius: 4px;
    margin-top: 15px;
    overflow: hidden;
}

#progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e94560, #ff6b6b);
    width: 0%;
    transition: width 0.3s;
}

#progress-text {
    text-align: center;
    margin-top: 10px;
    color: #888;
}

/* Rating Header */
.rating-header {
    background: #1a1a2e;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    position: sticky;
    top: 60px;
    z-index: 10;
}

.rating-header h2 {
    margin: 0 0 10px 0;
}

#rating-instructions {
    color: #888;
    margin-bottom: 15px;
}

/* Movie Batch Grid */
.movie-batch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    padding-bottom: 20px;
}

.movie-rating-card {
    background: #1f1f3a;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.movie-rating-card.rated {
    opacity: 0.7;
    border: 2px solid #4CAF50;
}

.movie-rating-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.movie-rating-info {
    padding: 8px;
}

.movie-rating-title {
    font-size: 0.9rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-rating-year {
    font-size: 0.8rem;
    color: #888;
    margin: 4px 0 0 0;
}

.movie-rating-buttons {
    display: flex;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    background: #16162a;
}

.rating-btn-inline {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: transform 0.1s, background 0.2s;
}

.rating-btn-inline:hover {
    transform: scale(1.2);
    background: rgba(255,255,255,0.1);
}

.rating-btn-inline.selected {
    background: #e94560;
    transform: scale(1.1);
}

.movie-rating-status {
    text-align: center;
    font-size: 0.75rem;
    color: #4CAF50;
    padding: 4px;
    min-height: 20px;
}

.loading-more {
    text-align: center;
    padding: 20px;
    color: #888;
}

/* Floating Done Button */
.floating-done {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    animation: slideIn 0.3s ease-out;
}

.floating-done button {
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
    padding: 15px 30px;
    font-size: 1.1rem;
}

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

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

.movie-tile {
    background: #1f1f3a;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

.movie-tile:hover {
    transform: translateY(-5px);
}

.movie-tile img {
    width: 100%;
    height: 270px;
    object-fit: cover;
    background: #333;
}

.movie-tile-info {
    padding: 12px;
}

.movie-tile-info h4 {
    font-size: 0.95rem;
    margin-bottom: 5px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-tile-info p {
    font-size: 0.85rem;
    color: #888;
}

.movie-tile-reason {
    font-size: 0.8rem;
    color: #e94560;
    margin-top: 8px;
    line-height: 1.4;
}

.movie-tile-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    font-size: 0.85rem;
}

.feedback-buttons {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.feedback-btn {
    padding: 5px 10px;
    font-size: 0.8rem;
    background: #2a2a4a;
}

.feedback-btn:hover {
    background: #3a3a5a;
}

/* Search */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #1f1f3a;
    color: #e4e4e4;
    font-size: 1rem;
}

#search-input:focus {
    outline: none;
    border-color: #e94560;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    color: #fff;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #1f1f3a;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

.close-modal:hover {
    color: #fff;
}

.modal-movie-info {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.modal-movie-info img {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
}

.modal-movie-info h3 {
    color: #fff;
    margin-bottom: 5px;
}

.modal-movie-info p {
    color: #888;
}

.modal-rating-section h4 {
    margin: 15px 0 10px;
    color: #fff;
}

.modal-rating-section .rating-scale {
    justify-content: center;
}

.modal-rating-btn, .modal-seen-btn {
    padding: 10px 15px;
}

.modal-rating-btn.selected, .modal-seen-btn.selected {
    background: #e94560;
    color: #fff;
}

.load-more-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.detail-trailer {
    margin: 15px 0;
    width: 100%;
}

.detail-trailer iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
}

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

.detail-rating-label {
    color: #aaa;
    font-size: 14px;
}

.detail-rating-buttons {
    display: flex;
    gap: 8px;
}

.detail-rating-btn {
    font-size: 24px;
    padding: 8px;
    background: #2a2a2a;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.detail-rating-btn:hover {
    background: #3a3a3a;
    transform: scale(1.1);
}

.detail-rating-btn.selected {
    border-color: #e94560;
    background: #3a3a3a;
}

.rated-confirmation {
    color: #4ade80;
    font-size: 18px;
    font-weight: 500;
}

.movie-card.rated,
.movie-tile.rated {
    opacity: 0.7;
}

.rated-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(74, 222, 128, 0.9);
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

/* Auth Styles */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.auth-tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: #2a2a4a;
    color: #e4e4e4;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.auth-tab-btn:hover {
    background: #3a3a5a;
}

.auth-tab-btn.active {
    background: #e94560;
    color: #fff;
}

.auth-form h2 {
    margin-bottom: 20px;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #aaa;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #1a1a2e;
    color: #e4e4e4;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #e94560;
}

.btn-full {
    width: 100%;
    margin-top: 10px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.auth-link {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
}

.auth-link a {
    color: #e94560;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

.error-message {
    background: #ff4444;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
}

.success-message {
    background: #44aa44;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* TMDB Attribution Footer */
.tmdb-attribution {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #333;
}

.tmdb-logo {
    height: 20px;
    margin-bottom: 10px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

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

.tmdb-attribution p {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .movie-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .movie-card img {
        width: 150px;
        height: 225px;
    }

    .seen-buttons, .rating-scale {
        flex-direction: column;
    }

    .seen-btn, .rating-btn {
        min-width: auto;
    }

    #nav-tabs {
        justify-content: center;
    }
}

/* Privacy Modal */
.privacy-modal-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.privacy-content {
    text-align: left;
}

.privacy-content h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #e94560;
}

.privacy-content p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.privacy-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.privacy-content li {
    margin-bottom: 5px;
}

footer a {
    color: #e94560;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Movie Detail Modal */
.movie-detail-content {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.movie-detail-layout {
    display: flex;
    gap: 25px;
}

.detail-poster {
    width: 200px;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.detail-info {
    flex: 1;
}

.detail-info h2 {
    margin-bottom: 10px;
    color: #fff;
}

.detail-meta {
    color: #888;
    margin-bottom: 15px;
}

.detail-overview {
    line-height: 1.6;
    color: #ccc;
    margin-bottom: 20px;
}

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

.detail-actions .btn {
    flex: 1;
    min-width: 140px;
}

@media (max-width: 600px) {
    .movie-detail-layout {
        flex-direction: column;
        align-items: center;
    }
    
    .detail-poster {
        width: 150px;
        height: 225px;
    }
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

/* Muted button style */
.btn-muted {
    background: #444;
    color: #aaa;
}

.btn-muted:hover {
    background: #555;
    color: #ccc;
}

/* Link-style button */
.btn-link {
    background: none;
    border: none;
    color: #888;
    text-decoration: underline;
    cursor: pointer;
    padding: 10px;
}

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

/* Passed movies section */
.passed-movies-toggle {
    text-align: center;
    margin: 20px 0;
}

#passed-movies-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

#passed-movies-section h3 {
    color: #888;
    margin-bottom: 5px;
}

.passed-hint {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.passed-tile {
    opacity: 0.7;
}

.passed-tile:hover {
    opacity: 1;
}

.unpass-hint {
    color: #6a9fb5;
    font-size: 0.8rem;
    margin-top: 5px;
}

.no-passed {
    color: #666;
    text-align: center;
    padding: 20px;
}
