*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: url('../images/bg.png') no-repeat center center fixed;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: center;
  color: #fff;
  overflow-x: hidden;
}

.empty-state,
.loading-spinner,
.promo-banner {
  box-sizing: border-box !important;
  max-width: 100% !important;
}

header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  background-color: rgba(20, 20, 30, 0.85);
  padding: 15px 30px;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.left-side {
  display: flex;
  align-items: center;
  gap: 30px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo img {
  width: 40px;
  height: 40px;
}

.site-name {
  font-size: 20px;
  font-weight: bold;
}

.nav-buttons {
  display: flex;
  align-items: center; /* 🔹 Вирівнює всі кнопки по центру */
  gap: 20px;
}

.nav-button {
  display: inline-flex; /* 🔹 Робимо як у back-button */
  align-items: center;
  justify-content: center;
  height: 30px; /* 🔹 Така ж висота як у back-button */
  line-height: 1; /* 🔹 Убираємо "зсув" від шрифта */
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease, transform 0.2s ease;
}

.nav-button:hover {
  background: linear-gradient(90deg, #ff1a1a, #ff4d4d, #cc0000, #ff1a1a);
  background-size: 300%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: redPulse 2.5s linear infinite;
}

.nav-button-pro {
  background: linear-gradient(90deg, #ff1a1a, #ff4d4d, #cc0000, #ff1a1a);
  background-size: 300%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: redPulse 2.5s linear infinite;
}

@keyframes redPulse {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.language-select {
  display: flex;
  align-items: center;
  gap: 10px;
}

#lang-selector-top {
  background-color: rgba(30,30,40,0.9);
  border: 1px solid #ff1a1a;
  color: #fff;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 14px;
  cursor: pointer;
}

#lang-selector-top option {
  background-color: #20202a;
  color: #fff;
}

#lang-selector-top:focus {
  outline: none;
}

.center-copy {
  margin-right: 6.77vw;
  display: flex;
  align-items: center;      /* вертикальне вирівнювання */
  justify-content: center;  /* горизонтально по центру */  
  pointer-events: none;     
}

.center-copy .back-button {
  pointer-events: auto;     /* щоб кнопка була клікабельна */
}

.center-copy .copyright {
  font-size: 14px;
  color: #ccc;
  pointer-events: auto;     /* щоб копірайт не блокував кліки */
}

/* Стиль для кнопки "Назад" */
.back-button {
  margin-right: 6.77vw;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.3s, transform 0.2s;
}

.back-button:hover {
  transform: scale(1.1);
}

.back-icon {
  width: 30px;
  height: 30px;
}

.main-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
}

.sidebar.left-ads,
.sidebar.right-ads {
  position: fixed;
  top: 70px;
  width: 16.302%;
  height: 92vh;
  z-index: 999;
  box-shadow: 0 0 20px rgba(0,0,0,1);
}

.sidebar.left-ads { left: 0; }
.sidebar.right-ads { right: 0; }

