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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #121212; /* Dark mode background */
    color: #fff;
    line-height: 1.6;
}

/* Header with search bar */
header {
    padding: 1rem;
    background-color: #1f1f1f;
    position: sticky;
    top: 0;
    z-index: 10;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.search {
    width: 100%;
    max-width: 400px;
    padding: 0.7rem 1rem;
    border-radius: 25px;
    border: none;
    outline: none;
    font-size: 1rem;
    background-color: #2c2c2c;
    color: #fff;
    transition: all 0.3s ease;
}

.search::placeholder {
    color: #aaa;
}

.search:focus {
    background-color: #3a3a3a;
    box-shadow: 0 0 10px rgba(255,255,255,0.2);
}

/* Movie grid */
main {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 2rem;
}

/* Movie card */
.movie {
    background-color: #1f1f1f;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.movie img {
    width: 100%;
    display: block;
    border-bottom: 2px solid #333;
}

/* Movie info section */
.movie-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
}

.movie-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Rating badges */
.movie-info span {
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    color: #fff;
    font-size: 0.9rem;
}

/* Rating badge colors (subtle) */
.movie-info .green {
    background-color: #21d07a;
}

.movie-info .orange {
    background-color: #d2d531;
}

.movie-info .red {
    background-color: #db2360;
}

/* Overview section */
.overview {
    padding: 1rem;
    background-color: rgba(30,30,30,0.95);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 100%;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    font-size: 0.9rem;
}

.movie:hover .overview {
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    main {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    main {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    main {
        grid-template-columns: 1fr;
    }
}
