/* General Styles */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #121212; /* Deeper dark background */
    color: #e0e0e0; /* Light text */
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.main-wrapper {
    display: flex;
    justify-content: center;
    gap: 3rem; /* Increased gap for more breathing room */
    max-width: 1500px; /* Slightly increased max-width */
    margin: 3rem auto; /* Adjusted margin */
    padding: 2rem; /* Adjusted padding */
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5); /* Subtle overall shadow */
    border-radius: 15px; /* Slightly rounded corners for the main wrapper */
}

.left-column {
    flex: 3; /* Takes more space */
    min-width: 700px; /* Minimum width for left column */
    background-color: #1e1e1e; /* Slightly lighter dark background for content area */
    padding: 2.5rem; /* Increased padding */
    border-radius: 15px; /* Rounded corners */
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.4); /* Soft shadow */
}

.container {
    width: 100%;
    max-width: 1200px; /* Max width for content within the container */
    margin: 0 auto; /* Center the container */
    padding: 0; /* Remove padding as it's handled by left-column */
}

/* Mood Selector */
.mood-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem; /* Slightly reduced gap */
    margin-bottom: 3rem; /* Adjusted margin */
}

.mood-btn {
    background: linear-gradient(45deg, #533483, #e94560); /* Gradient accent color */
    color: #fff;
    border: none;
    padding: 0.9rem 2rem; /* Slightly reduced padding */
    border-radius: 25px; /* Slightly less rounded */
    cursor: pointer;
    font-size: 1.1rem; /* Slightly smaller font */
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4); /* Slightly softer shadow */
    flex-grow: 1;
    min-width: 120px; /* Adjusted min-width */
}

.mood-btn:hover {
    background: linear-gradient(45deg, #e94560, #533483);
    transform: translateY(-3px); /* Slightly less pronounced lift */
    box-shadow: 0 8px 20px rgba(233, 69, 96, 0.5); /* Slightly softer shadow on hover */
}

/* Category Selector */
.category-selector {
    margin-top: 3rem; /* Adjusted margin */
    margin-bottom: 3rem; /* Adjusted margin */
    background-color: #1a1a1a; /* Darker background */
    padding: 2rem; /* Adjusted padding */
    border-radius: 12px; /* Slightly less rounded */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); /* Softer shadow */
    text-align: center;
}

.category-selector h2 {
    font-size: 2rem; /* Slightly smaller font */
    color: #e94560;
    margin-bottom: 1.8rem; /* Adjusted margin */
    text-shadow: 0 0 10px rgba(233, 69, 96, 0.3); /* Softer shadow */
}

#category-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem; /* Slightly reduced gap */
}

.category-btn {
    background-color: #0f3460;
    color: #fff;
    border: 1px solid #3e4a61;
    padding: 0.7rem 1.5rem; /* Adjusted padding */
    border-radius: 20px; /* Slightly less rounded */
    cursor: pointer;
    font-size: 0.95rem; /* Slightly smaller font */
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2); /* Softer shadow */
}

.category-btn:hover {
    background-color: #e94560;
    border-color: #e94560;
    transform: translateY(-2px); /* Slightly less pronounced lift */
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4); /* Softer shadow on hover */
}

/* Controls (Sort & Filter) */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem; /* Slightly reduced gap */
    margin-bottom: 2.5rem; /* Adjusted margin */
    flex-wrap: wrap;
    background-color: #1a1a1a; /* Darker background */
    padding: 1.5rem; /* Adjusted padding */
    border-radius: 10px; /* Slightly less rounded */
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3); /* Softer inner shadow */
}

.controls label {
    font-weight: 500;
    color: #b0b0b0;
    font-size: 1rem; /* Slightly smaller font */
}

.controls select,
.controls input[type="text"] {
    padding: 0.8rem 1.2rem; /* Adjusted padding */
    border: 1px solid #3e4a61;
    border-radius: 8px; /* Slightly less rounded */
    font-size: 1rem; /* Slightly smaller font */
    color: #e0e0e0;
    background-color: #2c3e50;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 180px; /* Adjusted width */
}

