/**
 * Shared base styles for image-tools apps
 * Include this file and then override with app-specific theme colors
 */

/* ========== CSS Variables ========== */
:root {
  --content-width: 970px;
  --color-dark: #38404B;
  --color-text: #333;
  --color-text-light: #666;
  /* Theme colors - override in app-specific CSS */
  --color-primary: #2a73d9;
  --color-success: #1a7030;
  --color-danger: #D44D3B;
}

/* ========== Reset ========== */
html {
  height: 100%;
  box-sizing: border-box;
  -webkit-text-size-adjust: none;
  overflow-x: hidden;
}

body {
  background-color: #fdfdfd;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

html, input, button {
  font-family: Helvetica, Arial, sans-serif;
}

*, *:before, *:after {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
}

/* ========== Layout ========== */
.page {
  flex: 1;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.page__header {
  margin-bottom: 2em;
  width: 100%;
}

.page__files {
  position: relative;
  width: 100%;
  max-width: var(--content-width);
}

.page__switch {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  margin-bottom: -1px;
  position: relative;
  z-index: 2;
}

@media screen and (max-width: 970px) {
  .page {
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media screen and (max-width: 555px) {
  .page {
    padding-left: 8px;
    padding-right: 8px;
  }
}

/* ========== Topbar ========== */
.topbar {
  width: 100%;
  border-bottom: 1px solid #e0e0e0;
  background-color: #fff;
}

.topbar__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1em 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar__logo {
  height: 40px;
}

.topbar__logo .logo__image {
  height: 100%;
  width: auto;
}

@media screen and (max-width: 970px) {
  .topbar__inner {
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media screen and (max-width: 555px) {
  .topbar__inner {
    padding-left: 8px;
    padding-right: 8px;
  }
}

/* ========== Logo ========== */
.logo {
  display: inline-block;
}

.logo__image {
  display: inline-block;
  vertical-align: top;
  max-width: 100%;
  height: 100%;
}

/* ========== Header ========== */
.header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.header__title {
  font-size: 2em;
  text-align: center;
  color: var(--color-dark);
  margin-top: 1.5em;
  margin-bottom: 1em;
  font-weight: 700;
  width: 100%;
}

.header__text {
  line-height: 1.4;
  font-size: 1.07em;
}

.header__text_mb {
  margin-bottom: 1em;
}

.header__list {
  list-style: none;
}

.header__list-item {
  position: relative;
  padding-left: 1.25em;
  line-height: 1.4;
  font-size: 1.07em;
}

.header__list-item:not(:last-child) {
  margin-bottom: 0.5em;
}

.header__list-item:before {
  content: '•';
  position: absolute;
  top: 0;
  left: 0;
  color: #9ca0a5;
}

@media screen and (max-width: 555px) {
  .header__list {
    display: none;
  }
}

/* ========== Buttons ========== */
.button {
  position: relative;
  background: none;
  outline: none;
  border: none;
  cursor: pointer;
  background-color: var(--color-primary);
  border: 1px solid var(--color-primary);
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: 0.875em;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 6px;
  height: 2.5em;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0 0.9em;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
  min-width: 11em;
  transition: color 0.2s ease-out, background-color 0.2s ease-out, border-color 0.2s ease-out, opacity 0.2s ease-out;
}

.button:disabled, .button_disabled {
  opacity: 0.4;
  pointer-events: none;
}

.button:hover {
  background-color: #fff;
  color: var(--color-primary);
  transition: color 0.05s ease-in, background-color 0.05s ease-in, border-color 0.05s ease-in;
}

.button_success {
  background-color: var(--color-success);
  border-color: var(--color-success);
}

.button_success:hover {
  color: var(--color-success);
}

.button_secondary {
  background-color: var(--color-danger);
  border-color: var(--color-danger);
}

.button_secondary:hover {
  color: var(--color-danger);
}

.button_dark {
  background-color: var(--color-dark);
  border-color: var(--color-dark);
  color: #fff;
}

.button_dark:hover {
  color: var(--color-dark);
}

.button_min {
  min-width: 0;
  padding: 0 0.5em;
  height: 2em;
}

.button__icon {
  width: 1.15em;
  height: 1.15em;
  fill: currentColor;
  margin-right: 0.75em;
  margin-left: -0.1em;
}

.button__counter {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(55%, -35%);
  font-size: 0.85em;
  font-weight: 700;
  width: 24px;
  height: 24px;
  line-height: 22px;
  text-align: center;
  background-color: var(--color-dark);
  border: 1px solid #fff;
  color: #fff;
  border-radius: 50%;
  box-shadow: 0px 3px 4px -2px rgba(0, 0, 0, 0.6);
  transition: background-color 0.2s ease-out;
}

.button_success .button__counter {
  background-color: var(--color-success);
}

@media screen and (max-width: 767.98px) {
  .button {
    font-size: 0.75em;
  }
}

@media screen and (max-width: 555px) {
  .button {
    font-size: clamp(0.65rem, 2.5vw, 0.875rem);
  }
}

@media screen and (max-width: 394.98px) {
  .button {
    font-size: 0.625em;
  }
}

/* ========== Language Selector ========== */
.language {
  position: relative;
  z-index: 7;
}

.language__button {
  background: none;
  outline: none;
  border: none;
  cursor: pointer;
  font-size: 0.875em;
  height: 2.5em;
  padding: 0 1em;
  color: var(--color-primary);
  background-color: transparent;
  transition: color 0.2s ease-out, background-color 0.2s ease-out;
  align-items: center;
  justify-content: center;
  display: flex;
  border: 1px solid var(--color-primary);
  border-radius: 6px;
  font-weight: 600;
}

.language__button:hover {
  background-color: var(--color-primary);
  color: #fff;
}

.language__text {
  margin-right: 0.5em;
}

.language__icon {
  fill: currentColor;
  transition: transform 0.2s ease-out;
}

.language__overflow {
  position: absolute;
  border: 1px solid var(--color-primary);
  background-color: #fff;
  border-radius: 0.25em;
  box-shadow: 0px 2px 10px rgba(42, 115, 217, 0.2);
  overflow: hidden;
  z-index: 1;
  top: 100%;
  margin-top: 0.625em;
  right: 0;
  opacity: 0;
  transform: translateY(-0.3em);
  pointer-events: none;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.language__list {
  padding: 0.3em 0;
  overflow: auto;
  list-style: none;
  max-height: 300px;
}

.language__title {
  display: block;
  text-decoration: none;
  color: #000;
  padding: 0.2em 1.4em;
  white-space: nowrap;
}

.language__title:hover {
  background-color: #eaf1fb;
}

.language__title_selected {
  font-weight: 600;
  color: var(--color-primary);
}

.language_active .language__button {
  background-color: var(--color-primary);
  color: #fff;
  transition: color 0.05s ease-in, background-color 0.05s ease-in;
}

.language_active .language__icon {
  transform: rotate(180deg);
}

.language_active .language__overflow {
  opacity: 1;
  transform: translateY(-2px);
  pointer-events: auto;
  transition: opacity 0.05s ease-in, transform 0.05s ease-in;
}

@media screen and (max-width: 767.98px) {
  .language__button {
    font-size: 0.75em;
  }
}

@media screen and (max-width: 394.98px) {
  .language__button {
    font-size: 0.625em;
  }
}

/* ========== Files Container ========== */
.files {
  position: relative;
  margin-bottom: 3em;
  background-color: #fff;
  width: 100%;
  max-width: var(--content-width);
  border-radius: 0 0 0.75em 0.75em;
  border: 1px solid #F2F2F2;
  box-shadow: 0px 5px 16px -2px rgba(42, 115, 217, 0.2);
  font-size: 1em;
  padding: 1.6em 0;
  user-select: none;
}

.files__buttons {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1em;
  padding: 0 1em;
}

.files__buttons:not(:last-child) {
  margin-bottom: 0.7em;
}

.files__button_mr {
  margin-right: 1.35em;
}

.files__input-files {
  position: absolute;
  top: 0;
  left: 0;
  visibility: hidden;
}

.files__list-outer {
  position: relative;
  width: 100%;
  height: calc(163px + 20px);
  margin-bottom: 0.7em;
  overflow: hidden;
}

.files__list-outer_dragover {
  background-color: rgba(42, 115, 217, 0.05);
}

.files__list {
  position: relative;
  height: calc(163px + 20px);
  padding: 10px 0 10px 3em;
  overflow: auto;
  display: flex;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.files__list::-webkit-scrollbar {
  display: none;
}

.files__list:after {
  content: '';
  display: inline-block;
  height: 100%;
  width: 3em;
  flex-shrink: 0;
}

.files__list-inner {
  position: relative;
  z-index: 1;
  flex-wrap: nowrap;
  list-style: none;
  display: flex;
  flex-shrink: 0;
  height: 163px;
}

.files__file {
  width: 163px;
  height: 100%;
  flex-shrink: 0;
}

.files__file:not(:last-child) {
  margin-right: 0.875em;
}

.files__drop-caption {
  position: absolute;
  z-index: 0;
  top: 0.5em;
  bottom: 0.5em;
  left: 3em;
  right: 3em;
}

.files__scroll-button {
  position: absolute;
  z-index: 3;
  top: 0;
  height: 100%;
  width: 2.6em;
  font-size: 1em;
}

.files__scroll-button:after {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  background-image: linear-gradient(270deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.75), #fff);
}

.files__scroll-button_prev {
  left: -1px;
}

.files__scroll-button_next {
  right: -1px;
}

.files__scroll-button_next:after {
  transform: rotate(180deg);
}

@media screen and (max-width: 970px) {
  .files__list-outer {
    height: calc(150px + 20px);
  }

  .files__list {
    height: calc(150px + 20px);
  }

  .files__list-inner {
    height: 150px;
  }

  .files__file {
    width: 150px;
  }
}

@media screen and (max-width: 555px) {
  .files {
    padding: 1em 0;
  }
}

/* ========== Drop Caption ========== */
.drop-caption {
  opacity: 1;
  transition: opacity 0.2s ease-out;
}

.drop-caption_hidden {
  transition: opacity 0.05s ease-in;
  opacity: 0;
  pointer-events: none;
}

.drop-caption__border {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  stroke: #b5cef2;
  stroke-dasharray: 10 10;
  stroke-dashoffset: 0;
  stroke-width: 2px;
}

.drop-caption__text {
  font-size: 1em;
  font-weight: 600;
  color: #b5cef2;
  position: absolute;
  top: 50%;
  width: 100%;
  text-align: center;
  letter-spacing: 0.02em;
  transform: translateY(-50%);
}

/* ========== Scroll Button ========== */
.scroll-button {
  background: none;
  outline: none;
  border: none;
  cursor: pointer;
  color: var(--color-danger);
  transition: color 0.2s ease-out, opacity 0.2s ease-out;
}

.scroll-button:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.scroll-button__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  fill: currentColor;
  width: 1.1em;
  height: 2.2em;
  filter: drop-shadow(0 2px 4px #fff);
  transition: transform 0.2s ease-out;
}

.scroll-button__icon_left {
  transform: translate(-50%, -50%) rotate(180deg);
}

.scroll-button:not(:disabled):hover .scroll-button__icon {
  transform: translate(calc(-50% + 3px), -50%);
  transition: transform 0.05s ease-in;
}

.scroll-button:not(:disabled):hover .scroll-button__icon_left {
  transform: translate(calc(-50% - 3px), -50%) rotate(180deg);
}

/* ========== File Card ========== */
.file {
  position: relative;
  z-index: 1;
  border-radius: 8px;
  cursor: default;
  opacity: 1;
  transition: transform 0.35s, opacity 0.35s;
}

.file:after {
  content: '';
  position: absolute;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.file::before {
  content: '';
  position: absolute;
  top: -0.4em;
  left: -0.4em;
  right: -0.4em;
  bottom: -0.4em;
  border-radius: 0.75em;
  border: 3px solid var(--color-dark);
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
  transform-origin: center center;
  transition: opacity 0.35s, transform 0.35s;
}

.file_active::before {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.05s ease-in, transform 0.05s ease-in;
}

.file_can-setting {
  cursor: pointer;
}

.file__header {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  color: #fff;
  padding: 0.25em 0.25em 0.25em 0.75em;
}

.file__footer {
  position: absolute;
  z-index: 3;
  bottom: 0.5em;
  left: 0.5em;
  right: 0.5em;
  width: auto;
  opacity: 0.95;
}

.file__content,
.review__thumb {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
    linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
    linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.file__content {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  outline: none;
}

.file__content:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.2);
}

.file__image {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border: none;
  object-fit: contain;
  transition: opacity 0.2s ease-out;
}

.file__image_hidden {
  opacity: 0;
}

.file__close {
  position: relative;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  display: inline-block;
  font-size: 1em;
  color: inherit;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  width: 1.25em;
  height: 1.25em;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
  transition: color 0.2s ease-out, background-color 0.2s ease-out, opacity 0.2s ease-out;
}

.file__close:hover {
  color: var(--color-danger);
  filter: none;
}

.file__close:hover::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background-color: #fff;
  border-radius: 2px;
  z-index: -1;
}

.file__close-icon {
  display: inline-block;
  vertical-align: top;
  fill: currentColor;
}

.file__title {
  white-space: nowrap;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.75em;
  margin-right: 1em;
  font-weight: 600;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.25);
}

.file__state {
  border: none;
  background: none;
  outline: none;
  position: absolute;
  font-size: 1em;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.2s ease-out;
  pointer-events: none;
}

.file__state_visible {
  opacity: 1;
}

.file__state_error.file__state_visible {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: none;
  background-color: #999;
}

.file__state-icon {
  margin-bottom: 0.25em;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.file__state-text {
  color: #fff;
  font-size: 0.9375em;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.file__state_pending .file__state-text_format,
.file__state_done .file__state-text_format {
  font-size: 1.5em;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.file__state-text_saving {
  font-size: 2.625em;
  font-weight: 600;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.file__save-btn {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1.75em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25em;
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 0 0 7px 7px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.file__save-btn:hover {
  background-color: var(--color-dark);
}

.file__save-icon {
  flex-shrink: 0;
}

/* ========== File Button (Progress) ========== */
.file-button {
  position: relative;
  z-index: 2;
  display: block;
  font-size: 0.75em;
  background-color: rgba(200, 230, 200, 0.85);
  height: 2em;
  line-height: 2em;
  text-align: center;
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
  border: none;
  outline: none;
  cursor: default;
  transition: background-color 0.2s ease-out, opacity 0.2s ease-out;
}

.file-button:not(:disabled) {
  cursor: pointer;
}

.file-button:not(:disabled):hover {
  background-color: rgba(255, 255, 255, 0.85);
}

.file__button {
  box-shadow: 0 10px 8px -8px rgba(0, 0, 0, 0.125);
}

.file-button__text {
  position: relative;
  z-index: 3;
  color: #000;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0px 0px 2px #fff;
}

.file-button__text_title {
  text-transform: uppercase;
}

.file-button__progress {
  position: absolute;
  z-index: -1;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background-color: #eee;
  background-image: linear-gradient(0deg, #e0e0e0, #f5f5f5);
  transition: width 0.05s ease-in;
}

.file-button__progress:after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background-image: linear-gradient(-45deg, rgba(128, 128, 128, 0.4) 25%, rgba(128, 128, 128, 0) 25%, rgba(128, 128, 128, 0) 50%, rgba(128, 128, 128, 0.4) 50%, rgba(128, 128, 128, 0.4) 75%, rgba(128, 128, 128, 0) 75%, rgba(128, 128, 128, 0));
  background-size: 42px 42px;
  animation: move 3.5s linear infinite;
}

.file-button__progress_pause:after {
  animation-play-state: paused;
}

.file-button__progress_pause {
  opacity: 0.25;
}

.file-button__progress_hidden {
  display: none;
}

.file-button_hidden {
  opacity: 0;
}

@keyframes move {
  0% { background-position: 0 0; }
  100% { background-position: 42px 42px; }
}

/* ========== Footer ========== */
.footer {
  width: 100%;
  border-top: 1px solid #e0e0e0;
  background-color: #fff;
}

.footer__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1em 0;
  text-align: center;
}

@media screen and (max-width: 970px) {
  .footer__inner {
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media screen and (max-width: 555px) {
  .footer__inner {
    padding-left: 8px;
    padding-right: 8px;
  }
}

.footer__text {
  width: 100%;
  font-size: 0.9em;
  letter-spacing: 0.04em;
  color: #000;
}

.footer__text + .footer__text {
  margin-top: 1em;
}

.footer__link {
  color: var(--color-primary);
  text-decoration: none;
}

.footer__link:hover {
  text-decoration: underline;
}

/* ========== Popup / Modal ========== */
.popup {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  display: none;
  background-color: rgba(56, 64, 75, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.popup_visible {
  display: flex;
  opacity: 1;
}

.popup__close {
  cursor: pointer;
  background: none;
  border: none;
  outline: none;
  position: absolute;
  color: #666;
  font-size: 1em;
  height: 1.5em;
  width: 1.5em;
  right: 1em;
  top: 1em;
  transition: color 0.2s ease-out;
}

.popup__close:hover {
  color: var(--color-danger);
}

.popup__close-icon {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.popup__overflow {
  position: relative;
  pointer-events: auto;
  max-width: 700px;
  width: calc(100% - 40px);
  min-height: auto;
  max-height: 80vh;
  margin: auto;
  font-size: 1em;
  background-color: #fff;
  border-radius: 1em;
  box-shadow: 0px 5px 30px -2px rgba(42, 115, 217, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.popup__title {
  position: relative;
  padding: 1em 3em 1em 1.5em;
  font-size: 1.2em;
  font-weight: 600;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.popup__content {
  overflow: auto;
  padding: 1em 1.5em;
}

.popup__content p {
  margin: 1em 0;
  font-size: 0.95em;
  line-height: 1.5;
  color: #333;
}

.popup__content h2 {
  font-size: 1.1em;
  margin: 1.5em 0 0.5em;
  color: var(--color-dark);
}

.popup__content a {
  color: var(--color-primary);
}

/* ========== Error Page ========== */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 2em;
}

.error-page__code {
  font-size: 5em;
  font-weight: 700;
  margin-bottom: 0.2em;
}

.error-page__code_404 {
  color: var(--color-primary);
}

.error-page__code_500 {
  color: var(--color-danger);
}

.error-page__text {
  font-size: 1.25em;
  color: #666;
  margin-bottom: 1.5em;
}

/* ========== Site Switch Tabs ========== */
.site-switch {
  display: flex;
  gap: 3px;
  width: 100%;
}

.site-switch__tab {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: #38404B;
  background: #eaeaea;
  border: 1px solid #F2F2F2;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  transition: background-color 0.2s, color 0.2s;
  position: relative;
}

.site-switch__tab:hover {
  background: #f2f2f2;
  color: #38404B;
}

.site-switch__tab_active {
  background: #fff;
  color: #d1580a;
  cursor: default;
  z-index: 1;
  box-shadow: 0px -3px 12px -2px rgba(42, 115, 217, 0.15);
}

.site-switch__tab_active:hover {
  background: #fff;
  color: #d1580a;
}

.site-switch__tab_right {
  margin-left: auto;
}

.site-switch__text {
  display: block;
}

@media screen and (max-width: 555px) {
  .site-switch__tab {
    padding: 6px 14px;
    font-size: 13px;
  }
}

/* ========== Loader Animation ========== */
.loader {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 40px;
  color: var(--color-dark);
  transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
}

.loader_hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
}

.loader i {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 20px 20px;
  animation: loader-spin 1.2s linear infinite;
}

.loader i::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 19px;
  width: 2px;
  height: 9px;
  border-radius: 20%;
  background: currentColor;
}

.loader i:nth-child(1) { transform: rotate(0deg); animation-delay: -1.1s; }
.loader i:nth-child(2) { transform: rotate(30deg); animation-delay: -1.0s; }
.loader i:nth-child(3) { transform: rotate(60deg); animation-delay: -0.9s; }
.loader i:nth-child(4) { transform: rotate(90deg); animation-delay: -0.8s; }
.loader i:nth-child(5) { transform: rotate(120deg); animation-delay: -0.7s; }
.loader i:nth-child(6) { transform: rotate(150deg); animation-delay: -0.6s; }
.loader i:nth-child(7) { transform: rotate(180deg); animation-delay: -0.5s; }
.loader i:nth-child(8) { transform: rotate(210deg); animation-delay: -0.4s; }
.loader i:nth-child(9) { transform: rotate(240deg); animation-delay: -0.3s; }
.loader i:nth-child(10) { transform: rotate(270deg); animation-delay: -0.2s; }
.loader i:nth-child(11) { transform: rotate(300deg); animation-delay: -0.1s; }
.loader i:nth-child(12) { transform: rotate(330deg); animation-delay: 0s; }

@keyframes loader-spin {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* ========== Shimmer Hint Animation ========== */
@keyframes hint-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.hint-shimmer::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: hint-shimmer 0.6s ease-in-out;
  pointer-events: none;
  clip-path: inset(0 round 6px);
}

/* ========== Long Content (Article) ========== */
.long {
  padding: 1em 0 2em 0;
  line-height: 1.4;
  font-size: 1.07em;
}

.long h1 {
  font-size: 1.4em;
  text-align: left;
  color: var(--color-dark);
  border-bottom: 2px solid #F2F2F2;
}

.long h2 {
  font-size: 1.2em;
  text-align: left;
  color: var(--color-dark);
}

.long p {
  margin: 1em 0 1em 0;
}

.long ul {
  display: block;
  list-style-type: disc;
  margin-block-start: 1em;
  margin-block-end: 1em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  padding-inline-start: 40px;
}

.long li {
  margin: 0.5em 0;
}

.long ol {
  display: block;
  list-style-type: decimal;
  margin-block-start: 1em;
  margin-block-end: 1em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  padding-inline-start: 40px;
}

.long h3 {
  font-size: 1.1em;
  margin-top: 1.5em;
  color: var(--color-dark);
}
