/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.subtitle {
    color: #718096;
    font-size: 1.1rem;
}

/* Search Styles */
.search-container {
    margin-bottom: 30px;
}

.search-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    font-size: 1.2rem;
    color: #a0aec0;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 14px 50px 14px 45px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.clear-input-button {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #a0aec0;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.clear-input-button:hover {
    background: #f7fafc;
    color: #718096;
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.search-suggestions::-webkit-scrollbar {
    width: 6px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f7fafc;
}

.suggestion-item:hover {
    background: #f7fafc;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 12px;
}

.suggestion-info {
    flex: 1;
}

.suggestion-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

.suggestion-meta {
    font-size: 0.8rem;
    color: #718096;
    margin-top: 2px;
}

/* Search Filters */
.search-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
    min-width: 120px;
}

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

.reset-filters-button {
    padding: 8px 20px;
    background: #fc8181;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.reset-filters-button:hover {
    background: #f56565;
    transform: translateY(-2px);
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 20px;
    color: #718096;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 10px;
}

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

/* Results Counter */
.results-counter {
    text-align: center;
    color: #718096;
    margin-bottom: 30px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.results-counter strong {
    color: #2d3748;
}

/* Movies Grid */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    transition: all 0.3s;
}

.movie-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    animation: fadeIn 0.3s ease-in;
}

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

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.movie-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.movie-thumbnail {
    position: relative;
    padding-top: 150%;
    background: #f7fafc;
    overflow: hidden;
}

.movie-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.movie-card:hover .movie-image {
    transform: scale(1.05);
}

.movie-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.75);
    padding: 6px 12px;
    border-radius: 20px;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
}

.movie-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.movie-info {
    padding: 16px;
}

.movie-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-meta {
    display: flex;
    gap: 8px;
    font-size: 0.85rem;
    color: #718096;
}

.movie-year {
    background: #edf2f7;
    padding: 2px 10px;
    border-radius: 12px;
}

.movie-genre {
    background: #edf2f7;
    padding: 2px 10px;
    border-radius: 12px;
}

.movie-media {
    background: #edf2f7;
    padding: 2px 10px;
    border-radius: 12px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    animation: fadeIn 0.3s ease-in;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h2 {
    color: #2d3748;
    margin-bottom: 10px;
}

.empty-state p {
    margin-bottom: 20px;
}

.reset-link {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.reset-link:hover {
    transform: translateY(-2px);
}

/* Movie Detail Page */
.movie-detail {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    margin-top: 30px;
}

.detail-image {
    position: sticky;
    top: 20px;
}

.detail-poster {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.detail-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-title {
    font-size: 2.5rem;
    color: #2d3748;
    margin-bottom: 10px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 1.1rem;
}

.detail-meta span {
    background: #edf2f7;
    padding: 8px 16px;
    border-radius: 12px;
    color: #2d3748;
}

.detail-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #4a5568;
    margin: 10px 0;
}

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

.action-button {
    padding: 14px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.action-button.secondary {
    background: #edf2f7;
    color: #2d3748;
}

.action-button.secondary:hover {
    background: #e2e8f0;
    box-shadow: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .movie-detail {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .detail-image {
        position: static;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .detail-title {
        font-size: 2rem;
    }
    
    .search-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .reset-filters-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }
    
    .movie-title {
        font-size: 0.9rem;
    }
    
    .detail-actions {
        flex-direction: column;
    }
    
    .action-button {
        width: 100%;
    }
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding: 20px 0;
}

.pagination-button {
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.page-info {
    font-size: 1rem;
    color: #4a5568;
    font-weight: 600;
    min-width: 120px;
    text-align: center;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-container {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .pagination-button {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .page-info {
        font-size: 0.9rem;
        min-width: 100px;
    }
}

/* Movie grid animation for pagination */
.movie-card {
    animation: fadeIn 0.3s ease-in;
}

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