/* Базовые стили */
:root {
  --primary: #fffeeb;
  --header-top:#fb9a0f;
  --secondary: #fffeeb;
  --light: #f8f9fa;
  --dark: #343a40;
  --white: #ffffff;
  --success: #28a745;
  --warning: #ffc107;
  --substrate:#f5e6c8 /*ffd5a5*/;
  --text-writer: rgba(0,0,0,0.70);
  --text-primary:rgba(0,0,0,0.54);
  --text-secondary:rgba(0,0,0,0.32);
  --text-link:#e68a68;
  --text-link-hover:#a96565;
  --btn-common:#d9a441;
  --btn-common-hover:#e8b758;
  --comment-section:#fff4db/*efbe7a*/;
  --btn-header:#fffeeb;
  --btn-header-hover:#fb9a0f;
  --tag: #fb9a0f;
  --tag-hover:#d9a441;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html{
  height: 100%;
  margin: 0;
}
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-primary);
  line-height: 1.7;
  background-color: var(--primary);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}


.main-container {
  flex: 1; /* Позволяет главному контейнеру занимать все доступное пространство */
  display: flex;
  flex-direction: column; /* Устанавливаем вертикальное расположение */
}

/* Шапка */
.header {
  background: var(--header-top);
  box-shadow: 0 3px 15px rgba(0,0,0,0.1);
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 2%;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.logo {
  font-size: 1.2rem;
  color: var(--primary);
  font-weight: 700;
}

.search-login {
  display: flex;
  align-items: center;
  gap: 15px;
  
}

.search-input {
  padding: 8px 15px;
  border: 1px solid var(--primary);
  border-radius: 20px;
  min-width: 200px;
  background-color: var(--primary);
}

.login-btn {
  padding: 4px 10px;
  background: var(--btn-header);
  color: var(--header-top);
  text-decoration: none;
  border-radius: 10px;
  /*transition: all 0.3s;*/
}

.login-btn:hover {
  background: var(--btn-header-hover);
  transform: translateY(-2px);
  color: var(--substrate);
  padding: 3px 9px;
  border: 1px solid var(--substrate);
}

.topics {
  display: flex;
  gap: 25px;
  padding: 8px 2%;
  border-top: 1px solid var(--substrate);
  background: var(--header-top);
  overflow-x: auto;
}

.topics a {
  color: var(--substrate);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  padding: 5px 0;
  position: relative;
}

.topics a:hover {
  color: var(--primary);
}

/* Основной контент */
.content-wrapper {
  height: 100%;
  display: flex;
  width: 100%;
  padding: 0 2%;
  margin: 30px 0;
  min-height: 100%;
  flex:1;
}

.main-content {
  flex: 0 0 75%;
  padding-right: 30px;
}

.sidebar {
  flex: 0 0 25%;
}

/* Комментарии */
.comments-section {
  background: var(--substrate);
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.comments-section h2 {
  margin-bottom: 25px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--light);
}

.comment-form {
  background: var(--comment-section);
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 30px;
}

.comment-form textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 15px;
  min-height: 150px;
  font-family: inherit;
  resize: vertical;
  background-color: var(--primary);
}

.comment-form button {
  background: var(--btn-common);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s;
}

.comment-form button:hover {
  background: var(--btn-common-hover);
  transform: translateY(-2px);
}

.comment {
  background: var(--comment-section);
  padding: 25px;
  margin-bottom: 20px;
  border-radius: 8px;
  position: relative;
}

.comment:last-child {
  margin-bottom: 0;
}

.comment-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.comment-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 15px;
  object-fit: cover;
}

.comment-author {
  flex: 1;
}

.comment-author strong {
  display: block;
  margin-bottom: 3px;
}

.comment-date {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.comment-text {
  margin-bottom: 15px;
}

.reply-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 5px 0;
}

/* Рекомендуемые статьи */
.featured-articles {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
}

.featured-card {
  flex: 1;
  background: var(--substrate);
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  transition: all 0.3s;
}

