/* Основные стили */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

header {
    background-color: #343a40;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
}

nav a {
    color: #e9ecef;
    text-decoration: none;
    margin-left: 20px;
    font-size: 1.1rem;
}

nav a:hover {
    color: white;
    text-decoration: underline;
}

main {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Карточки страниц */
.page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.page-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.page-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.page-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.placeholder-image {
    width: 100%;
    height: 180px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 3.5rem;
}

.page-card h4 {
    padding: 18px;
    margin: 0;
    font-size: 1.2rem;
    text-align: center;
    color: #343a40;
    border-top: 1px solid #eee;
}

/* Страница контента */
.page-content h1 {
    color: #343a40;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.page-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 8px;
}

/* Формы */
.form-group {
    margin-bottom: 25px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

textarea.form-control {
    min-height: 300px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}

.btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #0069d9;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #bd2130;
}

/* Медиабиблиотека */
.upload-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.media-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.media-preview {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.file-icon {
    width: 100%;
    height: 180px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    padding: 20px;
    text-align: center;
}

.file-name {
    margin-top: 15px;
    font-size: 0.9rem;
    word-break: break-all;
}

.media-info {
    padding: 20px;
    flex-grow: 1;
}

.filename {
    font-weight: bold;
    margin-bottom: 5px;
    word-break: break-all;
}

.uploaded-at {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 15px;
}

.media-url {
    display: flex;
    margin-bottom: 15px;
}

.media-url input {
    flex-grow: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px 0 0 4px;
    font-size: 0.9rem;
}

.copy-btn {
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-left: none;
    border-radius: 0 4px 4px 0;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: #dae0e5;
}

.media-item form {
    padding: 0 20px 20px;
}

/* Сообщения */
.alert {
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 6px;
    border: 1px solid transparent;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

/* Добавим стили для таблицы управления страницами */
.pages-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.pages-table th, .pages-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.pages-table th {
    background-color: #343a40;
    color: white;
}

.pages-table tr:last-child td {
    border-bottom: none;
}

.pages-table tr:hover {
    background-color: #f8f9fa;
}

.actions {
    display: flex;
    gap: 10px;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.admin-actions {
    margin-bottom: 20px;
}

/* Добавим стили для описания страниц */
.page-info {
    padding: 15px;
}

.page-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 8px;
    line-height: 1.4;
}

/* Улучшим отображение форм */
.form-group small.form-text {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 0.85rem;
}

/* Иконки */
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css");