/**
 * TabNav Popup - Isolated Styles
 * This file contains ONLY popup-specific styles with high specificity to prevent conflicts.
 * Loads last on every page to ensure consistent styling.
 */

/* Base colors */
:root {
  --tnv-button-color: #8e56dc;
  --tnv-title-color: #3b3f44;
  --tnv-text-color: #6e6b78;
}

/* Screen reader only class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Popup overlay */
.tnv-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  direction: rtl;
}

.tnv-popup-overlay *:focus-visible {
  outline: 2px black solid;
  outline-offset: 3px;
}

.tnv-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Popup container */
.tnv-popup-container {
  background-color: white;
  border-radius: 20px;
  width: 95%;
  max-width: 1404px;
  position: relative;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.3s;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
  z-index: 32767;
}

.tnv-popup-overlay.active .tnv-popup-container {
  transform: scale(1);
}

/* Close button */
.tnv-popup-close {
  position: absolute;
  top: 12px;
  left: 12px;
  background: transparent;
  border: none;
  font-size: 26px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #444;
  z-index: 10;
  border-radius: 50%;
  transition: background-color 0.2s;
  font-weight: bold;
}

.tnv-popup-close:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Popup content - two columns */
.tnv-popup-content {
  display: flex;
  flex-direction: row-reverse; /* Image on left in RTL */
}

/* Left side - image (will appear on left in RTL) */
.tnv-popup-left {
  flex: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tnv-popup-main-img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

/* Right side - content */
.tnv-popup-right {
  flex: 0.8;
  padding: 40px;
  text-align: right;
  display: flex;
  flex-direction: column;
  padding-left: 0;
}

/* Logo header */
.tnv-popup-header {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 30px;
}

.tnv-popup-logo-text {
  display: flex;
  flex-direction: column;
  margin-right: 10px;
  text-align: right;
}

.tnv-popup-logo-text span:first-child {
  font-weight: 600;
  font-size: 19px;
  color: var(--tnv-title-color);
}

.tnv-popup-subtitle {
  font-size: 16px;
  color: #666;
}

.tnv-popup-logo-icon {
  display: flex;
  justify-content: center;
  align-items: center;
}

.tnv-popup-logo-img {
  width: 50px;
  height: 50px;
}

/* Title */
.tnv-popup-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--tnv-title-color);
  line-height: 1.3;
  margin-top: 40px;
  max-width: 500px;
}