.controls select:focus,
.controls input[type="text"]:focus {
    border-color: #e94560;
    box-shadow: 0 0 0 0.3rem rgba(233, 69, 96, 0.3); /* Softer shadow */
    outline: none;
}

/* General Search Bar */
.general-search {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem; /* Slightly reduced gap */
    margin-bottom: 2.5rem; /* Adjusted margin */
    flex-wrap: wrap;
    background-color: #1a1a1a; /* Darker background */
    padding: 1.5rem; /* Adjusted padding */
    border-radius: 10px; /* Slightly less rounded */
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3); /* Softer inner shadow */
}

#general-search-input {
    flex-grow: 1;
    padding: 0.8rem 1.2rem; /* Adjusted padding */
    border: 1px solid #3e4a61;
    border-radius: 8px; /* Slightly less rounded */
    font-size: 1rem; /* Slightly smaller font */
    color: #e0e0e0;
    background-color: #2c3e50;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#general-search-input:focus {
    border-color: #e94560;
    box-shadow: 0 0 0 0.3rem rgba(233, 69, 96, 0.3); /* Softer shadow */
    outline: none;
}

#general-search-btn {
    padding: 0.8rem 1.8rem; /* Adjusted padding */
    font-size: 1rem; /* Slightly smaller font */
}

/* Movie Recommendations Grid */
#movie-recommendations {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Adjusted minmax for more cards */
    gap: 1.5rem; /* Slightly reduced gap */
    padding: 1.5rem 0; /* Adjusted padding */
}

.movie-card {
    background-color: #1a1a1a; /* Darker background */
    border: 1px solid #2c3e50;
    border-radius: 12px; /* Slightly less rounded */
    padding: 1.5rem; /* Adjusted padding */
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); /* Softer shadow */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.movie-card:hover {
    transform: translateY(-5px); /* Slightly less pronounced lift */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4); /* Softer shadow on hover */
}

.movie-card img {
    max-width: 100%;
    height: auto;
    border-radius: 8px; /* Slightly less rounded */
    margin-bottom: 1rem; /* Adjusted margin */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); /* Softer shadow */
}

.movie-card h3 {
    font-size: 1.3rem; /* Slightly smaller font */
    color: #e94560;
    margin-bottom: 0.6rem; /* Adjusted margin */
    font-weight: 600;
}

.movie-card p {
    font-size: 0.95rem; /* Slightly smaller font */
    color: #b0b0b0;
    margin-bottom: 0.4rem; /* Adjusted margin */
}

.movie-card p strong {
    color: #e0e0e0;
}

/* Search History */
#search-history {
    margin-top: 4rem; /* Adjusted margin */
    padding-top: 2.5rem; /* Adjusted padding */
    border-top: 1px solid #2c3e50;
}

#search-history h2 {
    font-size: 2rem; /* Slightly smaller font */
    color: #e94560;
    margin-bottom: 1.8rem; /* Adjusted margin */
}

#history-list {
    list-style: none;
    padding: 0;
    text-align: center;
}

#history-list li {
    background-color: #2c3e50;
    padding: 0.8rem 1.5rem; /* Adjusted padding */
    margin-bottom: 1rem; /* Adjusted margin */
    border-radius: 25px; /* Slightly less rounded */
    color: #e94560;
    font-size: 0.95rem; /* Slightly smaller font */
    display: inline-block;
    margin-right: 1rem; /* Adjusted margin */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15); /* Softer shadow */
}

/* Movie Details Page Specific Styles */
.movie-details-container {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem; /* Slightly reduced gap */
    margin-top: 2.5rem; /* Adjusted margin */
    justify-content: center;
    align-items: flex-start;
    background-color: #1a1a1a; /* Darker background */
    border-radius: 12px; /* Slightly less rounded */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4); /* Softer shadow */
    padding: 3rem; /* Adjusted padding */
}

