/* === BASE STYLES === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Roboto", sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

/* === CONTAINER === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* === HEADER === */
.header {
  background: linear-gradient(135deg, #4a90e2, #357abd);
  color: white;
  padding: 1.5rem 0;
  text-align: center;
}

.header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.header p {
  font-size: 1rem;
  opacity: 0.9;
  font-weight: 300;
}

/* === MAIN NAVIGATION TABS === */
.tabs-nav {
  display: flex;
  background: white;
  border-radius: 12px;
  padding: 0.5rem;
  margin: 2rem 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  gap: 0.5rem;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: 2px solid transparent;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: #666;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  background: #f8f9fa;
  color: #4a90e2;
}

.tab-btn.active {
  background: #4a90e2;
  color: white;
  border-color: #4a90e2;
}

/* === CATEGORY NAVIGATION === */
.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.category-btn {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  padding: 0.7rem 1.2rem;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #495057;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.category-btn:hover {
  border-color: #4a90e2;
  color: #4a90e2;
  transform: translateY(-2px);
}

.category-btn.active {
  background: #4a90e2;
  border-color: #4a90e2;
  color: white;
}

/* === TAB CONTENT === */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* === VIDEO CARDS === */
.videos-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.video-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.video-card h3 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  border-bottom: 2px solid #4a90e2;
  padding-bottom: 0.5rem;
}

/* === VIDEO CONTAINER === */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 ratio */
  height: 0;
  margin: 1rem 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* === VIDEO META INFO === */
