* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Navbar Styles */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.nav-logo i {
    font-size: 2rem;
}

.nav-search {
    flex: 1;
    max-width: 500px;
    margin-left: 2rem;
}

.search-container {
    display: flex;
    background: #f8f9fa;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-container:focus-within {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

#searchInput {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
}

#searchBtn {
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

#searchBtn:hover {
    background: #5a6fd8;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Loading Spinner */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading more indicator */
.loading-more {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    color: white;
    font-size: 0.9rem;
    opacity: 0.8;
}

.loading-more .spinner {
    width: 20px;
    height: 20px;
    margin: 0 0.5rem 0 0;
}

/* Movies Grid - 4 Rows Layout */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.movie-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.movie-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.movie-poster {
    width: 100%;
    height: 350px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.movie-card:hover .movie-poster {
    transform: scale(1.05);
}

.movie-info {
    padding: 1.5rem;
}

.movie-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #333;
    line-height: 1.3;
}

.movie-year {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.movie-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
}

.movie-rating i {
    color: #ffd700;
}

/* No Results */
.no-results {
    text-align: center;
    color: white;
    padding: 4rem 0;
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 15px;
    z-index: 1;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #000;
}

.modal-movie {
    display: flex;
    flex-direction: column;
}

.modal-poster {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.modal-info {
    padding: 2rem;
}

.modal-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #333;
}

.modal-details {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.modal-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #667eea;
    font-weight: 600;
}

.modal-plot {
    line-height: 1.6;
    color: #666;
    margin-bottom: 1rem;
}

.modal-cast {
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-search {
        margin-left: 0;
        width: 100%;
    }
    
    .movies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .movie-poster {
        height: 250px;
    }
    
    .movie-info {
        padding: 1.2rem;
    }
    
    .movie-title {
        font-size: 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-info {
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-details {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .movies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .movie-card {
        max-width: none;
        margin: 0;
    }
    
    .movie-poster {
        height: 200px;
    }
    
    .movie-info {
        padding: 1rem;
    }
    
    .movie-title {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .movie-year {
        font-size: 0.8rem;
    }
    
    .movie-details {
        margin-top: 0.3rem;
    }
    
    .movie-rating, .movie-chapters {
        font-size: 0.7rem;
    }
}
