/* ============================================
   ОСНОВНЫЕ СТИЛИ И СБРОС
============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* ============================================
   ШАПКА САЙТА
============================================ */
.site-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: cover;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.header-content h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header-content h1 i {
    margin-right: 15px;
    color: #ffd700;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-top: 5px;
}

/* ============================================
   ОСНОВНАЯ СТРУКТУРА ЛЕЙАУТА
============================================ */
.layout {
    display: flex;
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
    gap: 30px;
}

/* ============================================
   БОКОВОЕ МЕНЮ
============================================ */
.sidebar {
    width: 280px;
    min-width: 280px;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    position: sticky;
    top: 30px;
    height: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.sidebar h2 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #3498db;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu {
    list-style: none;
    margin-bottom: 30px;
}

.menu li {
    margin-bottom: 12px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.menu-link:hover {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.menu-current {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border-radius: 10px;
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

.db-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid #9b59b6;
    margin-top: 30px;
}

.db-info h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.db-info p {
    margin: 8px 0;
    color: #34495e;
    font-size: 0.95rem;
}

.db-info strong {
    color: #2c3e50;
}

/* ============================================
   ОСНОВНОЙ КОНТЕНТ
============================================ */
.content {
    flex: 1;
    min-width: 0;
}

/* ============================================
   ПОДВАЛ
============================================ */
.site-footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 30px 0;
    margin-top: 50px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content p {
    margin: 10px 0;
    opacity: 0.9;
}

.footer-content i {
    margin-right: 10px;
    color: #3498db;
}

/* ============================================
   ОБЩИЕ КОМПОНЕНТЫ
============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f6b9d 100%);
    border-color: #1f6b9d;
}

.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
    border-color: #1e8449;
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    border-color: #d35400;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    border-color: #a93226;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
    border-color: #117a8b;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
}

/* ============================================
   УВЕДОМЛЕНИЯ И СООБЩЕНИЯ
============================================ */
.success-box, .error-box {
    padding: 20px 25px;
    border-radius: 12px;
    margin: 25px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideIn 0.5s ease;
    border-left: 5px solid;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-box {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1) 0%, rgba(46, 204, 113, 0.1) 100%);
    color: #27ae60;
    border-left-color: #27ae60;
}

.error-box {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(192, 57, 43, 0.1) 100%);
    color: #e74c3c;
    border-left-color: #e74c3c;
}

.success-box i, .error-box i {
    font-size: 1.5rem;
}

