/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9eef5 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Шапка */
header {
    background: linear-gradient(135deg, #2c3e50 0%, #1a2634 100%);
    padding: 20px 30px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.user-info {
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 15px;
    border-radius: 40px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.user-info a {
    color: #ffd966;
    text-decoration: none;
    font-weight: 500;
}

.user-info a:hover {
    text-decoration: underline;
}

.auth-links a, .btn {
    background: #ffd966;
    color: #2c3e50;
    padding: 8px 18px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-block;
    margin-left: 10px;
}

.auth-links a:hover, .btn:hover {
    background: #ffc107;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Фильтры */
.filters {
    padding: 25px 30px;
    background: #f8f9fc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.filters input, .filters select, .filters button {
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #cbd5e0;
    font-size: 0.95rem;
    background: white;
    transition: 0.2s;
}

.filters input:focus, .filters select:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.filters button {
    background: #2c3e50;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.filters button:hover {
    background: #1a2634;
    transform: translateY(-1px);
}

/* Список публикаций */
.publications {
    padding: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.publication {
    background: white;
    border-radius: 16px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    overflow: hidden;
    border: 1px solid #eef2f6;
}

.publication:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.publication h3 {
    background: #f8f9fc;
    padding: 18px 20px;
    margin: 0;
    font-size: 1.3rem;
    border-bottom: 2px solid #e9ecef;
    color: #2c3e50;
}

.publication p {
    padding: 8px 20px;
    margin: 0;
    color: #4a5568;
    line-height: 1.5;
}

.publication p strong {
    color: #2c3e50;
    font-weight: 600;
}

.download-link {
    display: inline-block;
    margin: 15px 20px 20px;
    background: #2c3e50;
    color: white;
    padding: 10px 20px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
}

.download-link:hover {
    background: #1a2634;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Кнопка "Управление изданиями" на главной */
.btn {
    background: #ffd966;
    color: #2c3e50;
    margin-left: 15px;
}

/* Таблица управления (manage.php) */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

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

th {
    background: #f1f5f9;
    font-weight: 600;
    color: #2c3e50;
}

tr:hover {
    background: #f8fafc;
}

/* Формы добавления/редактирования */
form {
    background: #f8f9fc;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

form label {
    display: block;
    margin: 15px 0 5px;
    font-weight: 600;
    color: #2c3e50;
}

form input, form select, form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 0.95rem;
}

form button {
    margin-top: 20px;
    background: #2c3e50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

form button:hover {
    background: #1a2634;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        border-radius: 12px;
    }
    header {
        flex-direction: column;
        text-align: center;
    }
    .filters {
        flex-direction: column;
    }
    .filters input, .filters select, .filters button {
        width: 100%;
    }
    .publications {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    table {
        font-size: 0.85rem;
    }
    th, td {
        padding: 8px 10px;
    }
}

/* Стили для страницы входа */
.role-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.role-buttons button {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}
.role-buttons button:hover {
    background: #1a2634;
    transform: translateY(-2px);
}

/* Пагинация */
.pagination {
    padding: 20px 30px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    background: #f8f9fc;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    border-radius: 6px;
    text-decoration: none;
    transition: 0.2s;
}
.pagination a {
    background: white;
    border: 1px solid #cbd5e0;
    color: #2c3e50;
}
.pagination a:hover {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}
.pagination .page-current {
    background: #2c3e50;
    color: white;
    border: 1px solid #2c3e50;
}

/* Стили для страницы управления */
.manage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: #f8f9fc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 15px;
}
.manage-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: #2c3e50;
}
.manage-actions {
    display: flex;
    gap: 15px;
}
.btn-primary, .btn-outline {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
}
.btn-primary {
    background: #2c3e50;
    color: white;
    border: none;
}
.btn-primary:hover {
    background: #1a2634;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.btn-outline {
    background: transparent;
    border: 1px solid #2c3e50;
    color: #2c3e50;
}
.btn-outline:hover {
    background: #2c3e50;
    color: white;
}
.table-wrapper {
    padding: 20px 30px;
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eef2f6;
}
th {
    background: #f1f5f9;
    font-weight: 600;
    color: #2c3e50;
}
tr:hover {
    background: #f8fafc;
}
.actions a {
    display: inline-block;
    margin-right: 12px;
    text-decoration: none;
    font-weight: 500;
}
.btn-edit {
    color: #2c3e50;
    background: #e2e8f0;
    padding: 4px 12px;
    border-radius: 20px;
}
.btn-edit:hover {
    background: #cbd5e0;
}
.btn-delete {
    color: #e53e3e;
}
.btn-delete:hover {
    text-decoration: underline;
}
.form-card {
    margin: 20px 30px;
    background: #f8f9fc;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.form-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.4rem;
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 1rem;
}
.form-group input[type="file"] {
    padding: 5px;
}
.file-info {
    margin-top: 5px;
    font-size: 0.9rem;
}
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}
@media (max-width: 768px) {
    .manage-header {
        flex-direction: column;
        text-align: center;
    }
    .manage-actions {
        width: 100%;
        justify-content: center;
    }
    .form-card {
        margin: 15px;
    }
}

/* Уведомления */
.alert {
    padding: 15px 20px;
    margin: 20px 30px;
    border-radius: 8px;
    font-weight: 500;
}
.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}
.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}
