/* Сброс стандартных отступов и настройка базовых параметров */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Базовые настройки для тела документа */
html {
  font-size: 16px; /* Установка базового размера шрифта для масштабирования */
}

/* Базовые настройки для тела документа */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f5f5;
  line-height: 1.6;
  color: #333;
}

/* Контейнер для основного содержимого */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Стили для заголовка */
header {
  text-align: center;
  margin-bottom: 30px;
}

h1 {
  color: #2c3e50;
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 10px;
}

/* Секция ввода поста */
.input-section {
  margin-bottom: 30px;
}

#post-input {
  width: 100%;
  padding: 15px;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  resize: vertical;
  min-height: 100px;
  margin-bottom: 10px;
  transition: border-color 0.3s ease;
}

#post-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Управление вводом */
.input-controls {
  position: relative;
}

.input-controls-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px; 
}

.input-icons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.icon {
  cursor: pointer;
  font-size: 1.5rem;
  padding: 5px;
  border-radius: 50%;
  transition: background-color 0.3s ease;
  color: #555;
}

.icon:hover {
  background-color: #f0f0f0;
  color: #007bff;
}

/* Контролы записи */
.recording-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
}

/* Контейнер предварительного просмотра видео */
.video-preview-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 10px;
  border: 2px solid #007bff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  background-color: #000;
}

.video-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Таймер записи */
.timer {
  font-weight: bold;
  font-size: 1.2rem;
  min-width: 60px;
  text-align: center;
  color: #e74c3c;
}

/* Кнопки управления */
.control-btn {
  padding: 10px 20px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 100px; /* Установка фиксированной ширины для одинакового размера кнопок */
  font-weight: 500;
}

.control-btn:hover {
  opacity: 0.9;
}

.control-btn:active {
  transform: translateY(1px);
}

.round-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background-color: #f0f0f0;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
  color: #333;
}

.round-btn:hover {
 background-color: #e0e0e0;
  transform: scale(1.05);
}

.round-btn.confirm-btn {
  background-color: #28a745;
  color: white;
}

.round-btn.confirm-btn:hover {
  background-color: #218838;
}

.round-btn.cancel-btn {
  background-color: #dc3545;
  color: white;
}

.round-btn.cancel-btn:hover {
  background-color: #c82333;
}

/* Кнопка отправки поста */
#post-submit {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  display: block;
  margin: 0;
  align-self: flex-start; /* Выравнивание кнопки по левому краю */
  font-weight: 500;
}

#post-submit:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
}

#post-submit:active {
  transform: translateY(0);
}

/* Стили для таймлайна */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Стили для поста */
.post {
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.post-type {
  font-size: 1.2rem;
  font-weight: 600;
  color: #007bff;
}

.post-time {
  color: #666;
  font-size: 0.9rem;
}

.post-content {
  margin-bottom: 10px;
}

.post-content audio,
.post-content video {
  width: 100%;
}

.post-location {
  color: #888;
  font-size: 0.9rem;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 5px;
}

audio {
  margin-top: 10px;
}

/* Стили для модального окна ввода координат */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px); /* Эффект размытия фона */
}

.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 500px;
  position: relative;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-content p {
  margin: 10px 0;
  line-height: 1.6;
  color: #333;
  font-size: 1rem;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: #333;
}

#coordinates-input {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 10px;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

#coordinates-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.error-message {
  color: #d9534f;
  font-size: 0.9rem;
  margin: 10px 0;
  display: none;
  padding: 8px;
  background-color: #f8d7da;
  border-radius: 4px;
  border-left: 4px solid #d9534f;
}

#coordinates-submit {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  margin-top: 10px;
  font-weight: 500;
  width: 100%;
}

#coordinates-submit:hover {
  background-color: #218838;
  transform: translateY(-2px);
}

#coordinates-submit:active {
  transform: translateY(0);
}

/* Стили для всплывающих уведомлений (toast notifications) */
.toast-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 8px;
  color: white;
  font-size: 1rem;
  font-weight: 500;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 300px;
  max-width: 500px;
  word-wrap: break-word;
  animation: slideInRight 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-notification .toast-icon {
  font-size: 1.5rem;
  font-weight: bold;
}

.toast-notification.toast-info {
  background-color: #3498db;
}

.toast-notification.toast-error {
  background-color: #e74c3c;
}

.toast-notification.toast-success {
  background-color: #2ecc71;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Адаптивные стили */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .input-controls-bottom {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    height: auto;
  }
  
  .input-icons {
    justify-content: center;
  }
  
  .post {
    padding: 15px;
  }
  
  .toast-notification {
    min-width: 250px;
    right: 10px;
    left: 10px;
    max-width: calc(100% - 20px);
  }
}

@media (max-width: 480px) {
  .modal-content {
    width: 95%;
    padding: 20px;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  .control-btn,
  #post-submit,
  #coordinates-submit {
    width: 100%;
    margin-bottom: 10px;
  }
  
  .recording-controls {
    flex-direction: column;
  }
}

