/* ===== БАЗОВІ СТИЛІ ===== */
:root {
  --bg-dark: #0a0a0a;
  --bg-card: #1a1a1a;
  --bg-input: #2a2a2a;
  --accent: #ffc800;
  --accent-hover: #ffdd00;
  --text-primary: #ffffff;
  --text-secondary: #999999;
  --border: #333333;
  --danger: #ff4444;
  --success: #44ff44;
}
.preview-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  cursor: pointer;
  z-index: 3;
  padding: 4px 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  line-height: 12px;
  transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
  border: none;
}

/* Ефект при наведенні */
.preview-remove:hover {
  background: rgba(220, 53, 69, 0.9); /* приємний червоний */
  box-shadow: 0 0 8px rgba(255, 0, 0, 0.6);
  transform: scale(1.1); /* легке збільшення без повороту */
}

/* При натисканні */
.preview-remove:active {
  transform: scale(0.95);
  background: rgba(180, 0, 0, 0.9);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}
/* ===== ВИРІВНЮВАННЯ СЕКЦІЇ КОНТАКТІВ ===== */
#contacts-admin {
  max-width: 1162px;
  margin: 2rem auto 0 auto;
  display: block;
}

/* ===== КОНТЕЙНЕР ===== */
.admin-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* ===== ШАПКА ===== */
.admin-header {
  background: var(--bg-card);
  border-bottom: 2px solid var(--accent);
  padding: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.admin-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.admin-header h1 {
  font-size: 24px;
  color: var(--accent);
  font-weight: 700;
}

.btn-back {
  padding: 10px 20px;
  background: var(--bg-input);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
}

.btn-back:hover {
  background: var(--accent);
  color: var(--bg-dark);
  border-color: var(--accent);
}

.btn-logout {
  padding: 10px 20px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

.btn-logout:hover {
  background: #ff0000;
  transform: translateY(-2px);
}

/* ===== ОСНОВНИЙ КОНТЕНТ ===== */
.admin-main {
  padding: 30px 20px;
}

.admin-section {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  border: 1px solid var(--border);
}

.admin-section h2 {
  font-size: 20px;
  margin-bottom: 25px;
  color: var(--accent);
  border-bottom: 2px solid var(--border);
  padding-bottom: 10px;
}

/* ===== ФОРМА ===== */
.news-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="datetime-local"],
.form-group textarea {
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 200, 0, 0.1);
}

/* Стилізація datetime-local */
.form-group input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group small {
  color: var(--text-secondary);
  font-size: 12px;
}

/* ===== ВИБІР ТИПУ МЕДІА ===== */
.media-type-selector {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.radio-option {
  flex: 1;
  min-width: 150px;
  padding: 15px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.radio-option:hover {
  border-color: var(--accent);
  background: rgba(255, 200, 0, 0.05);
}

.radio-option input[type="radio"] {
  cursor: pointer;
}

.radio-option input[type="radio"]:checked + span {
  color: var(--accent);
  font-weight: 600;
}

.radio-option span {
  font-size: 14px;
}

/* ===== ЗАВАНТАЖЕННЯ ФАЙЛУ ===== */
input[type="file"] {
  padding: 10px;
  background: var(--bg-input);
  border: 2px dashed var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

input[type="file"]:hover {
  border-color: var(--accent);
  background: rgba(255, 200, 0, 0.05);
}

.image-preview-grid {
  margin-top: 15px;
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
}

.image-preview-grid.active {
  display: grid;
}

.image-preview-item {
  position: relative;
  border-radius: 8px;
  border: 2px solid var(--border);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.image-preview-remove:hover {
  background: #ff0000;
  transform: scale(1.1);
}

/* ===== КНОПКИ ===== */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-dark);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 200, 0, 0.3);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn:disabled:hover {
  background: var(--accent);
  transform: none !important;
  box-shadow: none !important;
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

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

.btn-danger:hover {
  background: #ff0000;
  transform: translateY(-2px);
}

.form-actions {
  display: flex;
  gap: 15px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* ===== СПИСОК НОВИН ===== */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px;
  font-size: 16px;
}

.news-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  transition: all 0.3s ease;
}

.news-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(255, 200, 0, 0.1);
}

.news-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
}

.news-item-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.news-item-actions {
  display: flex;
  gap: 10px;
}

.btn-icon {
  padding: 8px 12px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
}

.btn-icon:hover {
  background: var(--border);
}

.btn-icon.delete:hover {
  background: var(--danger);
  border-color: var(--danger);
}

.btn-icon.edit:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-dark);
}

.news-item-content {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.news-item-media {
  margin-top: 10px;
}

.news-item-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.news-item-images img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.news-item-images img:hover {
  transform: scale(1.05);
}

.news-item-media iframe {
  width: 100%;
  height: 300px;
  border-radius: 8px;
  border: none;
}

.news-item-date {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
}

/* ===== МОДАЛЬНЕ ВІКНО ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-card);
  padding: 30px;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  border: 2px solid var(--accent);
}

.modal-content h3 {
  margin-bottom: 15px;
  color: var(--accent);
}

.modal-content p {
  margin-bottom: 25px;
  color: var(--text-secondary);
}

.modal-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
}

/* ===== ПОВІДОМЛЕННЯ ===== */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification {
  animation: slideIn 0.3s ease-out;
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-icon {
  font-size: 18px;
}

.notification-message {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.notification-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.notification-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ===== АДАПТИВНІСТЬ ===== */
@media (max-width: 768px) {
  .admin-header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-section {
    padding: 20px;
  }

  .media-type-selector {
    flex-direction: column;
  }

  .radio-option {
    min-width: 100%;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .news-item-header {
    flex-direction: column;
  }

  .news-item-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