.movie-poster-column {
    flex: 1;
    min-width: 280px; /* Adjusted min-width */
    max-width: 350px; /* Adjusted max-width */
    text-align: center;
    position: relative;
    overflow: hidden;
    border-radius: 12px; /* Slightly less rounded */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); /* Softer shadow */
}

.movie-poster-column img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px; /* Slightly less rounded */
    transition: transform 0.3s ease;
}

.movie-poster-column img:hover {
    transform: scale(1.05); /* More pronounced scale */
}

.movie-info-column {
    flex: 2;
    min-width: 350px; /* Adjusted min-width */
    max-width: 700px; /* Adjusted max-width */
    padding-left: 1.8rem; /* Slightly reduced padding */
    border-left: 1px solid rgba(233, 69, 96, 0.3); /* Softer border */
}

.movie-info-column p {
    font-size: 1.1rem; /* Slightly smaller font */
    color: #c0c0c0;
    margin-bottom: 0.8rem; /* Adjusted margin */
    line-height: 1.7; /* Adjusted line-height */
}

.movie-info-column p strong {
    color: #e94560;
    margin-right: 0.8rem; /* Adjusted margin */
    font-weight: 700;
}

#movie-title {
    font-size: 3rem; /* Slightly smaller font */
    color: #e94560;
    text-align: center;
    margin-bottom: 1.8rem; /* Adjusted margin */
    text-shadow: 0 0 15px rgba(233, 69, 96, 0.5); /* Softer shadow */
}

#movie-ratings p {
    font-size: 1rem; /* Slightly smaller font */
    margin-bottom: 0.5rem; /* Adjusted margin */
}

#movie-ratings p strong {
    color: #e0e0e0;
}

.detail-buttons {
    display: flex;
    gap: 1.5rem; /* Slightly reduced gap */
    margin-top: 2.5rem; /* Adjusted margin */
    justify-content: center;
    flex-wrap: wrap;
}

.detail-buttons .mood-btn {
    padding: 1rem 2.5rem; /* Adjusted padding */
    font-size: 1.1rem; /* Slightly smaller font */
    border-radius: 30px; /* Slightly less rounded */
    box-shadow: 0 6px 18px rgba(233, 69, 96, 0.4); /* Softer shadow */
}

.detail-buttons .mood-btn:hover {
    transform: translateY(-5px); /* More pronounced lift */
    box-shadow: 0 12px 30px rgba(233, 69, 96, 0.7); /* Enhanced shadow on hover */
}

/* Back to Recommendations link */
p a {
    display: inline-block;
    margin-top: 3rem; /* Adjusted margin */
    padding: 1rem 2rem; /* Adjusted padding */
    background-color: #0f3460;
    color: #fff;
    text-decoration: none;
    border-radius: 30px; /* Slightly less rounded */
    transition: background-color 0.3s ease, transform 0.3s ease;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3); /* Softer shadow */
    font-size: 1.1rem; /* Slightly smaller font */
}