.featured-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.featured-card h3 {
  margin-bottom: 10px;
  color: var(--text-primary);
}

.featured-card p {
  color: var(--text-primary);
  margin-bottom: 15px;
  font-size: 0.95rem;
}
/* Полная статья */
.full-article {
  background: var(--substrate);
  padding: 40px;
  margin-bottom: 40px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.full-article h1 {
  font-size: 2.2rem;
  margin-bottom: 15px;
  line-height: 1.3;
  color: var(--text-primary);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
  color: var(--text-primary);
  font-size: 0.95rem;
}

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

.article-content p {
  margin-bottom: 20px;
}

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

/* Карточки статей */
.article-card {
  background: var(--substrate);
  padding: 30px;
  margin-bottom: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.article-card h2 {
  color: var(--text-primary);
  margin-bottom: 10px;
  font-size: 1.5rem;
}

.meta {
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 15px;
  display: flex;
  gap: 15px;
}

.excerpt {
  margin-bottom: 20px;
  color: #555;
}

.read-more {
  color: var(--text-link);
  text-decoration: none;
  font-weight: 500;
  display: inline-block;
  transition: all 0.3s;
}

.read-more:hover {
  color: var(--text-link-hover);
  transform: translateX(5px);
}

.link {
  color: var(--text-link);
  text-decoration: none;
  font-weight: 500;
  display: inline-block;
  transition: all 0.3s;
}

.link:hover {
  color: var(--text-link-hover);
  transform: translateX(5px);
}

/* Пагинация */
.pagination {
  display: flex;
  justify-content: center;
  margin: 50px 0 30px;
}

.pagination a {
  margin: 0 5px;
  padding: 8px 16px;
  text-decoration: none;
  color: var(--text-primary);
  border: 1px solid #ddd;
  border-radius: 5px;
  transition: all 0.3s;
}

.pagination a:hover {
  background-color:var(--btn-common);
}

.pagination .active {
  background-color: var(--header-top);
  color: white;
  border-color: var(--primary);
}

/* Боковая панель */
.sidebar-block {
  background: var(--substrate);
  padding: 25px;
  margin-bottom: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.sidebar-block h3 {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--light);
  color: var(--text-primary);
}

.sidebar-block ul {
  list-style: none;
}

.sidebar-block li {
  margin-bottom: 12px;
}

.sidebar-block a {
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s;
  display: block;
  padding: 5px 0;
}

.sidebar-block a:hover {
  color: var(--primary);
  transform: translateX(5px);
}

/* Адаптивность */
@media (max-width: 992px) {

  
  .form-title {
    font-size: 1.5rem;
  }

   
  .header-top {
    flex-direction: column;
    gap: 15px;
  }
  
  .search-login {
    width: 100%;
    justify-content: center;
  }
}

/* Футер */
.footer {
  background: var(--dark);
  color: white;
  padding: 10px 0;
  font-size: 0.8rem;
  width: 100%;
  text-align: center;
  margin-top: auto; /* Прижимаем к низу */
  position: relative;
  bottom: 0;
}
.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-content p {
  margin: 4px 0;
  line-height: 1.2;
}

.footer a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
  padding: 2px 0;
  display: inline-block;
}

.footer a:hover {
  text-decoration: underline;
  color: #5dade2;
}

/* Основной контент */

.article-form-container {
  background: var(--substrate);
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  width: 95%;
  margin-bottom: 40px; /* Отступ перед футером */
}

.form-title {
  font-size: 1.8rem;
  margin-bottom: 30px;
  color: var(--text-secondary);
}

.form-group {
  margin-bottom: 25px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-secondary);
}

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

.form-control:focus {
  border-color: var(--primary);
  outline: none;
}

.form-select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  background-color: var(--secondary);
  cursor: pointer;
  color: var(--text-writer)
}

.textarea-editor {
  min-height: 400px;
  resize: vertical;
  width: 100%;
  padding: 15px;
  border: 1px solid #ddd;
  background-color: var(--secondary);
  border-radius: 6px;
  color: var(--text-writer)
}