.video-meta {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.video-description {
  margin-bottom: 0.8rem;
  line-height: 1.5;
}

.video-materials h4 {
  color: #4a90e2;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

/* Стили для материалов в виде чипов */
.materials-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
  max-height: none;
  transition: max-height 0.4s ease, margin-top 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.material-chip {
  background: white;
  border: 1px solid #e0e0e0;
  padding: 0.3rem 0.8rem;
  border-radius: 16px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.material-chip:hover {
  border-color: #4a90e2;
  background: #f0f7ff;
}

.material-chip i {
  font-size: 0.5rem;
  color: #4a90e2;
}

/* Аккордеон для мобильных */
.materials-header {
  display: none;
}

.materials-toggle {
  background: none;
  border: none;
  color: #4a90e2;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.materials-toggle i {
  transition: transform 0.3s ease;
}

.materials-toggle.active i {
  transform: rotate(180deg);
}

.materials-count {
  background: #4a90e2;
  color: white;
  border-radius: 12px;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  margin-left: 0.5rem;
}

.video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.video-tag {
  background: #e74c3c;
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* === NO CONTENT MESSAGE === */
.no-content {
  text-align: center;
  padding: 3rem 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.no-content i {
  font-size: 4rem;
  color: #dee2e6;
  margin-bottom: 1rem;
}

.no-content h3 {
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.no-content p {
  color: #adb5bd;
}

/* === PHOTO GRID === */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

/* === INSTRUCTIONS GRID === */
.instructions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

/* === CONTACTS SECTION === */
.contacts-section {
  background: linear-gradient(135deg, #4a90e2, #357abd);
  color: white;
  padding: 0.8rem 1rem;
  margin: 0.8rem auto;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  text-align: center;
  max-width: 1200px;
}

.email-contact {
  margin: 0;
}

.email-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8rem;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(6px);
}

.email-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Мобильная версия контактов */
@media (max-width: 768px) {
  .contacts-section {
    padding: 0.6rem 0.8rem;
    margin: 0.6rem auto;
  }

  .email-btn {
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    gap: 0.2rem;
  }
}

@media (max-width: 480px) {
  .contacts-section {
    padding: 0.5rem 0.6rem;
    margin: 0.5rem auto;
  }

  .email-btn {
    padding: 0.25rem 0.7rem;
    font-size: 0.7rem;
  }
}

/* === FOOTER === */
.footer {
  background: linear-gradient(135deg, #e91e63, #ad1457);
  color: white;
  text-align: center;
  padding: 1.5rem 0;
  margin-top: 2rem;
  position: relative;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ff9eb5, #e91e63, #ff9eb5);
}

.footer p {
  font-size: 1rem;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Мобильная версия футера */
@media (max-width: 768px) {
  .footer {
    padding: 1.2rem 0;
    margin-top: 1.5rem;
  }

  .footer p {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .footer {
    padding: 1rem 0;
    margin-top: 1rem;
  }

  .footer p {
    font-size: 0.85rem;
  }
}

/* === MOBILE STYLES === */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .header {
    padding: 1rem 0;
  }

  .header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
  }

  .header p {
    font-size: 0.9rem;
  }

  .tabs-nav {
    flex-direction: column;
    gap: 0.3rem;
    margin: 1rem 0;
  }

  .tab-btn {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
  }

  .category-nav {
    gap: 0.5rem;
    padding: 0.8rem;
  }

  .category-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  .videos-container {
    gap: 1.5rem;
  }

  .video-card {
    padding: 1rem;
  }

  .video-card h3 {
    font-size: 1.1rem;
  }

  .video-tags {
    gap: 0.3rem;
  }

  .video-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
  }

  /* Аккордеон для мобильных */
  .materials-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
  }

  .materials-chips {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
  }

  .materials-chips.expanded {
    max-height: 500px;
    opacity: 1;
    margin-top: 0.5rem;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 0.8rem 0;
  }

  .header h1 {
    font-size: 1.3rem;
  }

  .header p {
    font-size: 0.8rem;
  }

  .category-nav {
    justify-content: center;
  }

  .category-btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  .photo-grid,
  .instructions-grid {
    grid-template-columns: 1fr;
  }

  .no-content {
    padding: 2rem 1rem;
  }

  .no-content i {
    font-size: 3rem;
  }
}

/* === FIX FOR MOBILE VIEWPORT === */
@media (max-width: 500px) {
  * {
    max-width: 100vw;
  }

  html,
  body {
    overflow-x: hidden;
    position: relative;
  }

  .container {
    padding: 0 10px;
    width: 100%;
    box-sizing: border-box;
  }
}

/* Стили для фото-галереи */
.photos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
}

.upload-photo-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-photo-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.photos-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.photo-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.photo-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.photo-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.photo-card:hover .photo-image {
  transform: scale(1.05);
}

.photo-info {
  padding: 15px;
}

.photo-title {
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 5px;
  color: #333;
}

.photo-description {
  font-size: 0.9em;
  color: #666;
  line-height: 1.4;
}

.photo-category {
  display: inline-block;
  background: #f0f0f0;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  color: #888;
  margin-top: 8px;
}

/* Модальные окна */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 0;
  border-radius: 15px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.modal-header h3 {
  margin: 0;
  color: #333;
}

.close-modal {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  transition: color 0.3s ease;
}

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

/* Форма загрузки */
.upload-form {
  padding: 25px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 25px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-secondary {
  background: #f8f9fa;
  color: #333;
  border: 2px solid #e0e0e0;
  padding: 12px 25px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary:hover {
  background: #e9ecef;
}

/* Превью изображения */
.image-preview {
  margin-top: 10px;
  display: none;
}

.image-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  border: 2px dashed #ddd;
}

/* Просмотрщик фото */
.photo-viewer {
  max-width: 90%;
  max-height: 90%;
  width: auto;
}

.photo-viewer-content {
  display: flex;
  flex-direction: column;
}

.photo-viewer-content img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 10px 10px 0 0;
}

.photo-viewer-info {
  padding: 20px;
  background: white;
  border-radius: 0 0 10px 10px;
}

/* Адаптивность */
@media (max-width: 768px) {
  .photos-header {
    flex-direction: column;
    align-items: stretch;
  }

  .upload-photo-btn {
    align-self: center;
  }

  .modal-content {
    margin: 10% auto;
    width: 95%;
  }

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

  .photos-container {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
  }
}
