
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: black;
    background-color: white;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Header & Navigation */
header {
    background-color: white;
    border-bottom: 1px solid lightgray;
    padding: 0 40px;
}

nav {
    display: flex;
    align-items: center;
    height: 60px;
    gap: 40px;
}

nav h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

nav ul {
    display: flex;
    gap: 24px;
}

nav ul li a {
    font-size: 0.875rem;
    color: gray;
}

nav ul li a:hover {
    color: black;
}

/* Login Section in Nav */
#login {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

#login .welcome {
    font-size: 0.875rem;
    color: gray;
}

#login button {
    background-color: black;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
}

#login button:hover {
    background-color: dimgray;
}

/* Search Form in Header */
header form {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    border-top: 1px solid lightgray;
}

header form label {
    font-size: 0.875rem;
    font-weight: 600;
}

header form input[type="text"] {
    padding: 8px 16px;
    border: 1px solid lightgray;
    border-radius: 6px;
    font-size: 0.875rem;
    width: 250px;
    background-color: whitesmoke;
}

header form input[type="text"]:focus {
    outline: none;
    border-color: darkgray;
    background-color: white;
}

header form input[type="submit"] {
    background-color: black;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
}

header form input[type="submit"]:hover {
    background-color: dimgray;
}

/* Success and Error Messages */
.error-message {
    background-color: mistyrose;
    color: crimson;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 20px 40px;
    font-size: 0.875rem;
    text-align: center;
    border: 1px solid lightcoral;
}

.success-message {
    background-color: honeydew;
    color: green;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 20px 40px;
    font-size: 0.875rem;
    text-align: center;
    border: 1px solid lightgreen;
}

/* Featured Movie Section */
#FeaturedMovie {
    background-color: darkslategray;
    color: white;
    padding: 80px 40px;
    min-height: 400px;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

#FeaturedMovie .featured-content {
    flex: 1 1 auto;
    max-width: 600px;
    order: 2;
}

#FeaturedMovie .featured-poster {
    flex: 0 0 auto;
    width: 250px;
    order: 1;
}

#FeaturedMovie .featured-poster img {
    width: 250px;
    height: 375px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    background-color: slategray;
}

#FeaturedMovie h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 16px;
}

#FeaturedMovie #featuredInfo {
    font-size: 0.9rem;
    color: silver;
    margin-bottom: 16px;
}

#FeaturedMovie #featuredReview {
    font-size: 1rem;
    color: lightgray;
    margin-bottom: 20px;
    line-height: 1.7;
}

#FeaturedMovie .featured-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

#FeaturedMovie .rating-badge {
    background-color: gold;
    color: black;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

#FeaturedMovie .author {
    color: silver;
    font-size: 0.875rem;
}

#FeaturedMovie button {
    background-color: gold;
    color: black;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    width: fit-content;
}

#FeaturedMovie button:hover {
    background-color: yellow;
}

/* Popular Movies Section */
#PopularMovies {
    padding: 60px 40px;
}

#PopularMovies h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
}

#PopularMovies ul {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
}

#PopularMovies li {
    cursor: pointer;
    transition: transform 0.2s ease;
}

#PopularMovies li:hover {
    transform: translateY(-4px);
}

#PopularMovies figure {
    margin: 0;
}

#PopularMovies img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 12px;
    background-color: slategray;
}

#PopularMovies figcaption {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#PopularMovies .movie-title {
    font-size: 0.9rem;
    font-weight: 600;
}

#PopularMovies .movie-rating {
    font-size: 0.8rem;
    color: gray;
}

#PopularMovies .loading-placeholder,
#PopularMovies .no-data,
#PopularMovies .error {
    grid-column: 1 / -1;
    text-align: center;
    color: gray;
    padding: 40px;
}

/* Recent Reviews Section */
#recentReviews {
    padding: 60px 40px;
    background-color: whitesmoke;
}

#recentReviews h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
}

#recentReviews article {
    background-color: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    transition: box-shadow 0.2s ease;
}

#recentReviews article:hover {
    box-shadow: 0 4px 12px lightgray;
}

#recentReviews .review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

#recentReviews h3 {
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
}

#recentReviews .review-rating {
    background-color: black;
    color: gold;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 12px;
}

#recentReviews .review-text {
    font-size: 0.9rem;
    color: gray;
    margin-bottom: 12px;
    line-height: 1.6;
}

#recentReviews .review-type {
    display: inline-block;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

#recentReviews .review-type.movie {
    background-color: lightblue;
    color: darkblue;
}

#recentReviews .review-type.show {
    background-color: lavender;
    color: purple;
}

#recentReviews .loading-placeholder,
#recentReviews .no-data,
#recentReviews .error {
    text-align: center;
    color: gray;
    padding: 40px;
}

#recentReviews time {
    font-size: 0.8rem;
    color: darkgray;
}

/* Footer */
footer {
    background-color: whitesmoke;
    padding: 60px 40px 40px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    border-top: 1px solid lightgray;
}

footer section h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 16px;
}

#About p {
    font-size: 0.875rem;
    color: gray;
}

footer section ul li {
    margin-bottom: 10px;
}

footer section ul li a {
    font-size: 0.875rem;
    color: gray;
}

footer section ul li a:hover {
    color: black;
}