/* Тело сайта (тёмная тема) */
body {
  background-image: url('/assets/images/body-bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #fff !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* Основной контент */
main {
  padding: 2rem 0;
  background-color: transparent;
  color: #fff !important;
}

.container, .container * {
  color: #fff !important;
}

/* Шапка (hero) - ОБНОВЛЕНО: уменьшено затемнение */
.hero {
  position: relative;
  background-image: url('/assets/images/bg.png');
  background-size: cover;
  background-position: center;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff !important;
  z-index: 1;
}

/* Полупрозрачный оверлей - ОБНОВЛЕНО: светлее */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4) !important;
  z-index: 0;
}

.hero-content {
  z-index: 2;
  padding: 2rem;
  color: #fff !important;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #fff !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: #fff !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.nav-menu {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* ОБНОВЛЕННЫЕ СТИЛИ КНОПОК - ФИКСИРОВАННЫЙ РАЗМЕР */
.nav-link {
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(10px);
  padding: 0.9rem 1.5rem !important;
  margin: 0.3rem !important;
  border-radius: 4px !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: #fff !important;
  text-decoration: none !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3),
              0 6px 12px rgba(0, 0, 0, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  transition: all 0.3s ease !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) !important;
  position: relative;
  z-index: 3 !important;
  font-size: 1rem !important;
  
  /* ФИКСИРОВАННЫЙ РАЗМЕР ДЛЯ ВСЕХ СТРАНИЦ */
  min-width: 150px !important;
  max-width: 150px !important;
  width: 150px !important;
  text-align: center !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4),
              0 8px 16px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-2px) !important;
  color: #fff !important;
}

.nav-link:active {
  background: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4),
              inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
  transform: translateY(1px) !important;
}

/* БЕГУЩАЯ СТРОКА - ТОЛЬКО БАЗОВЫЕ СТИЛИ */
.welcome-section {
  text-align: center;
  padding: 2rem 0;
  overflow: hidden;
}

.spread-text {
  display: inline-block;
  font-size: 2rem;
  font-weight: 700;
  color: #fff !important;
  white-space: nowrap;
}

.spread-text span {
  display: inline-block;
  /* Анимация полностью управляется JavaScript */
}

/* Стеклянная карточка */
.neural-card-3d {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  color: #fff !important;
}

.neural-card-3d:hover {
  transform: scale(1.02);
}

.main-page-card {
  margin: 2rem auto;
  max-width: 800px;
}

.main-page-image {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

/* SEO-текст */
.seo-text {
  padding: 2rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  color: #ddd !important;
  line-height: 1.6;
}

.seo-text h2 {
  color: #fff !important;
}

/* Карусель статей */
.articles-carousel .carousel-inner {
  padding: 1rem 0;
}

.articles-carousel .carousel-item .neural-card-3d {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #fff !important;
  margin: 0 0.5rem;
}

.articles-carousel .carousel-item .carousel-image {
  max-height: 200px;
  object-fit: cover;
}

.articles-carousel .carousel-item .card-title {
  font-size: 1.3rem;
  color: #fff !important;
}

.articles-carousel .carousel-item .card-text {
  color: #ddd !important;
}

/* Список статей */
.articles-list .neural-card-3d {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff !important;
}

.articles-list img {
  max-height: 100px;
  object-fit: cover;
}

/* Галерея */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 2rem 0;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Модальное окно */
.modal-dialog {
  max-width: fit-content !important;
  width: intrinsic !important;
  margin: 1rem auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  display: inline-block;
}

.modal-body {
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-body img {
  max-height: 80vh;
  max-width: 90vw;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}

.modal-header {
  border: none;
  padding: 0.5rem;
  justify-content: flex-end;
}

.btn-close-white {
  filter: invert(1) !important;
}

/* Статьи */
.post-article, .post-article * {
  color: #fff !important;
}

.post-article h1,
.post-article h2,
.post-article h3,
.post-article h4 {
  color: #fff !important;
}

.post-article p {
  color: #ddd !important;
}

.post-article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
}

.post-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
  .post-article img,
  .post-image,
  .modal-body img {
    max-width: 100% !important;
    max-height: 80vh !important;
    width: auto !important;
    height: auto !important;
  }
  .modal-dialog {
    margin: 0.5rem;
  }
  .nav-link {
    padding: 0.7rem 1.2rem !important;
    font-size: 0.9rem !important;
    margin: 0.2rem !important;
    min-width: 130px !important;
    max-width: 130px !important;
    width: 130px !important;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .spread-text {
    font-size: 1.5rem;
  }
}

/* Футер */
.footer {
  background-color: #111;
  color: #fff !important;
  padding: 2rem 0;
  margin-top: 2rem;
}

.footer-links a {
  margin-right: 1rem;
  color: #fff !important;
}

.lab-promo {
  margin-top: 1rem;
  color: #fff !important;
}

.lab-promo a {
  color: #fff !important;
  background-color: #007bff;
  padding: 0.5rem 1rem;
  border-radius: 4px;
}

.lab-promo a:hover {
  background-color: #0056b3;
}

/* Адаптивность */
@media (max-width: 991px) {
  .nav-menu {
    flex-direction: column;
    align-items: center;
  }
  .nav-link {
    margin: 0.3rem 0 !important;
    width: 150px !important;
  }
  .spread-text {
    font-size: 1.5rem;
  }
  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  .main-page-card {
    max-width: 100%;
  }
}

/* Диагностика */
body::before {
  content: "CSS Loaded - Fixed Navigation Buttons";
  display: none;
}
