@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Orbitron:wght@400;700;900&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: #0c0c1e;
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* Header стили */
header {
    background: rgba(15, 15, 35, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(100, 200, 255, 0.2);
    color: white;
    padding: 30px 20px;
    margin: 0px auto;
    border-radius: 0px 0px 20px 20px;
    position: relative;
    box-shadow: 
        0 10px 40px rgba(100, 200, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    font-family: 'Orbitron', monospace;
    text-align: center;
    margin-bottom: 15px;
    font-size: 2.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, #64c8ff 0%, #9d80ff 50%, #ff9dd8 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(100, 200, 255, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 20px rgba(100, 200, 255, 0.7));
    }
    to {
        filter: drop-shadow(0 0 35px rgba(157, 128, 255, 0.9));
    }
}

header p {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin-bottom: 25px;
    font-weight: 300;
}

.search-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.search-header input {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(100, 200, 255, 0.3);
    border-radius: 15px;
    padding: 15px 20px;
    color: white;
    font-size: 16px;
    width: 350px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-header input:focus {
    outline: none;
    border-color: #64c8ff;
    box-shadow: 0 0 25px rgba(100, 200, 255, 0.4);
    transform: scale(1.02);
}

.search-header input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-header button {
    background: linear-gradient(135deg, #ff6b9d 0%, #c471f5 50%, #12c2e9 100%);
    border: none;
    border-radius: 15px;
    padding: 15px 25px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.4);
}

.search-header button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.6);
}

.search-link {
    color: #64c8ff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid transparent;
}

.search-link:hover {
    background: rgba(100, 200, 255, 0.1);
    border-color: rgba(100, 200, 255, 0.3);
    text-shadow: 0 0 10px rgba(100, 200, 255, 0.7);
    transform: scale(1.05);
}

/* Секции */
.section {
    margin-bottom: 60px;
    animation: fadeInUp 0.8s ease-out;
    animation-fill-mode: both;
}

.section:nth-child(2) { animation-delay: 0.2s; }
.section:nth-child(3) { animation-delay: 0.4s; }
.section:nth-child(4) { animation-delay: 0.6s; }
.section:nth-child(5) { animation-delay: 0.8s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section h2 {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    margin-bottom: 30px;
    color: #ffffff;
    text-align: center;
    position: relative;
    padding: 15px 0;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, #64c8ff, #9d80ff);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(100, 200, 255, 0.5);
}

/* Сетка фильмов */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.movie-card {
    background: rgba(15, 15, 35, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(100, 200, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    height: 420px;
    display: flex;
    flex-direction: column;
}

/* Эффект градиентного свечения при наведении */
.movie-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(100, 200, 255, 0.1) 0%, rgba(157, 128, 255, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 15px;
    z-index: 1;
}

.movie-card:hover::before {
    opacity: 1;
}

.movie-card:hover {
    transform: translateY(-15px) scale(1.03);
    border-color: rgba(100, 200, 255, 0.5);
    box-shadow: 
        0 20px 50px rgba(100, 200, 255, 0.3),
        0 0 30px rgba(157, 128, 255, 0.2);
}

.movie-card img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    transition: transform 0.4s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.movie-card:hover img {
    transform: scale(1.1);
}

.movie-info {
    padding: 10px 12px;
    position: relative;
    z-index: 3; /* Повышаем z-index чтобы текст был поверх градиента */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(15, 15, 35, 0.9); /* Легкий фон для лучшей читаемости */
}

.movie-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 15px;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.2;
    min-height: 36px;
    transition: color 0.3s ease;
}

.movie-card:hover .movie-title {
    color: #64c8ff; /* Изменение цвета при наведении */
}

.movie-year {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 400;
    margin-top: 2px;
    transition: color 0.3s ease;
}

.movie-card:hover .movie-year {
    color: #9d80ff; /* Изменение цвета при наведении */
}

/* Загрузка и ошибки */
.loading {
    text-align: center;
    padding: 60px;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(15, 15, 35, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(100, 200, 255, 0.2);
    border-radius: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.error {
    color: #ff6b9d;
    text-align: center;
    padding: 30px;
    background: rgba(255, 107, 157, 0.1);
    border: 1px solid rgba(255, 107, 157, 0.3);
    border-radius: 15px;
    backdrop-filter: blur(20px);
}

/* Кнопка перезагрузки */
.reload-button {
    position: fixed;
    top: 30px;
    right: 30px;
    padding: 15px 25px;
    background: linear-gradient(135deg, #12c2e9 0%, #c471f5 100%);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    z-index: 1000;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(18, 194, 233, 0.4);
}

.reload-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(18, 194, 233, 0.6);
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        margin-top: 170px;
        padding: 0 15px;
    }
    
    header {
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 10;
    }

    h1 {
        font-size: 2.2rem;
    }
    
    .search-header {
        flex-direction: row;
        gap: 0;
    }

    header p{
        display: none;
    }

    .search-header input {
        width: 60%;
        max-width: 400px;
        border-radius: 15px 0px 0px 15px;
    }

    .search-header button {
        border-radius: 0px 15px 15px 0px;
    }

    .search-link {
        display: none;
    }

    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .section{
        margin: 0;
    }

    .section h2 {
        font-size: 1.6rem;
    }
    
    .movie-card{
        margin-left: auto;
        margin-right: auto;
        width: 270px;
    }
}

@media (max-width: 370px) {
    .search-header input {
        width: 100%;
        max-width: 400px;
        border-radius: 15px;
    }

    .search-header button {
        margin-top: 10px;
        border-radius: 15px;
    }

    .container {
        margin-top: 220px;
        padding: 0 15px;
    }

    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
}