.ad-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.ad-block {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.ad-block img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-overlay-text {
  position: absolute;
  top: 30px;
  left: 0;
  width: 100%;
  padding: 0 12px;
  text-align: center;
  color: #fff;
  font-size: 18px;
  line-height: 1.4;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
}

.ad-subtitle {
  position: absolute;
  bottom: 30px;
  left: 0;
  width: 100%;
  padding: 0 12px;
  text-align: center;
  color: #fff;
  font-size: 20px;
  line-height: 1.3;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
}

/* ====== INFO ICON ====== */
.info-icon {
  position: absolute;
  bottom: 25px;
  right: 25px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-image: url('../logo/info.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  opacity: 0.9;
  z-index: 10;
  transition: all 0.25s ease;
}

.info-icon:hover {
  transform: scale(1.1);
}

.center-copy .link-button {
  pointer-events: auto;     /* щоб кнопка була клікабельна */
}

.link-button {
  margin-right: 3vw;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.3s, transform 0.2s;
}

.link-button:hover {
  transform: scale(1.1);
}

.link-icon {
  width: 30px;
  height: 30px;
}

/* ===== QUAD SECTION & MAIN CONTENT ===== */
.quad-wrapper,
.main-content {
  width: 62.5vw;
  max-width: 62.5vw;
  margin: 0 auto;
  padding: 40px 20px;
}

.quad-section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.77vh 1.56vw;
}

.quad-section.wide-layout,
.sections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.quad-section > .card-span-full,
.quad-section > .info-card-link.card-span-full,
.quad-section > .info-card-link:last-child:nth-child(odd),
.quad-section > *:last-child:nth-child(odd) {
  grid-column: 1 / -1 !important;
  width: 100% !important;
}

@media (min-width: 1001px) {
  .quad-section > .card-span-full .info-card,
  .quad-section > .info-card-link.card-span-full .info-card,
  .quad-section > .info-card-link:last-child:nth-child(odd) .info-card,
  .quad-section > *:last-child:nth-child(odd) .info-card {
    height: 40vh !important;
    min-height: 280px !important;
    width: 100% !important;
  }
}

.info-card {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  background-size: cover;
  background-position: center;
  border-radius: 20px;
  overflow: hidden;
  height: 40vh;
  display: flex;
  align-items: flex-end;
  transition: transform 0.3s ease, filter 0.3s ease;
  box-shadow: 0 0 20px rgba(0, 0, 0, 1);
  filter: brightness(1.2) contrast(1.1);
}

.info-card:hover {
  transform: scale(1.02);
  filter: brightness(1.35) contrast(1.15);
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.card-content {
  position: relative;
  z-index: 2;
  padding: 25px;
  color: #fff;
}

.card-content h3 {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.card-content p {
  font-size: 1rem;
  opacity: 0.9;
  padding-right: 50px;
}

.info-card-link {
  display: block;
  width: 100%;
  text-decoration: none;
  color: inherit;
}

.wide-choice-link {
  display: block;
  width: 100%;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.wide-section {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-size: cover;
  background-position: center;
  min-height: 280px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 1);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.wide-section:hover {
  transform: scale(1.01);
}

.section-content {
  position: relative;
  z-index: 2;
  padding: 40px;
  color: #fff;
  max-width: 60%;
}

.section-content h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.section-content p {
  font-size: 1.08rem;
  opacity: 0.95;
  padding-right: 40px;
}

.section-overlay {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(to left, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0));
  transition: all 0.8s ease;
  z-index: 1;
}

.wide-section:hover .section-overlay {
  transform: translateX(100%);
  opacity: 0;
}

.info-card.pro {
  border: 1px solid rgba(255, 26, 26, 0.5);
  box-shadow: 0 0 25px rgba(255, 26, 26, 0.35);
}

.info-card.pro:hover {
  border-color: #ff1a1a;
  box-shadow: 0 0 35px rgba(255, 26, 26, 0.6);
}

.info-card.pro h3 {
  background: linear-gradient(90deg,#ff1a1a,#ff4d4d,#cc0000,#ff1a1a);
  background-size: 300%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: redPulse 2.5s linear infinite;
}

/* ===== МОБІЛЬНА ОПТИМІЗАЦІЯ ===== */
@media (max-width: 1000px) {
  /* Основна мобільна оптимізація */
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  body {
    padding-bottom: 75px !important;
    box-sizing: border-box;
    display: block !important;
    text-align: left !important;
  }
  .main-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 14px 40px 14px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
  }

  .quad-wrapper,
  .main-content {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .quad-section,
  .sections {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .info-card-link {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
  }

  /* ===== Картки info-card ===== */
  .info-card {
    width: 100% !important;
    min-height: 200px !important;
    height: auto !important;
    margin-bottom: 0 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    border-radius: 16px !important;
  }

  .info-card img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
    display: block !important;
  }

  .card-content {
    padding: 15px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: left !important;
  }

  .card-content h3 {
    font-size: 1.25rem !important;
    margin-bottom: 8px !important;
  }

  .card-content p {
    font-size: 0.92rem !important;
    padding-right: 0 !important;
    margin: 0 !important;
  }

  .wide-section {
    width: 100% !important;
    min-height: auto !important;
    margin-bottom: 16px !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    flex-direction: column !important;
    justify-content: center !important;
  }

  .section-content {
    padding: 0 !important;
    max-width: 100% !important;
  }

  /* ===== PRO Plans & Dynamic Elements ===== */
  .empty-state {
    padding: 30px 15px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .loading-spinner {
    padding: 30px 10px !important;
    font-size: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .promo-banner {
    padding: 20px 14px !important;
    margin-top: 25px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .promo-banner h2 {
    font-size: 20px !important;
  }

  .promo-banner p {
    font-size: 14px !important;
  }

  .promo-banner button,
  .promo-banner .action-btn {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 16px !important;
    font-size: 15px !important;
  }

  /* Completely hide desktop bilateral ad sidebars on mobile */
  .sidebar.left-ads,
  .sidebar.right-ads {
    display: none !important;
  }

  /* ===== Ховаємо елементи ===== */
  .center-copy, .language-select, .site-logo { display: none !important; }

  /* ===== Верхня панель ===== */
  header {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 52px !important;
    padding: 8px 10px !important;
    background-color: rgba(15, 17, 26, 0.95) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
  }

  .left-side {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    overflow: hidden !important;
  }

  .nav-buttons {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    gap: 8px !important;
    padding: 2px 4px !important;
    box-sizing: border-box !important;
  }

  .nav-buttons::-webkit-scrollbar {
    display: none;
  }

  .nav-button {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 7px 12px !important;
    border-radius: 9px !important;
    background: rgba(255, 26, 26, 0.08) !important;
    border: 1px solid rgba(255, 26, 26, 0.22) !important;
    font-size: 13px !important;
    color: #fff !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    touch-action: manipulation !important;
  }

  .nav-button:hover, .nav-button:active {
    background: rgba(255, 26, 26, 0.22) !important;
    border-color: #ff1a1a !important;
  }
}

/* ===== Нижня панель для мобільних ===== */
.bottom-panel {
  display: none;
  width: 100%;
  max-width: 100%;
  min-height: 60px;
  background-color: rgba(20,20,30,0.95);
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 1000;
  padding: 0 10px;
  color: #fff;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
  font-size: clamp(12px,3vw,16px);
  justify-content: center;
  align-items: center;
}

.bottom-panel .panel-content {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  gap: 10px;
}

.bottom-panel .panel-content .center-copy,
.bottom-panel .panel-content .language-select {
  display: flex;
  align-items: center;
  color: #fff;
}

.bottom-panel .language-select select {
  background-color: rgba(30,30,40,0.9);
  border: 1px solid #ff1a1a;
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.bottom-panel .language-select select:hover {
  background-color: rgba(50,50,60,0.95);
}

.bottom-panel .language-select select:focus {
  outline: none;
}

.bottom-panel .language-select select option {
  background-color: #20202a;
  color: #fff;
}

@media (max-width: 1000px) {
  .bottom-panel {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 8px 14px !important;
    min-height: 56px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    left: 0 !important;
    right: 0 !important;
  }

  .bottom-panel .panel-content {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 12px !important;
    padding: 0 4px !important;
    box-sizing: border-box !important;
  }
}
