/* Load More Button Styling */
.load-more-btn {
    display: block;
    padding: 0.9rem 2.2rem;
    background: linear-gradient(90deg, #6366f1 0%, #3b82f6 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 2rem auto 0 auto;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99,102,241,0.08);
    transition: background 0.2s, transform 0.2s;
}
.load-more-btn:hover {
    background: linear-gradient(90deg, #3b82f6 0%, #6366f1 100%);
    transform: translateY(-2px) scale(1.04);
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(120deg, #f4f4f4 0%, #e0e7ff 100%);
    min-height: 100vh;
    color: #222;
}


header {
    background: linear-gradient(90deg, #6366f1 0%, #3b82f6 100%);
    color: #fff;
    text-align: center;
    padding: 2.2rem 1rem 1.7rem 1rem;
    box-shadow: 0 4px 24px rgba(99,102,241,0.13);
    letter-spacing: 1px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: relative;
}

.movie-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.10));
    animation: popIn 0.7s cubic-bezier(.68,-0.55,.27,1.55);
    transition: transform 0.15s;
}
.movie-icon-link, .title-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
}

@keyframes popIn {
    0% { transform: scale(0.5) rotate(-20deg); opacity: 0; }
    80% { transform: scale(1.15) rotate(8deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); }
}

.header-content h1 {
    font-size: 2.3rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(59,130,246,0.13);
    position: relative;
    display: inline-block;
}
.header-content h1::after {
    content: '';
    display: block;
    margin: 0.4rem auto 0 auto;
    width: 60%;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, #fbbf24 0%, #f472b6 100%);
    animation: underlineGrow 1.2s cubic-bezier(.68,-0.55,.27,1.55);
}
@keyframes underlineGrow {
    0% { width: 0; opacity: 0; }
    60% { width: 80%; opacity: 1; }
    100% { width: 60%; opacity: 1; }
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem 1rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(99,102,241,0.08);
}

.search {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

#searchInput {
    padding: 0.7rem 1rem;
    width: 260px;
    border: 1px solid #c7d2fe;
    border-radius: 8px 0 0 8px;
    font-size: 1rem;
    background: #f1f5f9;
    color: #222;
    outline: none;
    transition: border 0.2s;
}
#searchInput:focus {
    border: 1.5px solid #6366f1;
}

#searchButton {
    padding: 0.7rem 1.2rem;
    background: linear-gradient(90deg, #6366f1 0%, #3b82f6 100%);
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}
#searchButton:hover {
    background: linear-gradient(90deg, #3b82f6 0%, #6366f1 100%);
}

#sortYear, #sortAlpha {
    padding: 0.7rem 1rem;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    background: #f1f5f9;
    color: #222;
    font-size: 1rem;
    margin-left: 0.5rem;
    cursor: pointer;
    transition: border 0.2s;
}
#sortYear:focus, #sortAlpha:focus {
    border: 1.5px solid #6366f1;
}

.movies {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.movie {
    background: #f9fafb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(99,102,241,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.movie:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 8px 32px rgba(99,102,241,0.15);
}
.movie img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-bottom: 1px solid #e0e7ff;
}
.movie-info {
    padding: 1.2rem 1rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}
.movie-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #3730a3;
    letter-spacing: 0.5px;
}
.movie-year {
    color: #64748b;
    font-size: 0.98rem;
    margin-bottom: 0.7rem;
}
.like-btn {
    padding: 0.5rem 1rem;
    background: #fff;
    color: #6366f1;
    border: 1.5px solid #6366f1;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 500;
    margin-top: auto;
    transition: background 0.2s, color 0.2s;
}
.like-btn:hover, .like-btn:focus {
    background: #6366f1;
    color: #fff;
}
.like-btn[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}

.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: #6366f1;
    display: none;
}
.error {
    text-align: center;
    padding: 2rem;
    color: #ef4444;
    font-weight: 500;
    display: none;
}

@media (max-width: 900px) {
    .container {
        padding: 1rem 0.5rem;
    }
    .movies {
        gap: 1.2rem;
    }
    .movie img {
        height: 220px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 0.5rem 0.2rem;
    }
    .search {
        flex-direction: column;
        gap: 0.7rem;
    }
    #searchInput {
        width: 100%;
        border-radius: 8px;
    }
    #searchButton {
        border-radius: 8px;
        width: 100%;
    }
    #sortYear, #sortAlpha {
        width: 100%;
        margin-left: 0;
    }
    .movies {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .movie img {
        height: 180px;
    }
}
