/* Полностью переработан дизайн с современными карточками, анимациями и градиентами */

/* Основные стили контейнера */
.guide-detail-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* Хлебные крошки */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
  font-size: 14px;
  color: #666;
  animation: fadeInDown 0.6s ease;
}

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

.breadcrumbs a {
  color: #6366f1;
  text-decoration: none;
  transition: all 0.3s;
  position: relative;
}

.breadcrumbs a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #6366f1;
  transition: width 0.3s;
}

.breadcrumbs a:hover::after {
  width: 100%;
}

.breadcrumbs a:hover {
  color: #4f46e5;
}

.breadcrumbs .separator {
  color: #ccc;
}

.breadcrumbs .current {
  color: #333;
  font-weight: 500;
}

/* Заголовок гайда с анимацией */
.guide-header {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 40px;
  border-radius: 20px;
  color: white;
  margin-bottom: 30px;
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
  animation: fadeInUp 0.8s ease;
  position: relative;
  overflow: hidden;
}

.guide-header::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.guide-icon {
  font-size: 80px;
  opacity: 0.9;
  animation: bounceIn 1s ease;
  position: relative;
  z-index: 1;
}

@keyframes bounceIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
}

.guide-info {
  position: relative;
  z-index: 1;
}

.guide-info h1 {
  font-size: 36px;
  margin: 0 0 15px 0;
  animation: fadeInRight 0.8s ease 0.2s both;
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.guide-description {
  font-size: 18px;
  opacity: 0.95;
  margin-bottom: 20px;
  line-height: 1.6;
  animation: fadeInRight 0.8s ease 0.4s both;
}

.guide-meta {
  display: flex;
  gap: 25px;
  flex-wrap: wrap;
  animation: fadeInRight 0.8s ease 0.6s both;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 15px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
}

.meta-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Прогресс-бар с анимацией */
.progress-section {
  background: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
  animation: fadeInUp 0.8s ease 0.4s both;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.progress-label {
  font-weight: 600;
  color: #333;
}

.progress-value {
  color: #6366f1;
  font-weight: 600;
}

.progress-bar {
  height: 12px;
  background: #f0f0f0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
  position: relative;
}

.progress-bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: progressShine 2s infinite;
}

@keyframes progressShine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.progress-percentage {
  text-align: right;
  font-size: 14px;
  color: #666;
  font-weight: 600;
}

/* Обертка контента с улучшенной сеткой */
.guide-content-wrapper {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 30px;
  align-items: start;
}

/* Боковое меню с карточками разделов */
.sections-sidebar {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  animation: fadeInLeft 0.8s ease 0.6s both;
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sections-sidebar::-webkit-scrollbar {
  width: 6px;
}

.sections-sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.sections-sidebar::-webkit-scrollbar-thumb {
  background: #6366f1;
  border-radius: 10px;
}

.sections-sidebar::-webkit-scrollbar-thumb:hover {
  background: #4f46e5;
}

.sections-sidebar h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: #333;
  padding-bottom: 15px;
  border-bottom: 2px solid #f0f0f0;
}

/* Карточки разделов в боковом меню */
.section-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  margin-bottom: 10px;
  border-radius: 10px;
  text-decoration: none;
  color: #666;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #f8f9fa;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.section-nav-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
  transition: left 0.5s;
}

.section-nav-item:hover::before {
  left: 100%;
}

.section-nav-item:hover {
  background: #f0f1ff;
  border-color: #6366f1;
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.section-nav-item.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  transform: translateX(5px);
}

.section-nav-item.completed {
  background: #d1fae5;
  border-color: #10b981;
}

.section-nav-item.completed:hover {
  background: #a7f3d0;
}

.section-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 14px;
  color: #6366f1;
  flex-shrink: 0;
  transition: all 0.3s;
}

.section-nav-item.active .section-number {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: scale(1.1);
}

.section-nav-item.completed .section-number {
  background: #10b981;
  color: white;
}

.section-nav-info {
  flex: 1;
  min-width: 0;
}

