/* ========================================
   ОСНОВНЫЕ ПЕРЕМЕННЫЕ
   ======================================== */
:root {
    --primary-dark: #1a1a2e;
    --secondary-dark: #16213e;
    --accent-dark: #0f3460;
    --light-text: #ffffff;
    --dark-text: #2c3e50;
    --gradient-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --gradient-secondary: linear-gradient(135deg, #16213e 0%, #1a1a2e 100%);
}

/* ========================================
   ОСНОВНЫЕ СТИЛИ СТРАНИЦЫ
   ======================================== */
.page-wrapper {
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Две колонки */
.page-with-sidebar {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

/* Основной контент */
.page-main-content {
    flex: 1;
    min-width: 0;
}

/* Сайдбар */
.page-sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* ========================================
   КАРТОЧКА СТРАНИЦЫ
   ======================================== */
.page-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-card:hover {
    box-shadow: 0 30px 60px rgba(26, 26, 46, 0.15);
}

.page-header {
    background: var(--gradient-primary);
    padding: 2rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(45deg);
}

.page-title {
    color: var(--light-text);
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* ========================================
   ТЕЛО СТРАНИЦЫ
   ======================================== */
.page-body {
    padding: 2rem;
}

.page-body p {
    display: block !important;
    margin-bottom: 1rem !important;
    margin-top: 0 !important;
    line-height: 1.6 !important;
}

.page-body ul, .page-body ol {
    display: block !important;
    margin: 1rem 0 1rem 1rem !important;
    padding-left: 1.5rem !important;
}

.page-body ul li, .page-body ol li {
    display: list-item !important;
    margin-bottom: 0.3rem !important;
    line-height: 1.6 !important;
}

.page-body ul ul { list-style-type: circle !important; }
.page-body ul ul ul { list-style-type: square !important; }
.page-body ol ol { list-style-type: lower-alpha !important; }
.page-body ol ol ol { list-style-type: lower-roman !important; }

.page-body h1 { font-size: 2rem; margin: 1.5rem 0 0.75rem; color: var(--primary-dark); }
.page-body h2 { font-size: 1.7rem; margin: 1.3rem 0 0.7rem; color: var(--primary-dark); }
.page-body h3 { font-size: 1.4rem; margin: 1rem 0 0.5rem; color: var(--secondary-dark); }
.page-body h4 { font-size: 1.2rem; margin: 0.8rem 0 0.4rem; }
.page-body h5, .page-body h6 { font-size: 1.1rem; margin: 0.6rem 0 0.3rem; }

.page-body blockquote {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid var(--primary-dark);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 10px;
    font-style: italic;
}

.page-body table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
}

.page-body table th, .page-body table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
}

.page-body table th {
    background: var(--gradient-primary);
    color: white;
}

.page-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.page-body a {
    color: #354d78;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.page-body a:hover {
    color: #7ba0e0;
    border-bottom-color: var(--primary-dark);
}

.page-body hr {
    margin: 1.5rem 0;
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-dark), var(--secondary-dark), transparent);
}

/* ========================================
   СЧЁТЧИК ПРОСМОТРОВ
   ======================================== */
.page-eye {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 2rem 2rem 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 1rem;
}

.stat-gradient {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.2rem;
    background: var(--gradient-primary);
    border-radius: 40px;
    color: white !important;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(26, 26, 46, 0.3);
    transition: all 0.3s ease;
    cursor: default;
}

.stat-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(26, 26, 46, 0.4);
}

.stat-gradient i {
    font-size: 1rem;
    animation: eyeBlink 3s ease infinite;
}

.stat-number {
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0 0.1rem;
    color: white !important;
}

@keyframes eyeBlink {
    0%, 100% { transform: scale(1); opacity: 1; }
    95% { transform: scale(1); opacity: 1; }
    97% { transform: scale(0.8); opacity: 0.5; }
    98% { transform: scale(1); opacity: 1; }
}

/* ========================================
   АДМИН ПАНЕЛЬ
   ======================================== */
.page-admin-panel {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
}

.admin-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.85rem;
}

.admin-btn-primary { background: var(--gradient-primary); color: white; }
.admin-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(26, 26, 46, 0.4); color: white; }
.admin-btn-secondary { background: #6c757d; color: white; }
.admin-btn-secondary:hover { background: #5a6268; transform: translateY(-2px); color: white; }
.admin-btn-info { background: #17a2b8; color: white; }
.admin-btn-dark { background: #343a40; color: white; }

/* ========================================
   БЛОК "СМОТРИТЕ ТАКЖЕ"
   ======================================== */
.recommended-section {
    margin: 1.5rem 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.recommended-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #667eea;
    display: inline-block;
}

.recommended-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.recommended-card {
    flex: 1;
    min-width: 160px;
    max-width: 200px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.recommended-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.recommended-image {
    width: 100%;
    height: 90px;
    object-fit: cover;
}

.recommended-no-image {
    width: 100%;
    height: 90px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
}

.recommended-content {
    padding: 0.6rem;
}

.recommended-card-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0.2rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommended-excerpt {
    font-size: 0.65rem;
    color: #6c757d;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.2rem;
}



@media (max-width: 768px) {
    .page-wrapper {
        padding: 1rem 0;
    }
    
    .page-header {
        padding: 1.5rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .page-body {
        padding: 1rem;
    }
    
    .recommended-section {
        margin: 1rem;
    }
    
    .recommended-grid {
        flex-direction: column;
    }
    
    .recommended-card {
        max-width: 100%;
    }
    
    .page-eye {
        padding: 0.75rem 1rem 1rem 1rem;
    }
    
    .stat-gradient {
        padding: 0.35rem 1rem;
        font-size: 0.75rem;
    }
    
    .stat-number {
        font-size: 0.9rem;
    }
    
    .admin-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .admin-btn {
        justify-content: center;
    }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-card {
    animation: fadeInUp 0.6s ease-out;
}