/* =========================================================
   SIDEBAR TOURS STYLES
   Стили для боковой панели с турами
   ========================================================= */

/* Светлая тема (по умолчанию) */
.sidebar-tours {
  box-sizing: border-box;
  width: 100%;
  max-width: 320px;
  margin: 30px auto;
  padding: 40px 30px 50px 30px;
  font-family: 'Playfair Display', serif;
  background: var(--glass-bg) !important;
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) !important;
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 15px !important;
  box-shadow: var(--shadow);
  display: block;
  color: #111827;
  overflow: visible !important;
}

.category-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 30px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #111827;
}

.category-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  margin: 15px auto 0;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-secondary));
  border-radius: 3px;
}

.tour-card {
  background: transparent !important;
  border: none !important;
  border-radius: var(--radius);
  padding: 20px 15px 22px;
  text-align: center;
  box-shadow: none !important;
  margin-bottom: 25px;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
              background-color 0.4s ease,
              border-color 0.4s ease !important;
  position: relative;
  overflow: visible !important;
}

.tour-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.tour-card img {
  border-radius: 8px;
  max-width: 100%;
  height: auto;
  margin: 12px 0 15px;
  filter: brightness(1.03) contrast(1.02);
  box-shadow: 0 15px 35px rgba(15,23,42,.3);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
              filter 0.4s ease !important;
}

.tour-card:hover img {
  transform: scale(1.03);
  box-shadow: 0 20px 50px rgba(15,23,42,.5);
}

.tour-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 5px;
  text-align: center !important;
}

.tour-card h3 a {
  color: #111827;
  text-decoration: none;
  position: relative;
  padding-bottom: 5px;
  transition: color 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  display: inline-block;
  width: 100%;
  text-align: center;
}

.tour-card h3 a:hover {
  color: #0d3b66 !important;
  transform: translateX(3px) scale(1.02);
}

.tour-card h3 a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50% !important;
  transform: translateX(-50%) scaleX(0.4) !important;
  transform-origin: center !important;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-secondary));
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
              height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.4s ease !important;
}

.tour-card:hover h3 a::after {
  transform: translateX(-50%) scaleX(1) !important;
  height: 3px;
  box-shadow: 0 2px 8px rgba(13, 59, 102, 0.3);
}

.tour-short {
  font-size: 12px;
  line-height: 1.3;
  color: #4b5563;
  margin-bottom: 8px;
}

.duration {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 12px;
  background: rgba(255,255,255,.7);
  color: #2563eb;
  box-shadow: inset 0 0 0 1px rgba(52,152,219,.2);
  margin: 12px 0 14px;
}

.transport {
  margin-top: 4px;
  font-size: 12px;
  opacity: .9;
  color: #111827;
}

/* ====================
   ТЕМНАЯ ТЕМА - ДЕСКТОП
   ==================== */
