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;
}

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;
  gap: 20px;
}

.nav-button {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.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;
}

/* === ЕТАЛОННЕ ЧЕРВОНЕ ПЕРЕЛИВАННЯ (100% копія .nav-button-pro 'Додатки') === */
.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;
}

.red-shimmer,
.shimmer-pro,
.red-pulse,
.red-arrow,
.map-arrow,
.goal-arrow {
  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;
  display: inline-block;
  text-shadow: none;
}

@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 .link-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;
}

.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;
}

.main-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;  
  gap: 20px;
}

.sidebar.left-ads {
  position: fixed;
  top: 70px;
  left: 0; /* Відступ від лівого краю */
  width: 16.302%;
  height: 92vh; /* Висока висота */
  z-index: 999;
  box-shadow: 0 0 20px rgba(0, 0, 0, 1);
}

.sidebar.right-ads {
  position: fixed;
  top: 70px;
  right: 0; /* Відступ від лівого краю */
  width: 16.302%;
  height: 92vh; /* Висока висота */
  z-index: 999;
  box-shadow: 0 0 20px rgba(0, 0, 0, 1);
}

.ad-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.ad-block {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 0;
}

.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);
  box-sizing: border-box;
}

.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);
  box-sizing: border-box;
}

/* ====== QUAD SECTION (4 картки 2x2) ====== */
.quad-wrapper {
  width: 62.5vw;
  margin: 40px 0; /* 40px зверху, авто з боків, 0 знизу */
  display: flex;
  gap: 2.77vh 1.56vw;
  justify-content: center;
  padding: 0 20px;
}

/* Ліва та права колонки */
.column {
  flex: 1;
  width: 30vw;    /* максимальна ширина колонки */
  display: flex;
  flex-direction: column;
  gap: 2.77vh 1.56vw;          /* відступ між боксами в колонці */
}

.day-box {
  position: relative;
  background: #222;
  border-radius: 12px;
  overflow: hidden;
  cursor: default;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
  width: 100%;
  height: 60.5vh;       /* максимальна висота */
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.day-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.9);
}

.day-box .card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.35) 30%, rgba(0, 0, 0, 0.9) 100%);
  z-index: 1;
}

.day-box h3 {
  position: relative;
  z-index: 2;
  margin: 15px 20px 10px;
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
}

.day-box ul {
  position: relative;
  z-index: 2;
  list-style: none;
  padding-left: 20px;
  margin: 0 20px 15px 20px;
  color: #ddd;
  overflow-y: auto;
  overflow-x: hidden;
  flex-grow: 1;
  scrollbar-width: thin;
  scrollbar-color: #ff4444 transparent;
  max-height: calc(580px - 70px); /* Відняти місце для заголовку та паддінгів */
}

.day-box ul::-webkit-scrollbar {
  width: 6px;
}

.day-box ul::-webkit-scrollbar-track {
  background: transparent;
}

.day-box ul::-webkit-scrollbar-thumb {
  background-color: #ff4444;
  border-radius: 3px;
}

.day-box ul li {
  margin-bottom: 6px;
  font-size: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 2px;
  transition: color 0.22s cubic-bezier(0.2, 0, 0, 1), transform 0.22s cubic-bezier(0.2, 0, 0, 1);
}

.day-box ul li:last-child {
  border-bottom: none;
}

.day-box ul li:hover,
.day-box ul li.clickable: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;
  transform: translateX(8px);
  cursor: pointer;
}

.day-box ul li.rest-day-item,
.day-box ul li.rest-day-item:hover {
  color: #777 !important;
  -webkit-text-fill-color: #777 !important;
  background: none !important;
  transform: none !important;
  cursor: default !important;
  font-style: italic;
}