/* Description */
.tnv-popup-description {
  font-size: 16px;
  color: var(--tnv-text-color);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* Buttons */
.tnv-popup-buttons {
  display: flex;
  margin-top: 20px;
  align-items: center;
  gap: 36px;
}

/* Footer text */
.tnv-popup-footer {
  color: var(--tnv-text-color);
  font-size: 14px;
  margin-top: auto;
}

/* ========================================
   POPUP-SPECIFIC BUTTON STYLES
   Unique class names to prevent any conflicts
   ======================================== */

/* Primary CTA button inside popup */
.tnv-popup-primary-btn {
  font-weight: 400;
  background: #8e56dc;
  font-size: 0.9rem;
  letter-spacing: 0.05rem;
  box-shadow: inset 0 1px 0 hsla(0, 0%, 100%, 0.15),
    0 1px 3px hsla(250, 84%, 38%, 0.25),
    0 2px 6px hsl(250deg 62.86% 2.64% / 48%),
    0 6px 10px -2px hsl(0deg 0% 0% / 17%);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  color: white;
  border: 2px solid transparent;
  padding: 9px 23px;
  border-radius: 7px;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.tnv-popup-primary-btn:hover {
  box-shadow: none;
  transform: translateY(1px);
  color: white;
  text-decoration: none;
}

.tnv-popup-primary-btn svg {
  width: 17px;
  height: 17px;
  margin-right: 8px;
  margin-top: 2px;
  stroke: white;
}

/* Secondary link button inside popup */
.tnv-popup-secondary-link {
  background: transparent;
  color: #3b3f44;
  border: none;
  padding: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.3s ease;
  font-size: 16px;
  font-weight: 400;
  margin-top: 0;
  margin-bottom: 0;
  position: relative;
}

.tnv-popup-secondary-link:hover {
  background: transparent;
  color: #3b3f44;
  text-decoration: none;
}

/* Text inside secondary link */
.tnv-popup-link-text {
  color: #3b3f44;
  position: relative;

  letter-spacing: 0.5px;
  font-size: 16px;
  font-family: "Roboto", sans-serif;
  margin-top: 0;
  margin-bottom: 0;
}

/* SVG arrow inside secondary link */
.tnv-popup-secondary-link svg {
  margin-right: 5px;
  margin-top: 0;
  margin-bottom: 0;
  width: 27px;
  fill: #3b3f44;
  transform: rotate(180deg) translateX(8px);
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

/* Hover state for secondary link SVG */
.tnv-popup-secondary-link:hover svg {
  transform: rotate(180deg) translateX(20px);
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

@media (max-width: 1000px) {
  .tnv-popup-overlay {
    align-items: flex-start;
    padding-top: 50px;
  }

  .tnv-popup-primary-btn {
    margin-top: 10px;
  }

  .tnv-popup-container {
    width: 95%;
    height: 100%;
    max-height: 440px;
    margin: auto auto;
    overflow: hidden;
  }

  .tnv-popup-container * {
    text-align: center;
  }

  .tnv-popup-buttons .tnv-popup-primary-btn {
    align-self: center;
    width: 70%;
    justify-content: center;
  }

  .tnv-popup-content {
    flex-direction: row;
    height: 100%;
  }

  .tnv-popup-left {
    order: 2;
    padding: 0px;
    margin: 15px;
    min-width: 450px;
  }

  .tnv-popup-right {
    order: 1;
    padding: 25px 49px;
    padding-left: 0;
  }

  .tnv-popup-buttons {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  h2.tnv-popup-title {
    font-size: 20px;
  }

  .tnv-popup-header {
    margin-bottom: 20px;
  }

  .tnv-popup-close {
    top: 10px;
    left: 10px;
    font-size: 28px;
    width: 40px;
    height: 40px;
  }

  .tnv-popup-description {
    font-size: 14px;
  }

  .tnv-popup-footer {
    font-size: 12px;
  }
}

@media (min-width: 762px) and (max-width: 1000px) {
  h2.tnv-popup-title {
    font-size: 18px;
  }

  .tnv-popup-container {
    font-size: 14px;
  }

  .tnv-popup-logo-text span:first-child {
    font-size: 17px;
  }

  .tnv-popup-description {
    font-size: 14px;
  }

  .tnv-popup-buttons .tnv-popup-primary-btn {
    font-size: 10.8px;
  }

  .home-to-overview,
  .home-to-overview * {
    font-size: 14px;
  }

  .tnv-popup-right {
    padding: 25px 20px;
  }

  .tnv-popup-subtitle {
    font-size: 14px;
  }

  .tnv-popup-main-img {
    min-width: 450px;
    height: 90%;
    margin: auto auto;
  }

  .tnv-popup-footer {
    font-size: 12px;
  }
}

/* Small screen specific styles */
@media (max-width: 762px) {
  .tnv-popup-overlay {
    padding-top: 0;
  }

  .tnv-popup-container {
    max-height: unset;
    border-radius: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding-top: 40px;
  }

  .tnv-popup-content {
    flex-direction: column;
    width: 90%;
    margin: 0 auto;
  }

  .tnv-popup-header {
    margin-bottom: 20px;
    text-align: right;
  }

  .tnv-popup-logo-text {
    text-align: right;
  }

  .tnv-popup-title {
    margin-bottom: 5px;
    text-align: right;
  }

  .tnv-popup-description {
    margin-bottom: 10px;
    text-align: right;
  }

  .tnv-popup-right {
    padding: 40px 16px;
  }

  .tnv-popup-buttons {
    flex-direction: row;
    margin-bottom: 25px;
    margin-top: 25px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .tnv-popup-buttons .tnv-popup-primary-btn {
    width: 100%;
    min-width: 185px;
  }

  .tnv-popup-left {
    margin: 0;
    min-width: unset;
    justify-content: start;
  }

  .tnv-popup-footer {
    margin-bottom: 0;
    margin-top: 0;
    text-align: right;
    font-size: 12px;
  }

  #home-to-overview {
    margin-top: 10px;
  }

  #home-to-overview > span {
    margin-top: 10px;
  }

  .tnv-popup-main-img {
    width: 100%;
    height: auto;
    min-width: unset;
    align-self: start;
  }
}

@media (max-width: 450px) {
  .tnv-popup-primary-btn {
    font-size: 0.55rem;
  }
}

/* Utility class for when popup is shown */
body.tnv-popup-open {
  overflow: hidden;
}

/* Hide progress bar when popup is open */
body.tnv-popup-open .reading-progressbar,
body.tnv-popup-open .js-reading-progressbar {
  display: none !important;
}

