/* components.css - Компоненты интерфейса */

/* Кнопки */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.btn:hover {
  background-color: var(--accent-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow);
}

.btn-small {
  padding: 6px 8px;
  font-size: 13px;
  margin: 6px 6px 6px 0;
}

.btn-success {
  background-color: var(--success-color);
}

.btn-success:hover {
  background-color: #059669;
}

.btn-danger {
  background-color: var(--danger-color);
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-alt {
  background: #6c757d;
}

/* Поля ввода */
input[type="text"],
input[type="tel"],
input[type="password"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  margin-top: 6px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--card);
  color: var(--text-color);
  transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.comment-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-top: 10px;
  resize: none;
  min-height: 60px;
  overflow-y: hidden;
  line-height: 1.5;
  background: var(--card);
  color: var(--text-color);
  transition: all 0.2s ease;
}

.comment-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.file-input {
  display: none;
}

/* Карточки */
.card {
  background: var(--card);
  border: 1px solid var(--border-color);
  padding: 20px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
}

.card-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text-color);
}

.side-card {
  background: var(--card);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}

/* Секции */
.section {
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-color);
  display: flex;
  align-items: center;
  /* justify-content: space-between; */
}

/* Фотографии */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.photo-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  transition: all 0.2s ease;
  background: var(--card);
}

.photo-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-color-hover);
}

.photo-preview {
  width: 100%;
  height: 250px;
  background-color: var(--light-gray);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  position: relative;
}

.photo-preview:hover {
  border-color: var(--border-color-hover);
}

.photo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.photo-preview:hover img {
  transform: scale(1.02);
}

.photo-preview video {
  max-width: 100%;
  max-height: 250px;
  object-fit: contain;
  cursor: pointer;
  pointer-events: auto;
}

/* Иконка play для видео */
.video-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.photo-preview:hover .video-play-overlay {
  background: rgba(0, 0, 0, 0.85);
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.video-play-icon {
  width: 0;
  height: 0;
  border-left: 20px solid white;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  margin-left: 4px;
  transition: all 0.2s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.photo-preview:hover .video-play-icon {
  border-left-width: 22px;
  border-top-width: 14px;
  border-bottom-width: 14px;
}

.photo-placeholder {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

.basic-photo-title {
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-color);
}

/* Дополнительные файлы */
.additional-files-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.additional-file-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  background: var(--card);
  transition: all 0.2s ease;
}

.additional-file-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-color-hover);
}

.delete-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(239, 68, 68, 0.9);
  backdrop-filter: blur(4px);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  transition: all 0.2s ease;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.delete-btn:hover {
  background: var(--danger-color);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.delete-btn:active {
  transform: scale(0.95);
}

/* Модальное окно */
.fullscreen-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.fullscreen-modal.active {
  opacity: 1;
  visibility: visible;
}

.fullscreen-content {
  max-width: 95vw;
  max-height: 95vh;
  position: relative;
  /* padding: 20px; */
}

.fullscreen-content img,
.fullscreen-content video {
  max-width: 95vw;
  max-height: 95vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.close-modal {
  position: absolute;
  top: 24px;
  right: 24px;
  color: white;
  font-size: 36px;
  font-weight: 300;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 1001;
  line-height: 1;
}

.close-modal:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.1);
}

.close-modal:active {
  transform: scale(0.95);
}

/* Лоадер */
.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Индикатор загрузки (overlay) */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  color: var(--text-color);
  font-size: 16px;
  font-weight: 500;
  margin: 0;
}

/* Иконки статуса */
.act-icon {
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.act-present {
  color: var(--success-color);
}

.act-absent {
  color: var(--danger-color);
}

/* Drag & Drop */
.drag-over {
  border: 2px dashed var(--accent);
  background-color: rgba(74, 144, 226, 0.1);
  box-shadow: var(--shadow-md);
}

/* Шторка удаления */
.delete-section-trigger {
  transition: all 0.2s ease;
  user-select: none;
}

.delete-section-trigger:hover {
  background-color: rgba(239, 68, 68, 0.05);
}

.delete-section-drawer {
  max-height: 0;
  transition: max-height 0.4s ease-out;
  background-color: var(--card);
  border-top: 1px solid var(--border-color);
  overflow: hidden;
}

.delete-section-drawer.open {
  max-height: 150px;
}

.delete-section-content {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease-out 0.1s, transform 0.3s ease-out 0.1s;
  padding: 20px;
  text-align: center;
}

.delete-section-drawer.open .delete-section-content {
  opacity: 1;
  transform: translateY(0);
}

/* Модальное окно капчи */
.captcha-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.captcha-modal.active {
  display: flex;
  opacity: 1;
}

.captcha-modal-content {
  background: var(--card);
  border-radius: var(--radius);
  padding: 30px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
}

.captcha-modal-content h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--text-color);
  font-size: 1.25rem;
}

.captcha-modal-content p {
  margin-bottom: 20px;
  color: var(--text-color);
  font-size: 14px;
}

.captcha-task {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
  padding: 20px;
  background-color: var(--light-gray);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.captcha-task span {
  font-size: 21px;
  font-weight: 600;
  color: var(--text-color);
  min-width: 130px;
  text-align: center;
}

.captcha-task input {
  width: 80px;
  padding: 8px;
  font-size: 20px;
  text-align: center;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.captcha-task input:focus {
  border-color: var(--accent);
  outline: none;
}

.captcha-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.captcha-error {
  text-align: center;
  font-size: 14px;
  min-height: 20px;
}

/* Форма смены пароля */
.password-page .section {
  margin-top: 30px;
}

.password-page .form-group {
  margin-bottom: 24px;
}

.password-page .form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-color);
}

.password-page input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 16px;
  background: var(--card);
  color: var(--text-color);
  transition: border-color 0.2s ease;
}

.password-page input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

.password-requirements {
  margin-top: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px 16px;
  background-color: var(--card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.requirement {
  position: relative;
  padding-left: 28px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
}

.requirement-match {
  margin-top: 14px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius);
  padding: 14px 16px;
  background-color: var(--card);
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--muted);
  
}

.requirement::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--border-color);
}

.requirement.valid {
  color: var(--success-color);
}

.requirement.valid::before {
  background-color: var(--success-color);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}

.requirement.invalid {
  color: var(--danger-color);
}

.requirement.invalid::before {
  background-color: var(--danger-color);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.requirement.note {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
}

.status-message {
  min-height: 24px;
  font-size: 14px;
  margin-top: 10px;
  transition: color 0.2s ease;
}

.status-message.error {
  color: var(--danger-color);
}

.status-message.success {
  color: var(--success-color);
}