/* Основные стили */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --border-radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--dark-color);
    background-color: #f9fafb;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Шапка */
header {
    background-color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
    position: relative;
}

nav a:hover {
    color: var(--primary-color);
}

nav a.active {
    color: var(--primary-color);
    font-weight: 600;
}

nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

/* Основной контент */
main {
    flex: 1;
    padding: 2rem 0;
}

.page-header {
    margin-bottom: 2rem;
    text-align: center;
}

.page-header h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--secondary-color);
    font-size: 1.1rem;
}

/* Карточки */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-image {
    height: 200px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.card-content p {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--primary-hover);
    color: white;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Формы */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Страница входа */
.login-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.alert-danger {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Админ-панель */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.admin-table th {
    background-color: #f9fafb;
    font-weight: 600;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-active {
    background-color: #d1fae5;
    color: #065f46;
}

.status-inactive {
    background-color: #fee2e2;
    color: #991b1b;
}

.image-preview {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Карусель в футере */
footer {
    background-color: var(--dark-color);
    color: white;
    margin-top: auto;
}

.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-item {
    flex: 0 0 100%;
    padding: 2rem;
    text-align: center;
}

.carousel-item h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.carousel-item p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    margin: 0 5px;
    cursor: pointer;
    transition: var(--transition);
}

.carousel-dot.active {
    background-color: white;
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Адаптивность */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav ul {
        gap: 1rem;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-table {
        display: block;
        overflow-x: auto;
    }
}

/* Дополнительные стили для админ-панели */
.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-header > div {
    flex: 1;
    min-width: 300px;
}

.admin-header h2 {
    margin-bottom: 0.5rem;
}

.admin-header p {
    color: var(--secondary-color);
}

.image-preview {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-active {
    background-color: #d1fae5;
    color: #065f46;
}

.status-inactive {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Адаптивность для админ-панели */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
    }
    
    .table-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .table-actions form {
        width: 100%;
    }
    
    .table-actions button {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Стили для вкладок */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Стили для текстовых редакторов */
.rich-text-editor {
    border: 1px solid #d1d5db;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.editor-toolbar {
    padding: 0.5rem;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.editor-toolbar button {
    padding: 0.25rem 0.5rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
}

.editor-toolbar button:hover {
    background-color: #f3f4f6;
}

.editor-content {
    padding: 0.75rem;
    min-height: 200px;
    outline: none;
}

/* Адаптивность для таблиц */
@media (max-width: 1024px) {
    .admin-table {
        display: block;
        overflow-x: auto;
    }
    
    .admin-table th,
    .admin-table td {
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tabs {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tabs a {
        width: 100%;
        text-align: center;
    }
    
    .table-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .table-actions form,
    .table-actions a,
    .table-actions button {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .editor-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Стили для страницы отдельного патента */
.content-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.content-navigation > div {
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.content-navigation .btn {
    white-space: nowrap;
}

/* Стили для контента статьи/патента */
article {
    max-width: 800px;
    margin: 0 auto;
}

article h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: var(--dark-color);
}

article h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--dark-color);
}

article p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

article ul, article ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

article li {
    margin-bottom: 0.5rem;
}

article blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--secondary-color);
}

.content-article-text{
    word-wrap: break-word;
    line-height: 1.8;
    font-size: 1.1rem;
}

article img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

article table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

article table th, article table td {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

article table th {
    background-color: #f9fafb;
    font-weight: 600;
}

article code {
    background-color: #f3f4f6;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
}

article pre {
    background-color: #1f2937;
    color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 1.5rem 0;
}

article pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
}

/* Адаптивность для страницы патента */
@media (max-width: 768px) {
    .content-navigation {
        flex-direction: column;
        align-items: stretch;
    }
    
    .content-navigation > div {
        flex: none;
        min-width: auto;
    }
    
    article {
        padding: 0 1rem;
    }
    
    article h1 {
        font-size: 1.8rem;
    }
    
    article h2 {
        font-size: 1.5rem;
    }
    
    article h3 {
        font-size: 1.3rem;
    }
    
    article pre {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

.programm_photo{
    display: flex;
    align-items: center;
    margin-top: 20px;
    justify-content: center;
    gap: 20px;
    flex-direction: column;
}

.programm_photo figure{
    width: 50%;
}

.programm_photo figcaption{
    text-align: center;
    margin-top: 5px;
}

.header_base{
    text-align: center;
    background-color: #1f377d;
    color: #fff;
    padding: 10px;
    margin-bottom: 20px;
}