/* CineMatch - Modern Movie Recommendation System Styles */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2C3E50;
    min-height: 100vh;
    line-height: 1.6;
    background:
        linear-gradient(135deg, rgba(102, 126, 234, 0.85) 0%, rgba(118, 75, 162, 0.85) 100%),
        url('https://images.unsplash.com/photo-1489599849927-2ee91cede3ba?auto=format&fit=crop&w=2000&q=60') center/cover no-repeat fixed;
}

/* Header styling */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header h1 {
    text-align: center;
    font-size: 2.5rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Navigation */
.nav-tabs {
    display: flex;
    justify-content: flex-end;
    margin: 1rem 0;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-tab {
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #667eea;
}

.nav-tab.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.nav-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Search and control container */
.controls-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.search-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box input, .search-box select {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-box input:focus, .search-box select:focus {
    outline: none;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.search-box .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
}

.action-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 25px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Results container */
.results-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

/* Movie card styling */
.movie-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.movie-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.movie-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(45deg, #667eea, #764ba2);
}

.poster-container {
    position: relative;
    margin-bottom: 1rem;
}

.poster {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.movie-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.movie-card:hover .movie-actions {
    opacity: 1;
}

.action-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.action-icon:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.action-icon.favorited {
    background: #e74c3c;
    color: white;
}

.action-icon.watchlisted {
    background: #f39c12;
    color: white;
}

.movie-details h3 {
    font-size: 1.4rem;
    margin: 1rem 0 0.5rem 0;
    color: #2C3E50;
    font-weight: 700;
}

.movie-details p {
    font-size: 0.95rem;
    color: #555;
    margin: 0.3rem 0;
}

.movie-details .overview {
    max-height: 80px;
    overflow: hidden;
    margin-top: 0.8rem;
    position: relative;
}

.movie-details .overview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.95));
}

.movie-details strong {
    color: #667eea;
    font-weight: 600;
}

.rating-stars {
    margin: 0.5rem 0;
}

.star {
    color: #ddd;
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s ease;
}

.star.filled {
    color: #f39c12;
}

.star:hover {
    color: #f39c12;
}

/* Modal styling */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 2% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Error and loading states */
.error {
    text-align: center;
    color: #E74C3C;
    font-weight: bold;
    margin: 2rem auto;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: white;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #fff;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* User lists styling */
.user-lists {
    display: none;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.list-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.list-tab {
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #667eea;
}

.list-tab.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

/* Statistics dashboard */
.stats-dashboard {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 1200px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2C3E50;
    display: block;
}

.stat-list {
    list-style: none;
    text-align: left;
}

.stat-list li {
    padding: 0.3rem 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

/* Filters */
.filters-container {
    display: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.filters-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: #667eea;
}

.filter-group select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
}

/* Responsive design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .nav-tabs {
        gap: 0.5rem;
    }

    .nav-tab {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .search-container {
        flex-direction: column;
        align-items: center;
    }

    .search-box {
        max-width: 100%;
    }

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

    .modal-content {
        margin: 5% auto;
        padding: 1rem;
    }

    .filters-row {
        flex-direction: column;
    }

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

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .nav-tab {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    .action-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    .movie-card {
        padding: 1rem;
    }
}