* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #f4f7fb;
}

/* Navbar Styles */
.navbar {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h2 {
    font-size: 1.8rem;
    font-weight: 700;
}

.logo span {
    color: #4facfe;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu li a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu li a span {
    font-size: 1.2rem;
}

.nav-menu li.active a,
.nav-menu li a:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.welcome-text {
    color: #fff;
    font-size: 0.95rem;
}

.welcome-text span {
    color: #4facfe;
    font-weight: 600;
}

.logout-btn {
    padding: 0.5rem 1.2rem;
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background: #e53e3e;
    border-color: #e53e3e;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Search Section */
.search-section {
    margin-bottom: 3rem;
}

.search-container {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 12px;
    overflow: hidden;
}

.search-container input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    font-size: 1rem;
    background: white;
}

.search-container input:focus {
    outline: none;
}

.search-container button {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-container button:hover {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
}

/* Movies Section */
.movies-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2rem;
    color: #1a1a2e;
    font-weight: 700;
}

.movie-count {
    background: #4facfe;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Movie Grid */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.movie-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #eef2f6;
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.15);
}

.movie-thumbnail {
    width: 100%;
    height: 0;
    padding-bottom: 55%; /* 20:11 aspect ratio */
    background-size: cover;
    background-position: center;
    background-color: #1a1a2e;
    position: relative;
}

.movie-thumbnail::after {
    content: '🎬';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    opacity: 0.5;
    color: white;
}

.movie-info {
    padding: 1.2rem;
}

.movie-info h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    color: #718096;
    font-size: 0.85rem;
}

/* File type badge */
.movie-type {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: #eef2f6;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
    color: #4a5568;
    margin-top: 0.5rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4facfe;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.no-movies {
    text-align: center;
    padding: 3rem;
    color: #718096;
    grid-column: 1/-1;
}

.no-movies p {
    font-size: 1.2rem;
    margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .user-menu {
        width: 100%;
        justify-content: center;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
}

/* Additional styles for new features */

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(229,9,20,0.3);
    border-top: 4px solid #e50914;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    background: #e50914;
    color: white;
    border-radius: 4px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Movie Card Enhancements */
.movie-card {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.movie-card:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 10;
}

.movie-thumbnail {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background-size: cover;
    background-position: center;
    transition: all 0.3s ease;
}

.movie-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.movie-card:hover .movie-thumbnail::after {
    opacity: 1;
}

.movie-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 15px 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, transparent 100%);
}

.movie-card:hover .movie-info {
    transform: translateY(0);
}

.movie-info h4 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 5px;
}

.movie-type {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: #e50914;
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid #e50914;
    z-index: 2;
}

.favorite-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #e50914;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 2;
    cursor: pointer;
}

.movie-card.favorite .favorite-badge {
    opacity: 1;
}

.movie-card:hover .favorite-badge {
    opacity: 1;
}

.movie-year {
    display: inline-block;
    margin-top: 5px;
    font-size: 0.8rem;
    color: #e50914;
    font-weight: 600;
}

/* Progress bar for watched movies */
.watch-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #e50914;
    transition: width 0.3s ease;
}

/* Empty states */
.no-movies, .no-favorites {
    text-align: center;
    padding: 60px;
    color: #666;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    margin: 40px;
}

.no-movies p, .no-favorites p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.no-favorites h2 {
    font-size: 2rem;
    color: white;
    margin-bottom: 10px;
}

.favorites-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.page-btn {
    background: #333;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    min-width: 40px;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background: #444;
}

.page-btn.active {
    background: #e50914;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 40px;
    padding: 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-select {
    background: #333;
    color: white;
    border: 1px solid #444;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-select:hover {
    border-color: #e50914;
}

.filter-select:focus {
    outline: none;
    border-color: #e50914;
}

.view-options {
    display: flex;
    gap: 10px;
}

.view-btn {
    background: #333;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.view-btn.active {
    background: #e50914;
}

/* List View Styles */
.movies-list-view {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px 40px;
}

.movie-list-item {
    display: flex;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.movie-list-item:hover {
    background: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

.movie-list-thumbnail {
    width: 150px;
    height: 84px;
    background-size: cover;
    background-position: center;
}

.movie-list-info {
    flex: 1;
    padding: 15px;
}

.movie-list-title {
    font-size: 1.1rem;
    color: white;
    margin-bottom: 5px;
}

.movie-list-meta {
    display: flex;
    gap: 20px;
    color: #999;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #e50914;
    padding: 10px;
}

.favorite-btn:hover {
    transform: scale(1.2);
}

/* Timeline View */
.timeline {
    padding: 20px 40px;
}

.timeline-year {
    margin-bottom: 40px;
}

.timeline-year h2 {
    font-size: 2rem;
    color: #e50914;
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.timeline-month {
    margin-bottom: 30px;
}

.timeline-month h3 {
    font-size: 1.3rem;
    color: #999;
    margin-bottom: 15px;
}

.movie-count-badge {
    display: inline-block;
    background: #e50914;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-left: 10px;
}

/* Settings Page */
.settings-container {
    max-width: 800px;
    margin: 100px auto 40px;
    padding: 0 20px;
}

.settings-section {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

.settings-section h2 {
    color: #e50914;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.settings-group {
    margin-bottom: 25px;
}

.settings-group label {
    display: block;
    color: #999;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.settings-group input,
.settings-group select {
    width: 100%;
    padding: 12px;
    background: #333;
    border: 1px solid #444;
    color: white;
    border-radius: 4px;
    font-size: 1rem;
}

.settings-group input:focus,
.settings-group select:focus {
    outline: none;
    border-color: #e50914;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.settings-divider {
    height: 1px;
    background: #333;
    margin: 30px 0;
}

.danger-zone {
    border: 1px solid #e50914;
    background: rgba(229, 9, 20, 0.05);
}

.danger-zone h2 {
    color: #e50914;
}

.danger-btn {
    background: #e50914;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
}

.danger-btn:hover {
    background: #b20710;
}

.save-settings-btn {
    background: #e50914;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    width: 100%;
    margin-top: 20px;
}

.save-settings-btn:hover {
    background: #b20710;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-bar {
        margin: 10px;
        padding: 15px;
    }
    
    .filter-options {
        width: 100%;
    }
    
    .filter-select {
        flex: 1;
    }
    
    .movies-list-view {
        padding: 10px;
    }
    
    .movie-list-item {
        flex-direction: column;
    }
    
    .movie-list-thumbnail {
        width: 100%;
        height: 120px;
    }
    
    .timeline {
        padding: 10px;
    }
    
    .settings-container {
        margin-top: 80px;
    }
    
    .settings-section {
        padding: 20px;
    }
}