:is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .sidebar-tours {
  background: radial-gradient(circle at top, rgba(30,30,40,0.9), transparent 70%),
              linear-gradient(180deg, #1a1a2e, #0d0d1a);
  color: #f0f0f0;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
}

:is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .category-title {
  color: #f0f0f0 !important;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

:is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .category-title::after {
  background: linear-gradient(90deg, #4dabf7, #9333ea);
}

:is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .tour-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
              background-color 0.4s ease,
              border-color 0.4s ease !important;
}

:is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .tour-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 60px rgba(0,0,0,0.6);
  border-color: rgba(255,255,255,0.15);
}

:is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .tour-card h3 a {
  color: #f0f0f0 !important;
  transition: color 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

:is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .tour-card h3 a:hover {
  color: #6bc0ff !important;
  transform: translateX(3px) scale(1.02);
  text-shadow: 0 2px 12px rgba(107, 192, 255, 0.4);
}

:is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .tour-card h3 a::after {
  background: linear-gradient(90deg, #4dabf7, #9333ea);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
              height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.4s ease !important;
}

:is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .tour-card:hover h3 a::after {
  height: 3px;
  box-shadow: 0 2px 12px rgba(77, 171, 247, 0.5);
  transform: translateX(-50%) scaleX(1) !important;
}

:is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .tour-short {
  color: #b0b0c0 !important;
}

:is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .duration {
  background: rgba(40, 40, 60, 0.8) !important;
  color: #6bc0ff !important;
  box-shadow: inset 0 0 0 1px rgba(77, 171, 247, 0.3);
}

:is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .transport {
  color: #d0d0e0 !important;
  opacity: 0.95;
}

:is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .tour-card img {
  filter: brightness(0.9) contrast(1.05) saturate(1.1);
  box-shadow: 0 15px 35px rgba(0,0,0,0.5);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s ease, box-shadow 0.4s ease !important;
}

:is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .tour-card:hover img {
  filter: brightness(0.95) contrast(1.1) saturate(1.2);
  box-shadow: 0 20px 50px rgba(0,0,0,0.7);
  transform: scale(1.03) !important;
}

/* ====================
   МОБИЛЬНАЯ ВЕРСИЯ
   ==================== */
@media (max-width: 768px) {
  .sidebar-tours {
    max-width: 100%;
    margin: 20px auto;
  }

  .tour-card {
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Мобильная версия - темная тема */
  :is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .sidebar-tours {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) !important;
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) !important;
    color: #f0f0f0 !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35) !important;
    border: 1px solid var(--glass-border) !important;
  }

  :is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .category-title {
    color: #f0f0f0 !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  }

  :is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .tour-card {
    background: rgba(30, 30, 40, 0.92) !important;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
                background-color 0.4s ease,
                border-color 0.4s ease !important;
  }

  :is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .tour-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
    border-color: rgba(255,255,255,0.15);
  }

  :is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .tour-card h3 a {
    color: #f0f0f0 !important;
  }

  :is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .tour-short {
    color: #b0b0c0 !important;
  }

  :is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .duration {
    background: rgba(40, 40, 60, 0.8) !important;
    color: #6bc0ff !important;
    box-shadow: inset 0 0 0 1px rgba(77, 171, 247, 0.3);
  }

  :is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .transport {
    color: #d0d0e0 !important;
    opacity: 0.95;
  }

  :is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .tour-card img {
    filter: brightness(0.9) contrast(1.05) saturate(1.1);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s ease, box-shadow 0.4s ease !important;
  }

  :is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .tour-card:hover img {
    filter: brightness(0.95) contrast(1.1) saturate(1.2);
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
    transform: scale(1.03) !important;
  }
}

/* ====================
   ПЛАНШЕТНАЯ ВЕРСИЯ
   ==================== */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar-tours {
    width: 180px;
    margin: 0 15px 20px 0;
    padding: 15px 8px 25px;
  }

  :is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .sidebar-tours {
    background: radial-gradient(circle at top, rgba(30,30,40,0.95), transparent 70%),
                linear-gradient(180deg, #1a1a2e, #0d0d1a) !important;
    color: #f0f0f0 !important;
  }
}

/* Общие стили для темного режима */
:is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .sidebar-tours * {
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

/* Улучшение читаемости в темном режиме */
:is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .sidebar-tours {
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

:is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .tour-card h3 a:hover {
  text-shadow: 0 0 8px rgba(107, 192, 255, 0.3);
}

:is(html.dark-mode, body.dark-mode, html.dark, body.dark, [data-theme="dark"], .theme-dark) .tour-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(77, 171, 247, 0.5), transparent);
}

/* Плавные переходы для текстовых элементов */
.sidebar-tours .tour-card h3,
.sidebar-tours .tour-card .tour-short,
.sidebar-tours .tour-card .duration,
.sidebar-tours .tour-card .transport {
  transition: color 0.4s ease, opacity 0.4s ease !important;
}

.sidebar-tours .tour-card h3 a::after {
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              left 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}