p a:hover {
    background-color: #16213e;
    transform: translateY(-3px); /* Slightly less pronounced lift */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); /* Softer shadow on hover */
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .main-wrapper {
        flex-direction: column;
        gap: 1.5rem; /* Adjusted gap */
        padding: 1rem; /* Adjusted padding */
    }

    .left-column {
        min-width: unset;
        width: 100%;
    }

    .container {
        margin-bottom: 1.5rem; /* Adjusted margin */
    }

    .movie-details-container {
        flex-direction: column;
        align-items: center;
    }

    .movie-poster-column,
    .movie-info-column {
        min-width: unset;
        max-width: 100%;
    }

    .mood-selector {
        gap: 0.8rem; /* Adjusted gap */
    }

    .mood-btn {
        padding: 0.8rem 1.8rem; /* Adjusted padding */
        font-size: 1rem; /* Adjusted font size */
        min-width: unset;
        flex-grow: 0;
    }

    .controls {
        flex-direction: column;
        gap: 1.2rem; /* Adjusted gap */
        padding: 1rem; /* Adjusted padding */
    }

    .controls select,
    .controls input[type="text"] {
        width: 90%; /* Adjusted width */
    }

    #movie-recommendations {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* Adjusted minmax */
        gap: 1.2rem; /* Adjusted gap */
    }

    .movie-card {
        padding: 1.2rem; /* Adjusted padding */
    }

    .movie-card h3 {
        font-size: 1.2rem; /* Adjusted font size */
    }

    .movie-card p {
        font-size: 0.9rem; /* Adjusted font size */
    }

    #search-history h2 {
        font-size: 1.8rem; /* Adjusted font size */
    }

    #history-list li {
        font-size: 0.9rem; /* Adjusted font size */
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1.2rem; /* Adjusted padding */
    }

    h1 {
        font-size: 2.2rem; /* Adjusted font size for smaller screens */
        color: #e94560;
        text-align: center;
        margin-bottom: 1.8rem; /* Adjusted margin */
        text-shadow: 0 0 10px rgba(233, 69, 96, 0.4);
        letter-spacing: 0.5px;
    }

    .mood-btn {
        width: 48%;
        margin: 0.4rem 0; /* Adjusted margin */
        padding: 0.7rem 1.2rem; /* Adjusted padding */
        font-size: 0.95rem; /* Adjusted font size */
    }

    .controls select,
    .controls input[type="text"] {
        width: 98%; /* Adjusted width */
        font-size: 1rem; /* Adjusted font size */
        padding: 0.8rem 1.2rem; /* Adjusted padding */
    }

    #movie-recommendations {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); /* Adjusted minmax */
        gap: 1rem; /* Adjusted gap */
    }

    .movie-card {
        padding: 1.2rem; /* Adjusted padding */
    }

    .movie-card h3 {
        font-size: 1.1rem; /* Adjusted font size */
    }

    .movie-card p {
        font-size: 0.85rem; /* Adjusted font size */
    }

    .movie-poster-column img {
        max-width: 200px; /* Adjusted max-width */
    }

    .movie-info-column p {
        font-size: 1rem; /* Adjusted font size */
    }

    #history-list li {
        font-size: 0.9rem; /* Adjusted font size */
        padding: 0.7rem 1.2rem; /* Adjusted padding */
    }
}

@media (max-width: 480px) {
    .main-wrapper {
        padding: 0.5rem; /* Adjusted padding */
    }

    .container {
        padding: 1rem; /* Adjusted padding */
    }

    h1 {
        font-size: 1.6rem; /* Adjusted font size */
    }

    .mood-btn {
        width: 100%;
        margin: 0.4rem auto;
        padding: 0.6rem 1rem; /* Adjusted padding */
        font-size: 0.9rem; /* Adjusted font size */
    }

    .category-btn {
        padding: 0.6rem 1.2rem; /* Adjusted padding */
        font-size: 0.9rem; /* Adjusted font size */
    }

    .controls select,
    .controls input[type="text"] {
        width: 100%;
        font-size: 0.95rem; /* Adjusted font size */
        padding: 0.7rem 1rem; /* Adjusted padding */
    }

    #movie-recommendations {
        grid-template-columns: 1fr;
        gap: 0.8rem; /* Adjusted gap */
    }

    .movie-card {
        padding: 1rem; /* Adjusted padding */
    }

    .movie-card h3 {
        font-size: 1rem; /* Adjusted font size */
    }

    .movie-card p {
        font-size: 0.8rem; /* Adjusted font size */
    }

    #history-list li {
        display: block;
        margin: 0.4rem auto;
        width: 98%; /* Adjusted width */
        font-size: 0.85rem; /* Adjusted font size */
        padding: 0.6rem 1rem; /* Adjusted padding */
    }
}