/* ===== МОБІЛЬНА ОПТИМІЗАЦІЯ ===== */
@media (max-width: 830px) {
  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 {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  .column {
    width: 100% !important;
    max-width: 100% !important;
    gap: 16px !important;
  }

  .day-box {
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    box-sizing: border-box !important;
  }

  .day-box ul {
    max-height: none !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;
  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;
  gap: 0; /* прибираємо відстань між дочірніми елементами */
}

.bottom-panel .panel-content {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0;
  gap: 0; /* прибираємо відстань між дочірніми елементами */
}

.bottom-panel .panel-content .center-copy,
.bottom-panel .panel-content .language-select {
  display: flex;
  align-items: center;
  color: #fff;
  gap: 0; /* прибираємо відступи */
}

.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;
    justify-content: center;
    align-items: center;
    padding: 0;
    gap: 0; /* прибираємо відстань між елементами */
  }
}

/* ===== PRO PLAN VIEW ===== */
#pro-plan-view {
  box-sizing: border-box;
}

.pro-plan-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 0 12px rgba(255, 26, 26, 0.3);
}

@media (max-width: 830px) {
  #pro-plan-view {
    width: 100% !important;
    padding: 0 10px !important;
  }
  #pro-plan-view > div:first-child {
    flex-direction: column !important;
    gap: 15px !important;
    text-align: center;
  }
  #pro-plan-view > div:first-child > div:last-child {
    justify-content: center !important;
  }
}

/* ===== НАВЧАЛЬНІ ПЛАНИ (ELEMENT LEARNING PLANS) ===== */
.stage-goal-box {
  position: relative;
  z-index: 2;
  margin: 0 20px 12px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 26, 26, 0.4);
  border-left: 4px solid #ff1a1a;
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.9);
  color: #ffffff;
  font-size: 14.5px;
  line-height: 1.45;
  box-sizing: border-box;
}

.stage-goal-box.final-goal-box {
  background: rgba(0, 0, 0, 0.9);
  border-color: rgba(255, 179, 0, 0.5);
  border-left-color: #ffb300;
}

/* Права колонка з мапою прогресії */
.column.element-map-col {
  position: relative !important;
  align-self: stretch !important;
}

.element-map-card {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: max(85px, calc(35px + 19.75vh)) !important;
  height: 60.5vh !important;
  max-height: 60.5vh !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 26, 26, 0.25) !important;
  border: 1px solid rgba(255, 26, 26, 0.35) !important;
  box-sizing: border-box !important;
}

.element-map-card:hover {
  transform: none !important;
  box-shadow: 0 0 35px rgba(255, 26, 26, 0.45) !important;
}

.element-map-card h3 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.element-map-card ul {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2px;
}

.element-map-card ul li {
  margin-bottom: 2px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.element-map-card ul li:last-child {
  border-bottom: none;
}

.element-map-card ul li .map-req,
.element-map-card ul li .map-target {
  color: #ffffff;
  font-weight: 500;
  transition: color 0.22s ease;
}

.element-map-card ul li .map-target {
  font-weight: 600;
}

.element-map-card ul li:hover .map-req,
.element-map-card ul li:hover .map-target {
  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;
}

.map-step-pill {
  font-size: 11px;
  font-weight: 800;
  border: 1px solid rgba(255, 26, 26, 0.4);
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  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;
}

.map-step-pill.gold-pill {
  color: #ffb300 !important;
  -webkit-text-fill-color: #ffb300 !important;
  background: rgba(255, 179, 0, 0.15) !important;
  background-clip: border-box !important;
  -webkit-background-clip: border-box !important;
  animation: none !important;
  border-color: rgba(255, 179, 0, 0.4) !important;
  font-size: 12px;
}

@media (max-width: 830px) {
  .element-map-card {
    position: static !important;
    height: auto !important;
    min-height: 380px !important;
    max-height: none !important;
    margin-top: 20px;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  header, .sidebar, .bottom-panel, .pro-plan-btn, .back-button, .link-button {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  #pro-plan-view {
    width: 100% !important;
    margin: 0 !important;
    padding: 10px !important;
  }
  #pro-plan-view * {
    color: #000 !important;
    background: #fff !important;
    border-color: #ddd !important;
    box-shadow: none !important;
  }
  #pro-plan-view h2, #pro-plan-view h3 {
    color: #000 !important;
  }
  #pro-plan-view div[style*="background:linear-gradient"] {
    background: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
