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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: #fff;
    min-height: 100vh;
    padding: 20px;
}

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


header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
    font-size: 2.8rem;
    background: linear-gradient(90deg, #ff8a00, #e52e71);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 10px;
}

.subtitle {
    color: #b0b0d0;
    font-size: 1.1rem;
}


.search-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

#searchInput {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #e52e71;
    box-shadow: 0 0 15px rgba(229, 46, 113, 0.3);
}

#searchInput::placeholder {
    color: #b0b0d0;
}

button {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

#searchBtn {
    background: linear-gradient(90deg, #e52e71, #ff8a00);
    color: white;
}

#randomBtn {
    background: linear-gradient(90deg, #00c6ff, #0072ff);
    color: white;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.filters {
    display: flex;
    gap: 15px;
}

select {
    padding: 12px 20px;
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

select:focus {
    outline: none;
    border-color: #00c6ff;
}

option {
    background: #302b63;
    color: white;
}


.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid #e52e71;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.movie-count {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    font-size: 1.1rem;
}

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

.movie-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.movie-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(229, 46, 113, 0.5);
}

.poster {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.no-poster {
    width: 100%;
    height: 350px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0b0d0;
}

.movie-info {
    padding: 20px;
}

.movie-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-details {
    color: #b0b0d0;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.movie-type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.type-movie {
    background: rgba(229, 46, 113, 0.2);
    color: #ff6b9d;
}

.type-series {
    background: rgba(0, 114, 255, 0.2);
    color: #6baaff;
}

.type-episode {
    background: rgba(255, 138, 0, 0.2);
    color: #ffb366;
}

.view-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: rgba(229, 46, 113, 0.5);
}


.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 20px;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 2rem;
    cursor: pointer;
    color: #fff;
    z-index: 1001;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #e52e71;
}

#modalBody {
    padding: 40px;
}

.modal-details {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
}

.modal-poster {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-info h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #ff8a00, #e52e71);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.meta-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #b0b0d0;
}

.plot {
    margin: 25px 0;
    line-height: 1.6;
    font-size: 1.1rem;
}

.ratings {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.rating-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    min-width: 120px;
}

.rating-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ff8a00;
}

.rating-source {
    font-size: 0.9rem;
    color: #b0b0d0;
    margin-top: 5px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.detail-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 10px;
}

.detail-label {
    font-size: 0.9rem;
    color: #b0b0d0;
    margin-bottom: 5px;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 600;
}


footer {
    text-align: center;
    padding: 20px;
    color: #b0b0d0;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer a {
    color: #00c6ff;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #e52e71;
    text-decoration: underline;
}

.api-notice {
    font-size: 0.8rem;
    margin-top: 5px;
    color: #888;
}


.hidden {
    display: none !important;
}


@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .modal-details {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .movie-grid {
        grid-template-columns: 1fr;
    }
    
    button {
        width: 100%;
        justify-content: center;
    }
}