/* Base & Layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: linear-gradient(160deg, #0b0f19 0%, #11193a 30%, #1c2857 30%, #11193a 40%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
    color: var(--text, #eaf0ff);
    transition: background 0.5s ease-in-out;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    animation: fadeIn 1s ease-in;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #6ea8fe, #84f1c9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Search Section */
.search-section {
    background: rgba(17, 25, 58, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin: 40px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.search-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
}

.search-box {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    border: 1px solid #2a5298;
    transition: all 0.3s;
}

.search-box input:focus {
    border-color: #2a5298;
    background-color: rgba(255, 255, 255, 0.15);
}

.search-box button {
    padding: 12px 20px;
    background: #2a5298;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s, transform 0.2s;
}

.search-box button:hover {
    background: #4277d1;
    transform: scale(1.05);
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #2a5298;
    background: transparent;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.filter-btn.active,
.filter-btn:hover {
    background: #4277d1;
    color: #0b0f19;
    transform: scale(1.05);
}

/* Loading */
.loading {
    text-align: center;
    color: white;
    font-size: 18px;
    margin: 40px 0;
    display: none;
    animation: pulse 1s infinite;
}

/* Movie Cards */
.movies-container h2 {
    color: white;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
}

.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.movie-card {
    background: #11193a;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s, filter 0.3s;
    cursor: pointer;
    position: relative;
}

.movie-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 20px 35px rgba(0,0,0,0.5);
    filter: brightness(1.05);
}

.movie-poster {
    width: 100%;
    height: 350px;
    object-fit: cover;
    transition: transform 0.3s;
}

.movie-card:hover .movie-poster {
    transform: scale(1.05);
}

.movie-info {
    padding: 15px;
}

.movie-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 8px;
    line-height: 1.3;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.movie-year {
    color: #aaa;
    font-size: 0.9rem;
}

.movie-rating {
    background: #84f1c9;
    color: #0b0f19;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: bold;
    transition: transform 0.3s;
}

.movie-card:hover .movie-rating {
    transform: scale(1.1);
}

.movie-overview {
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    animation: fadeIn 0.3s ease-in;
}

.modal-content {
    background: #0b0f19;
    margin: 5% auto;
    border-radius: 15px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    color: white;
    overflow-x: hidden;
    overflow-y: auto; 
}

.modal-header {
    position: relative; 
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 25px;
    transition: transform 0.3s;
}

.modal-header:hover {
    transform: scale(1.02);
}

.modal-header img {
    width: 150px;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
}

.modal-info h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.modal-info p {
    margin-bottom: 8px;
    opacity: 0.9;
}

.visit-btn {
    position: absolute;
    right: 10px;
    bottom: 20px;
    margin: 0;
    float: right;
    background: #84f1c9;
    color: #0b0f19;
    padding: 8px 14px;
    border-radius: 12px;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.visit-btn:hover {
    transform: scale(1.05);
}


.close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 30px;
}

.modal-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.genre-tag {
    background: #84f1c9;
    color: #0b0f19;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    transition: transform 0.3s;
}

.genre-tag:hover {
    transform: scale(1.1);
}

/* Animations */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 { font-size: 2rem; }
    .search-section { padding: 20px; }
    .movies-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; }
    .modal-header { flex-direction: column; text-align: center; }
    .modal-header img { width: 120px; height: 160px; }
    .filter-btn { font-size: 0.9rem; padding: 8px 15px; }
}
