/* ── Reset & Base ───────────────────────────────────── */
body {
    margin: 0;
    background: #141414;
    color: white;
    font-family: Arial, sans-serif;
    text-align: center;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

h1 {
    color: #e50914;
    font-size: 2rem;
    margin-bottom: 10px;
}

/* ── Controls ───────────────────────────────────────── */
.controls {
    background: #1f1f1f;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 24px;
}

select, input[type="text"] {
    padding: 12px 16px;
    margin: 8px;
    border-radius: 6px;
    border: none;
    font-size: 15px;
    background: #2a2a2a;
    color: white;
    min-width: 140px;
}

input[type="text"] {
    min-width: 200px;
}

/* ── Buttons ────────────────────────────────────────── */
button {
    background: #e50914;
    color: white;
    padding: 11px 16px;
    font-size: 14px;
    margin: 5px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover { background: #b20710; }

.imdb-btn {
    background: #f5c518;
    color: #000;
    font-weight: bold;
}
.imdb-btn:hover { background: #d4a900; }

.fav-btn {
    background: #333;
    font-size: 16px;
    padding: 10px 14px;
}
.fav-btn:hover { background: #555; }

.btn-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.btn-row a { text-decoration: none; }

/* ── Movie Grid ─────────────────────────────────────── */
#movies, #favorites {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
    text-align: left;
}

.movie {
    background: #1f1f1f;
    padding: 12px;
    border-radius: 10px;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.movie:hover { transform: scale(1.03); }

.movie img {
    width: 100%;
    border-radius: 8px;
    display: block;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.movie h3 {
    font-size: 14px;
    margin: 8px 0 4px;
    color: #fff;
    line-height: 1.3;
}

.year {
    font-size: 12px;
    color: #aaa;
    margin: 2px 0;
}

/* ── Ratings Badges ─────────────────────────────────── */
.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 6px 0;
}

.badge {
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 4px;
    font-weight: bold;
    white-space: nowrap;
}

.badge.imdb  { background: #f5c518; color: #000; }
.badge.rt    { background: #fa320a; color: #fff; }
.badge.meta  { background: #1b7e3e; color: #fff; }

/* ── Movie Info Lines ───────────────────────────────── */
.info {
    font-size: 11px;
    color: #bbb;
    margin: 2px 0;
    line-height: 1.4;
}

.awards {
    color: #f5c518;
    font-size: 10px;
}

.desc {
    font-size: 11px;
    color: #999;
    margin: 6px 0 8px;
    line-height: 1.5;
    flex: 1;
}

/* ── Modal ──────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
}

.modal-content {
    position: relative;
    margin: 8% auto;
    width: 80%;
    max-width: 700px;
    background: #000;
    padding: 15px;
    border-radius: 10px;
}

.close-btn {
    position: absolute;
    right: 12px; top: 10px;
    cursor: pointer;
    font-size: 18px;
    color: white;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 600px) {
    #movies, #favorites {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    input[type="text"] { min-width: 140px; }
}
