body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 20px;
  background-color: #f5f5f5;
}

.article-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* Две колонки */
  gap: 20px;
  max-width: 1000px;
  margin: auto;
}

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

.article:hover {
  transform: translateY(-5px);
}

.article img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 5px solid #4CAF50;
}

.article h2 {
  font-size: 18px;
  margin: 15px;
  color: #333;
}

.article p {
  font-size: 14px;
  margin: 0 15px 15px;
  color: #666;
}

.pagination {
  text-align: center;
}

.pagination a {
  display: inline-block;
  padding: 10px 16px;
  margin: 0 5px;
  text-decoration: none;
  border-radius: 5px;
  border: 1px solid #ddd;
  color: #333;
  background-color: white;
  transition: 0.3s;
}

.pagination a:hover {
  background-color: #4CAF50;
  color: white;
}

.pagination a.active {
  background-color: #4CAF50;
  color: white;
  border-color: #4CAF50;
}

.pagination-admin {
  padding-top: 20px;
}


.article:hover .edit-icon {
  opacity: 1;
}

form {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

input, textarea {
  width: 100%;
  padding: 8px;
  margin: 5px 0;
  border: 1px solid #ddd;
  border-radius: 5px;
}

button {
  background: #28a745;
  color: white;
  padding: 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

button:hover {
  background: #218838;
}

/* Общий стиль для кнопок */
.add-article-button, .logout-button {
  display: inline-block;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: bold;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.3s, transform 0.2s;
  margin-right: 10px;
}

/* Стиль для кнопки "Add Article" */
.add-article-button {
  background: #28a745;
}

.add-article-button:hover {
  background: #218838;
  transform: scale(1.05);
}

/* Стиль для кнопки "Log out" */
.logout-button {
  background: #dc3545;
}

.logout-button:hover {
  background: #c82333;
  transform: scale(1.05);
}

/* Контейнер кнопок */
.admin-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column; /* Располагаем кнопки вертикально */
  gap: 8px; /* Увеличил расстояние между кнопками */
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

/* Показываем кнопки при наведении на карточку */
.article:hover .admin-actions {
  opacity: 1;
}

/* Стили для кнопок */
.edit-icon, .delete-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 18px;
  border-radius: 50%;
  text-decoration: none;
  color: white;
  transition: background 0.3s, transform 0.2s;
}

.edit-icon {
  background: rgba(0, 123, 255, 0.9);
}

.delete-icon {
  background: rgba(255, 0, 0, 0.9);
}

.edit-icon:hover {
  background: rgba(0, 123, 255, 1);
  transform: scale(1.15);
}

.delete-icon:hover {
  background: rgba(255, 0, 0, 1);
  transform: scale(1.15);
}




.article.pinned {
  background-color: #fff8dc; 
  border: 2px solid #f4c542; 
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pinned-label {
  display: inline-block;
  background-color: #f4c542;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 5px;
  position: absolute;
  top: 10px;
  left: 10px;
}
.article {
  position: relative;
  padding: 15px;
}


.scroll-to-top {
  z-index: 999;
  position: fixed;
  bottom: 20px;
  right: 70px;
  width: 50px;
  height: 50px;
  background-color: #c11717;
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, background-color 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1430px) {
  .scroll-to-top {
    right: 20px;
  }
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background-color: #4ab150;
}