/* Drag and Drop область */
.drop-area {
  border: 2px dashed #ccc;
  border-radius: 6px;
  padding: 30px;
  text-align: center;
  margin: 20px 0;
  transition: all 0.3s;
  position: relative;
}

.drop-area.highlight {
  border-color: var(--primary);
  background-color: rgba(0, 123, 255, 0.05);
}

.drop-area p {
  margin-bottom: 15px;
  color: var(--secondary);
}

.drop-icon {
  font-size: 2.5rem;
  color: var(--secondary);
  margin-bottom: 15px;
}

.file-input {
  display: none;
}

.btn {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--btn-common-hover);
  transform: translateY(-2px);
}

.btn-success {
  background-color: var(--success);
  color: white;
}

.btn-success:hover {
  background-color: #218838;
  transform: translateY(-2px);
}

.btn-warning {
  background-color: var(--warning);
  color: var(--white);
}

.btn-warning:hover {
  background-color: #e0a800;
  transform: translateY(-2px);
}



/* Прелоадер для загрузки файлов */
.upload-progress {
  display: none;
  margin-top: 15px;
}

.progress-bar {
  height: 6px;
  background-color: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
}

.progress {
  height: 100%;
  background-color: var(--primary);
  width: 0%;
  transition: width 0.3s;
}

/* Список загруженных файлов */
.uploaded-files {
  margin-top: 20px;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 10px;
  background-color: var(--light);
  border-radius: 4px;
  margin-bottom: 8px;
}

.file-icon {
  margin-right: 10px;
  color: var(--secondary);
}

.file-name {
  flex: 1;
  word-break: break-all;
}

.file-insert {
  color: var(--primary);
  cursor: pointer;
  margin-left: 10px;
  font-size: 0.9rem;
}

/* Специфичные стили для страницы добавления статьи */
.add-article-page {
  padding-bottom: 60px; /* Добавляем место для контента */
}


.form-actions {
  display: flex;
  justify-content: space-between; /* Распределение по краям */
  align-items: center;
  margin-top: 30px;
  padding: 15px 0;
  border-top: 1px solid #eee;
}

.auth-container {
  max-width: 400px;
  margin: 5rem auto;
  padding: 2rem;
  background: var(--substrate);
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.callback-container {
    width:25%;
    margin: 5rem auto;
    padding: 2rem;
    background: var(--substrate);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.auth-container h1 {
    text-align: center;
    color: var(--text-primary);
}


.form-group {
  margin-bottom: 1.5rem;
  
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  background-color: var(--primary);
  color:var(--text-primary)
}
.form-group button {
  background: var(--btn-common);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s;
  width: 100%;
}

.form-group button:hover {
  background: var(--btn-common-hover);
  transform: translateY(-2px);
  width: 100%;
}


/* Базовые стили */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-button {
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

/* Стили выпадающего меню */
.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: var(--substrate);
  min-width: 120px;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
  z-index: 1;
  border-radius: 4px;
}

.dropdown-content a {
  color: var(--header-top);
  padding: 8px 12px;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {
  background-color: #f1f1f1;
}

/* Класс для отображения меню */
.show {
  display: block;
}

.tags-container {
  margin: 10px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Стили для отдельных тегов */
.tag {
  background-color:var(--tag); /* Нежно-оливковый цвет */
  color: var(--substrate);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 14px;
  display: inline-block;
}

.tag:hover {
  background-color: var(--tag-hover);
  transform: translateY(-1px);
  cursor: pointer;
}


.icon-link {
  display: inline-block;
  width: 24px; /* Размер ваших иконок */
  height: 24px;
  position: relative;
  cursor: pointer;
}

.icon-link .hover {
  display: none;
}

/* При наведении показываем hover и скрываем normal */
.icon-link:hover .normal {
  display: none;
}
.icon-link:hover .hover {
  display: block;
}

/* Фиксируем размер изображений */
.icon-link img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}