* {
    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(33, 37, 41, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid #495057;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.navbar-brand:hover {
    color: #0d6efd !important;
}

.navbar-brand i {
    color: #0d6efd;
    margin-right: 0.5rem;
}

.nav-link {
    color: #adb5bd !important;
    transition: color 0.3s ease;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    color: #fff !important;
}

/* Enhanced Search Styles */
.search-form {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 25px;
    transition: all 0.3s ease;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.search-input-group::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-input-group:hover::after {
    opacity: 1;
}

.search-input-group:focus-within {
    border-color: #0d6efd;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    transform: translateY(-1px);
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem 0.75rem 1.5rem;
    border: none;
    outline: none;
    background: transparent;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    z-index: 2;
}

.search-input::placeholder {
    color: #adb5bd;
    font-weight: 400;
    transition: color 0.3s ease;
}

.search-input:focus::placeholder {
    color: #6c757d;
    transform: translateX(5px);
}

/* Search input focus glow effect */
.search-input-group:focus-within::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #0d6efd, #0b5ed7, #0a58ca);
    border-radius: 27px;
    z-index: -1;
    opacity: 0;
    animation: glow 0.3s ease forwards;
}

@keyframes glow {
    0% { opacity: 0; }
    100% { opacity: 0.3; }
}

.search-btn {
    position: relative;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0 23px 23px 0;
    font-size: 0.9rem;
    font-weight: 500;
    overflow: hidden;
    z-index: 2;
}

.search-btn:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #0a58ca 100%);
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
}

.search-btn:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    border-radius: inherit;
    animation: shimmer 0.6s ease;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.search-btn:active {
    transform: translateX(1px);
}

/* Search icon animation */
.search-btn i {
    transition: transform 0.3s ease;
}

.search-btn:hover i {
    transform: scale(1.1);
}

/* Search loading animation */
.search-btn.loading {
    pointer-events: none;
}

.search-btn.loading i {
    animation: spin 1s linear infinite;
}

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

/* Search suggestions dropdown */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(33, 37, 41, 0.95);
    border: 1px solid #495057;
    border-top: none;
    border-radius: 0 0 15px 15px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    backdrop-filter: blur(10px);
    display: none;
}

.search-suggestion-item {
    padding: 0.75rem 1rem;
    color: #adb5bd;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #495057;
}

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

.search-suggestion-item:hover {
    background: rgba(13, 110, 253, 0.1);
    color: #fff;
}

.search-suggestion-item.active {
    background: rgba(13, 110, 253, 0.2);
    color: #fff;
}

/* Responsive search adjustments */
@media (max-width: 768px) {
    .search-form {
        max-width: 100%;
        margin-top: 1rem;
    }
    
    .search-input-group {
        border-radius: 20px;
    }
    
    .search-btn {
        border-radius: 0 18px 18px 0;
        padding: 0.7rem 1rem;
    }
    
    .search-input {
        padding: 0.7rem 1rem 0.7rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

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

/* Enhanced Loading Spinner */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
    color: white;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(0, 0, 0, 0.2) 100%);
    border-radius: 15px;
    margin: 2rem 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(13, 110, 253, 0.2);
}

.loading .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.25em;
    border-color: #0d6efd;
    border-right-color: transparent;
    animation: spin 1s linear infinite;
}

.loading p {
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: #adb5bd;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.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); }
}

/* Enhanced Loading more indicator */
.loading-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    color: white;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, rgba(0, 0, 0, 0.1) 100%);
    border-radius: 10px;
    margin: 1rem 0;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(13, 110, 253, 0.1);
}

.loading-more .spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.2em;
    border-color: #0d6efd;
    border-right-color: transparent;
    margin-bottom: 0.5rem;
}

.loading-more p {
    font-size: 0.95rem;
    font-weight: 500;
    color: #adb5bd;
    margin: 0;
}

.loading-more .spinner {
    width: 20px;
    height: 20px;
    margin: 0 0.5rem 0 0;
}

/* Movies Grid - Bootstrap compatible */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Enhanced Movie Card Styles */
.movie-card {
    background: linear-gradient(145deg, #2a2d31 0%, #1e2124 100%);
    border: 1px solid #495057 !important;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.movie-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: #0d6efd !important;
}

.movie-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(13, 110, 253, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

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

/* Movie Poster Styles */
.movie-poster-container {
    position: relative;
    overflow: hidden;
}

.movie-poster {
    width: 100%;
    height: 350px;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: brightness(0.9);
}

.movie-card:hover .movie-poster {
    transform: scale(1.08);
    filter: brightness(1.1);
}

/* Movie Overlay Styles */
.movie-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(2px);
}

.movie-overlay i {
    color: white;
    font-size: 3.5rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

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

.movie-card:hover .movie-overlay i {
    transform: scale(1.1);
}

/* Movie Info Styles */
.movie-info {
    padding: 1.5rem;
    background: linear-gradient(145deg, #2a2d31 0%, #1e2124 100%);
    position: relative;
    z-index: 2;
}

.movie-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: color 0.3s ease;
}

.movie-card:hover .movie-title {
    color: #0d6efd;
}

.movie-year {
    color: #adb5bd;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.movie-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.movie-rating, .movie-chapters {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #ced4da;
    font-weight: 500;
}

.movie-rating i {
    color: #ffc107;
    font-size: 0.9rem;
}

.movie-chapters i {
    color: #0d6efd;
    font-size: 0.9rem;
}

.movie-rating span, .movie-chapters span {
    transition: color 0.3s ease;
}

.movie-card:hover .movie-rating span {
    color: #ffc107;
}

.movie-card:hover .movie-chapters span {
    color: #0d6efd;
}

/* Movie Badge Styles */
.movie-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    z-index: 3;
    transition: all 0.3s ease;
}

.movie-card:hover .movie-badge {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Movie Quality Badge */
.movie-quality {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
    z-index: 3;
    transition: all 0.3s ease;
}

.movie-card:hover .movie-quality {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.4);
}

/* Enhanced Footer */
footer {
    background: linear-gradient(145deg, #1a1d20 0%, #0f1113 100%);
    color: #6c757d;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid #495057;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #0d6efd, transparent);
}

footer p {
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: color 0.3s ease;
}

footer:hover p {
    color: #adb5bd;
}

/* Enhanced Search Results Page */
.search-results-header {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(0, 0, 0, 0.2) 100%);
    border-radius: 15px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(13, 110, 253, 0.2);
}

.search-results-header h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #fff 0%, #0d6efd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    color: white;
}

.loading-more .spinner {
    margin-bottom: 1rem;
}

.loading-more p {
    font-size: 1rem;
    opacity: 0.8;
}

/* Enhanced No Results */
.no-results {
    text-align: center;
    color: white;
    padding: 4rem 0;
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.1) 0%, rgba(0, 0, 0, 0.2) 100%);
    border-radius: 15px;
    margin: 2rem 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(108, 117, 125, 0.2);
}

.no-results i {
    color: #6c757d;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.no-results h3 {
    color: #adb5bd;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.no-results p {
    color: #6c757d;
    font-size: 1rem;
    font-weight: 500;
}

.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;
    }
}