.section-nav-title {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-nav-time {
  font-size: 12px;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.completion-icon {
  color: #10b981;
  font-size: 18px;
  animation: checkmark 0.5s ease;
}

@keyframes checkmark {
  0% {
    transform: scale(0) rotate(-45deg);
  }
  50% {
    transform: scale(1.2) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

/* Контент разделов */
.sections-content {
  background: white;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  animation: fadeInUp 0.8s ease 0.8s both;
  overflow-x: auto !important;
  max-width: 100vw;
    }

.guide-section {
  display: none;
  padding: 40px;
}

.guide-section.active {
  display: block;
  animation: sectionFadeIn 0.6s ease;
}

@keyframes sectionFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.section-icon {
  font-size: 48px;
  color: #6366f1;
  animation: iconBounce 1s ease;
}

@keyframes iconBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.section-title-wrapper h2 {
  margin: 0 0 10px 0;
  font-size: 28px;
  color: #333;
}

.section-meta {
  display: flex;
  gap: 15px;
  font-size: 14px;
  color: #666;
}

.section-body {
  line-height: 1.8;
  color: #444;
}

.section-body h2 {
  font-size: 24px;
  margin: 30px 0 15px 0;
  color: #333;
}

.section-body h3 {
  font-size: 20px;
  margin: 25px 0 12px 0;
  color: #444;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-body ul {
  margin: 15px 0;
  padding-left: 25px;
}

.section-body li {
  margin: 10px 0;
  position: relative;
  padding-left: 10px;
}

.section-body li::before {
  content: "→";
  position: absolute;
  left: -15px;
  color: #6366f1;
  font-weight: bold;
}

.section-body strong {
  color: #333;
  font-weight: 600;
}

/* Блоки контента с анимацией появления */
.intro-block,
.highlight-box,
.stats-block,
.tips-block,
.warning-block,
.action-block,
.formula-block,
.equipment-list,
.theory-block,
.settings-examples,
.pricing-table,
.packages-block,
.tools-list,
.free-alternatives,
.resources-block,
.formula-card,
.mistakes-block {
  padding: 20px;
  border-radius: 12px;
  margin: 20px 0;
  border-left: 4px solid #6366f1;
  animation: blockFadeIn 0.6s ease;
  transition: all 0.3s;
}

@keyframes blockFadeIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.intro-block {
  background: linear-gradient(135deg, #f8f9ff 0%, #e8eaff 100%);
  border-left-color: #6366f1;
}

.intro-block:hover {
  box-shadow: 0 5px 20px rgba(99, 102, 241, 0.15);
  transform: translateY(-2px);
}

.highlight-box {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-left-color: #f59e0b;
}

.highlight-box:hover {
  box-shadow: 0 5px 20px rgba(245, 158, 11, 0.15);
  transform: translateY(-2px);
}

.stats-block {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-left-color: #3b82f6;
}

.stats-block:hover {
  box-shadow: 0 5px 20px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}

.tips-block {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-left-color: #10b981;
}

.tips-block:hover {
  box-shadow: 0 5px 20px rgba(16, 185, 129, 0.15);
  transform: translateY(-2px);
}

.warning-block {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-left-color: #ef4444;
}

.warning-block:hover {
  box-shadow: 0 5px 20px rgba(239, 68, 68, 0.15);
  transform: translateY(-2px);
}

.action-block {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-left: none;
  position: relative;
  overflow: hidden;
}

.action-block::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: pulse 4s ease-in-out infinite;
}

.action-block h3 {
  color: white;
  position: relative;
  z-index: 1;
}

.action-block:hover {
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
  transform: translateY(-5px);
}

.example-card {
  background: white;
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
}

.example-card:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.example-card h4 {
  margin: 0 0 10px 0;
  color: #6366f1;
}

.pricing-table table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.pricing-table th,
.pricing-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.pricing-table th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
}

.pricing-table tr {
  transition: background 0.3s;
}

.pricing-table tr:hover {
  background: #f8f9ff;
}

.pricing-table tr:last-child td {
  border-bottom: none;
}

.packages-note {
  background: white;
  padding: 12px;
  border-radius: 8px;
  margin-top: 15px;
  font-weight: 600;
  color: #10b981;
  text-align: center;
}

/* Футер раздела с кнопками */
.section-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid #f0f0f0;
}

.btn-complete-section,
.btn-next-section,
.btn-back-to-guides {
  padding: 15px 30px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-complete-section::before,
.btn-next-section::before,
.btn-back-to-guides::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-complete-section:hover::before,
.btn-next-section:hover::before,
.btn-back-to-guides:hover::before {
  width: 300px;
  height: 300px;
}

.btn-complete-section {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-complete-section:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-complete-section.completed {
  background: #6b7280;
  cursor: default;
  box-shadow: none;
}

.btn-complete-section.completed:hover {
  transform: none;
}

.btn-complete-section.completed::before {
  display: none;
}

.btn-next-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-next-section:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-back-to-guides {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(107, 114, 128, 0.3);
}

.btn-back-to-guides:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(107, 114, 128, 0.4);
}

/* Анимации для уведомлений */
@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* Адаптивность */
@media (max-width: 1024px) {
  .guide-content-wrapper {
    grid-template-columns: 1fr;
  }

  .sections-sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
    margin-bottom: 30px;
  }
}

/* Добавляем базовые стили для table-scroll-wrapper ВНЕ медиазапроса */
/* Table scroll wrapper - базовые стили для всех экранов */
.table-scroll-wrapper {
  display: block;
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  margin: 20px 0;
  border-radius: 8px;
  max-width: 100%;
}

.table-scroll-wrapper table {
  margin: 0 !important;
  width: auto;
  min-width: 100%;
}

/* Scrollbar styling для всех экранов */
.table-scroll-wrapper::-webkit-scrollbar {
  height: 10px;
}

.table-scroll-wrapper::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb {
  background: #6366f1;
  border-radius: 4px;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background: #4f46e5;
}

/* Добавляем дополнительные стили для всех таблиц на мобильных */
@media (max-width: 768px) {
  /* Убираем overflow-x: hidden с section-body чтобы не блокировать прокрутку таблиц */
  .section-body {
    font-size: 15px;
    line-height: 1.8;
    overflow-x: visible;
    overflow-y: visible;
  }

  /* Table wrapper with horizontal scroll - усиленные стили для мобильных */
  .table-scroll-wrapper {
    overflow-x: scroll !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    margin: 20px -15px;
    padding: 0 15px;
    border: none;
    border-radius: 0;
    background: transparent;
    max-width: calc(100% + 30px);
    width: calc(100% + 30px);
  }

  /* Tables inside wrapper - задаем минимальную ширину */
  .table-scroll-wrapper table {
    min-width: 600px !important;
    font-size: 14px;
    margin: 0 !important;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
  }

  /* Scroll indicator */
  .table-scroll-wrapper::after {
    content: "← Прокрутите таблицу →";
    display: block;
    text-align: center;
    font-size: 12px;
    color: #6366f1;
    padding: 10px;
    background: #f8f9ff;
    border-top: 1px solid #e5e7eb;
    opacity: 0.8;
    min-width: 600px;
  }

  /* Responsive content blocks */
  .highlight-box,
  .info-box,
  .warning-box,
  .success-box {
    font-size: 14px;
    padding: 15px;
    margin: 15px 0;
  }
}

@media (max-width: 768px) {
  .guide-header {
    flex-direction: column;
    text-align: center;
    padding: 30px 20px;
  }

  .guide-info h1 {
    font-size: 28px;
  }

  .guide-meta {
    justify-content: center;
  }

  .guide-section {
    padding: 20px;
  }

  .section-footer {
    flex-direction: column;
  }

  .btn-complete-section,
  .btn-next-section,
  .btn-back-to-guides {
    width: 100%;
    justify-content: center;
  }

  /* Complete table wrapper styles for mobile horizontal scroll */
  .table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    max-width: 100%;
    width: 100%;
  }

  .table-scroll-wrapper::-webkit-scrollbar {
    height: 8px;
  }
}
