/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: 0;
}

.modal-dialog {
    max-width: 80%;
    margin: 1.75rem auto;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #2d2d2d;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, .2);
    border-radius: 0.3rem;
    outline: 0;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem 1rem;
    border-bottom: 1px solid #444;
    background-color: #1a1a1a;
}

.modal-title {
    margin-bottom: 0;
    line-height: 1.5;
}

.btn-close {
    padding: 0.5rem 0.5rem;
    margin: -0.5rem -0.5rem -0.5rem auto;
}

.btn-close-white {
    filter: invert(1) grayscale(100%);
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-dialog {
        max-width: 95%;
    }
    
    .modal-body {
        flex-direction: column;
    }
    
    .modal-body .col-md-4,
    .modal-body .col-md-8 {
        width: 100%;
        margin-bottom: 1rem;
    }
}

/* Main Styles */
body {
    font-family: 'Oswald', sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
}

.container-fluid {
    max-width: 95%;
}

/* Header Styles */
header {
    background: linear-gradient(to right, #1c1c1c, #333);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Search Section */
.search-section {
    background: #2d2d2d;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    margin-top: 2rem;
}

.filter-btn {
    border-color: #666;
    color: #fff;
    transition: all 0.3s ease;
}

.filter-btn:hover, .filter-btn.active {
    background-color: #e50914;
    border-color: #e50914;
    color: #fff;
}

/* Type Filter Dropdown */
.type-filter-container {
    position: relative;
    display: inline-block;
}

.form-select {
    background-color: #2d2d2d;
    border: 1px solid #666;
    color: #fff;
    padding-right: 2.5rem; /* For the caret icon */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23ffffff' viewBox='0 0 24 24' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem 1.25rem;
    transition: all 0.3s ease;
}

.form-select:focus {
    border-color: #e50914;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(229,9,20,0.25);
}

/* Carousel Styles */
.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    will-change: transform;
}

.carousel-item {
    flex: 0 0 auto;
    width: calc(25% - 1rem);
    margin-right: 1rem;
    display: inline-block;
    vertical-align: top;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

.carousel-item.fade-in-up {
    opacity: 1;
    transform: scale(1);
}

/* Carousel navigation styles */
.carousel-navigation {
    position: absolute;
    top: 40%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateY(-50%);
    z-index: 10;
    padding: 0 1rem;
}

.carousel-navigation button {
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-navigation button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Watchlist Carousel Navigation */
.watchlist-carousel-navigation {
    position: absolute;
    top: 40%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateY(-50%);
    z-index: 10;
    padding: 0 0.75rem;
}

.watchlist-carousel-navigation button {
    background-color: rgba(229, 9, 20, 0.6); /* Netflix red accent */
    border: none;
    color: white;
    font-size: 1.8rem;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 2.8rem;
    height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.watchlist-carousel-navigation button:hover {
    background-color: rgba(229, 9, 20, 0.9);
    transform: scale(1.1);
}

/* Responsive adjustments for watchlist carousel */
@media (max-width: 768px) {
    .watchlist-carousel-navigation {
        padding: 0 0.4rem;
    }
    
    .watchlist-carousel-navigation button {
        font-size: 1.4rem;
        width: 2.4rem;
        height: 2.4rem;
    }
}

/* Ensure proper spacing on smaller screens */
@media (max-width: 768px) {
    .carousel-navigation {
        padding: 0 0.5rem;
    }
    
    .carousel-navigation button {
        font-size: 1.5rem;
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* Movie Cards */
.movie-card {
    background-color: #2d2d2d;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    height: 100%;
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.movie-poster {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
}

.movie-card:hover .movie-poster {
    opacity: 0.9;
}

.movie-info {
    padding: 1rem;
}

.movie-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.movie-year {
    color: #bbb;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.rating {
    color: #ffc107;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.watchlist-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #ccc;
    font-size: 1.2rem;
    transition: color 0.3s ease;
    cursor: pointer;
}

.watchlist-icon.active {
    color: #dc3545;
}

/* Results Section */
#resultsSection, #watchListSection {
    background: #222;
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

h2 {
    color: #e50914;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2rem;
}

/* Footer */
footer {
    background: linear-gradient(to right, #1c1c1c, #333);
    box-shadow: 0 -2px 5px rgba(0,0,0,0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-section {
        margin-top: 1rem;
        padding: 1rem;
    }
    
    /* Adjust carousel for smaller screens */
    .carousel-item {
        width: calc(50% - 1rem);
    }
    
    /* Adjust type filter for mobile */
    .type-filter-container {
        width: 100%;
    }
    
    .form-select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* For very small screens */
    .carousel-item {
        width: calc(100% - 1rem);
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}