/* ============================================
   ФОРМЫ
============================================ */
.form-control {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.form-control:hover {
    border-color: #bdc3c7;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group {
    margin-bottom: 25px;
}

.form-row {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.form-col {
    flex: 1;
    min-width: 0;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.form-text {
    display: block;
    margin-top: 8px;
    color: #7f8c8d;
    font-size: 0.9rem;
    font-style: italic;
}

.form-note {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(41, 128, 185, 0.1) 100%);
    border-radius: 10px;
    border-left: 5px solid #3498db;
    color: #2c3e50;
}

.form-note p {
    margin: 8px 0;
}

/* ============================================
   КАРТОЧКИ И СЕТКИ
============================================ */
.films-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.film-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.film-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.film-header {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.film-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.film-card:hover .film-poster {
    transform: scale(1.1);
}

.film-poster-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #95a5a6;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.film-poster-placeholder i {
    margin-bottom: 15px;
    font-size: 2.5rem;
}

.film-body {
    padding: 25px;
}

.film-title {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
}

.film-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 1rem;
}

.film-meta {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.meta-item i {
    color: #3498db;
}

.film-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================
   ТАБЛИЦЫ
============================================ */
.table-responsive {
    overflow-x: auto;
    margin: 30px 0;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.data-table th {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    font-size: 1rem;
}

.data-table td {
    padding: 20px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    font-size: 1rem;
}

.data-table tr {
    transition: all 0.2s ease;
}

.data-table tr:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(41, 128, 185, 0.1) 100%);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* ============================================
   СПЕЦИАЛЬНЫЕ КОМПОНЕНТЫ
============================================ */
.page-header {
    margin-bottom: 40px;
    padding-bottom: 25px;
    border-bottom: 3px solid #3498db;
    position: relative;
}

.page-header h1 {
    color: #2c3e50;
    font-size: 2.2rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-header h1 i {
    color: #9b59b6;
}

.page-header .subtitle {
    color: #7f8c8d;
    font-size: 1.2rem;
    margin-top: 5px;
    font-weight: 500;
}

.actions-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.empty-state, .empty-table {
    text-align: center;
    padding: 80px 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border: 3px dashed #3498db;
    margin: 40px 0;
}

.empty-state i, .empty-table i {
    color: #3498db;
    margin-bottom: 25px;
    font-size: 4rem;
    opacity: 0.7;
}

.empty-state h2, .empty-table h3 {
    color: #2c3e50;
    margin: 20px 0;
    font-size: 1.8rem;
}

.empty-state p, .empty-table p {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.stats-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px;
    border-radius: 15px;
    margin-top: 40px;
    border-left: 5px solid #9b59b6;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.stats-box h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stats-box p {
    margin: 12px 0;
    font-size: 1.1rem;
    color: #34495e;
}

.stats-box strong {
    color: #27ae60;
    font-size: 1.3rem;
}

.image-preview {
    margin-top: 20px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 3px dashed #ddd;
    text-align: center;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.image-preview img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* ============================================
   ДЕТАЛЬНАЯ СТРАНИЦА ФИЛЬМА
============================================ */
.film-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.film-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.film-poster-large {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
    transition: transform 0.3s ease;
}

.film-poster-large:hover {
    transform: scale(1.02);
}

.info-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.info-section h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.info-content {
    line-height: 1.8;
    color: #333;
    font-size: 1.1rem;
    text-align: justify;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.meta-item {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(41, 128, 185, 0.1) 100%);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #27ae60;
}

.meta-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.meta-value {
    display: block;
    color: #555;
    word-break: break-word;
    font-size: 1rem;
}

/* ============================================
   ОТЗЫВЧИВОСТЬ
============================================ */
@media (max-width: 1200px) {
    .layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: static;
    }
    
    .film-content {
        grid-template-columns: 1fr;
    }
    
    .film-poster-large {
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .header-content h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .films-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 14px;
    }
    
    .data-table th,
    .data-table td {
        padding: 15px 10px;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .form-actions,
    .action-buttons {
        flex-direction: column;
    }
    
    .film-actions {
        flex-direction: column;
    }
    
    .meta-grid {
        grid-template-columns: 1fr;
    }
    
    .film-meta {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .site-header {
        padding: 20px 0;
    }
    
    .header-content h1 {
        font-size: 1.6rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .content {
        padding: 15px;
    }
    
    .sidebar {
        padding: 20px;
    }
}

/* ============================================
   АНИМАЦИИ И ЭФФЕКТЫ
============================================ */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
    }
}

.btn-success:hover {
    animation: pulse 1.5s infinite;
}

.film-card:nth-child(odd):hover {
    border-color: #3498db;
}

.film-card:nth-child(even):hover {
    border-color: #9b59b6;
}

/* ============================================
   КАСТОМНЫЕ ПОЛОСЫ ПРОКРУТКИ
============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-radius: 10px;
    border: 2px solid #f5f7fa;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f6b9d 100%);
}

/* ============================================
   СПЕЦИАЛЬНЫЕ ЭФФЕКТЫ
============================================ */
::selection {
    background: rgba(52, 152, 219, 0.3);
    color: #2c3e50;
}

img {
    max-width: 100%;
    height: auto;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(52, 152, 219, 0.3);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   УТИЛИТЫ
============================================ */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-20 {
    padding: 20px;
}

.shadow {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.rounded {
    border-radius: 10px;
}

.hidden {
    display: none;
}

.auth-status {
    border-left: 5px solid #3498db;
}

.auth-status h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-status ul {
    margin: 15px 0;
    padding-left: 20px;
}

.auth-status li {
    margin: 5px 0;
    color: #34495e;
}

/* Сообщения об успешных операциях */
.message-box {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1) 0%, rgba(46, 204, 113, 0.1) 100%);
    border-left: 5px solid #27ae60;
    color: #27ae60;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Кнопки авторизации */
.btn-login {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
}

.btn-logout {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-login:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
}

.btn-logout:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

/* Иконка пользователя в шапке */
.site-header .subtitle a {
    text-decoration: none;
    color: white;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.site-header .subtitle a:hover {
    opacity: 1;
    text-decoration: underline;
}