* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #e8d5ff, #d4b8ff, #c4b0ff);
    min-height: 100vh;
    color: #3a3a6a;
}

.navbar {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: white;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.burger {
    display: none;
    font-size: 28px;
    color: white;
    cursor: pointer;
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: calc(100vh - 140px);
}

.hero-title {
    color: #3a3a6a;
    text-align: center;
    width: 100%;
    animation: fadeInUp 0.6s ease-out;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
    padding-bottom: 18px;
    display: inline-block;
    background: linear-gradient(135deg, rgba(184, 198, 255, 0.3), rgba(212, 184, 255, 0.3));
    padding: 12px 30px 25px 30px;
    border-radius: 60px;
    backdrop-filter: blur(4px);
    margin-bottom: 20px;
}

.hero-title::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 3px;
    background: linear-gradient(90deg, #b8c6ff, #d4b8ff, #c4b0ff, #d4b8ff, #b8c6ff);
    border-radius: 3px;
}

.glass-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 30px 30px 15px 30px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.search-header {
    text-align: center;
    margin-bottom: 20px;
    color: white;
}

.search-form {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 15px 30px;
    align-items: center;
    margin-bottom: 5px;
}

.search-form label {
    font-weight: 600;
    color: white;
    justify-self: end;
}

.search-form select,
.search-form input {
    padding: 12px 15px;
    border-radius: 10px;
    border: none;
    font-size: 16px;
    width: 100%;
}

.search-form select {
    appearance: menulist;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    background: white;
    cursor: pointer;
    position: relative;
    background-image: none;
}

.button-group {
    grid-column: 2;
    display: flex;
    gap: 15px;
}

.button-group .btn {
    flex: 1;
    text-align: center;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    display: inline-block;
    text-align: center;
}

.btn-search {
    background: linear-gradient(135deg, #b8c6ff, #6a82fb);
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(106, 130, 251, 0.4);
    background: linear-gradient(135deg, #6a82fb, #b8c6ff);
}

.btn-random {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.btn-random:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2, #667eea);
}

.btn-primary {
    background: linear-gradient(135deg, #b8c6ff, #d4b8ff);
    color: #4a4a8a;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(180, 198, 255, 0.4);
    background: linear-gradient(135deg, #d4b8ff, #b8c6ff);
    color: #3a3a6a;
}

.btn-warning {
    background: linear-gradient(135deg, #c4b0ff, #b8c6ff);
    color: #4a4a8a;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(180, 198, 255, 0.4);
    background: linear-gradient(135deg, #b8c6ff, #c4b0ff);
    color: #3a3a6a;
}

.btn-danger {
    background: linear-gradient(135deg, #e0d4ff, #d4c8ff);
    color: #6a6a8a;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(180, 198, 255, 0.3);
    background: linear-gradient(135deg, #d4c8ff, #e0d4ff);
    color: #5a5a7a;
}

.admin-link {
    background: linear-gradient(135deg, #f6d365, #fda085);
    color: white;
}

.admin-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(253, 160, 133, 0.4);
    background: linear-gradient(135deg, #fda085, #f6d365);
}

.logout-link {
    background: linear-gradient(135deg, #b8c6ff, #6a82fb);
    color: white;
}

.logout-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(106, 130, 251, 0.4);
    background: linear-gradient(135deg, #6a82fb, #b8c6ff);
}

.login-link {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
}

.login-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(33, 150, 243, 0.4);
}

.movie-count {
    background: linear-gradient(135deg, #b8c6ff, #d4b8ff);
    color: #4a4a8a;
    display: inline-block;
    padding: 10px 25px;
    border-radius: 40px;
    font-size: 22px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin-bottom: 25px;
    text-align: center;
}

.results-wrapper {
    text-align: center;
}

.results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.movie-card {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.2);
}

.poster-container {
    position: relative;
    overflow: hidden;
    height: 250px;
    flex-shrink: 0;
}

.movie-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.movie-card:hover img {
    transform: scale(1.05);
}

.movie-rating-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #ffd700;
    z-index: 2;
}

.movie-info {
    padding: 18px;
    background: white;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.movie-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 8px;
}

.movie-title-link {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    text-decoration: none;
    color: #3a3a6a;
    transition: color 0.3s ease;
}

.movie-title-link:hover {
    color: #b8c6ff !important;
    text-decoration: underline !important;
}

.movie-title .age-rating {
    flex-shrink: 0;
}

.movie-year {
    color: #888;
    font-size: 13px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.movie-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}

.genre-tag {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: 500;
}

.movie-duration {
    color: #666;
    font-size: 12px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.movie-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 15px;
}

.movie-actions .btn {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
}

.age-rating {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.age-0 { background: #28a745; color: white; }
.age-6 { background: #17a2b8; color: white; }
.age-12 { background: #ffc107; color: #333; }
.age-16 { background: #fd7e14; color: white; }
.age-18 { background: #dc3545; color: white; }

/* Адаптив */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        margin-top: 15px;
    }
    .nav-links.active {
        display: flex;
    }
    .burger {
        display: block;
    }
    .search-form {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .search-form label {
        justify-self: start;
    }
    .button-group {
        grid-column: 1;
        flex-direction: column;
    }
    .hero-title {
        font-size: 2rem;
    }
    .search-form select {
        font-size: 16px;
    }
}

.form-container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
}

.error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

.success {
    color: #28a745;
    font-size: 14px;
    margin-top: 5px;
}

.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 36px;
    font-weight: 800;
    color: #3a3a6a;
}

.movie-detail {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
}

.movie-detail-img {
    flex: 1;
    min-width: 300px;
}

.movie-detail-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.movie-detail-info {
    flex: 2;
    padding: 30px;
}

.footer {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

/* БЕГУЩАЯ СТРОКА */
.ticker-container {
    background: linear-gradient(135deg, #f5f0ff, #e8e0ff);
    border-radius: 50px;
    margin-top: 5px;
    margin-bottom: 0;
    overflow: hidden;
    border: 1px dashed #b8c6ff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ticker {
    overflow: hidden;
    white-space: nowrap;
    padding: 8px 0;
}

.ticker-text {
    display: inline-block;
    animation: tickerScroll 20s linear infinite;
    font-size: 14px;
    font-weight: 600;
    color: #764ba2;
    letter-spacing: 1px;
}

@keyframes tickerScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}