/* =====================================================
   BASE + RESET
   ===================================================== */
/**
  Нормализация блочной модели
 */
*,
::before,
::after {
    box-sizing: border-box;
}

/**
  Убираем внутренние отступы слева тегам списков,
  у которых есть атрибут class
 */
:where(ul, ol):where([class]) {
    padding-left: 0;
}

/**
  Убираем внешние отступы body и двум другим тегам,
  у которых есть атрибут class
 */
body,
:where(blockquote, figure, fieldset):where([class]) {
    margin: 0;
}

/**
  Убираем внешние отступы вертикали нужным тегам,
  у которых есть атрибут class
 */
:where(
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  ul,
  ol,
  dl
):where([class]) {
    margin-block: 0;
}

:where(dd[class]) {
    margin-left: 0;
}

:where(fieldset[class]) {
    padding: 0;
    border: none;
}

/**
  Убираем стандартный маркер маркированному списку,
  у которого есть атрибут class
 */
:where(ul[class]) {
    list-style: none;
}

:where(address[class]) {
    font-style: normal;
}

/**
  Обнуляем вертикальные внешние отступы параграфа,
  объявляем локальную переменную для внешнего отступа вниз,
  чтобы избежать взаимодействие с более сложным селектором
 */
p {
    --paragraphMarginBottom: 24px;

    margin-block: 0;
}

/**
  Внешний отступ вниз для параграфа без атрибута class,
  который расположен не последним среди своих соседних элементов
 */
p:where(:not([class]):not(:last-child)) {
    margin-bottom: var(--paragraphMarginBottom);
}


/**
  Упрощаем работу с изображениями и видео
 */
img,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

/**
  Наследуем свойства шрифт для полей ввода
 */
input,
textarea,
select,
button {
    font: inherit;
}

html {
    /**
      Пригодится в большинстве ситуаций
      (когда, например, нужно будет "прижать" футер к низу сайта)
     */
    height: 100%;

    /**
      Плавный скролл
     */
    scroll-behavior: smooth;
}

body {
    /**
      Пригодится в большинстве ситуаций
      (когда, например, нужно будет "прижать" футер к низу сайта)
     */
    min-height: 100%;
    /**
      Унифицированный интерлиньяж
     */
    line-height: 1.5;
}

/**
  Нормализация высоты элемента ссылки при его инспектировании в DevTools
 */
a:where([class]) {
    display: inline-flex;
}

/**
  Курсор-рука при наведении на элемент
 */
button,
label {
    cursor: pointer;
}

/**
  Убирает серую подсветку при тапе на мобильных устройствах (iOS/Android)
 */
button {
    -webkit-tap-highlight-color: transparent;
}

/**
  Приводим к единому цвету svg-элементы
  (за исключением тех, у которых уже указан
  атрибут fill со значением 'none' или начинается с 'url')
 */
:where([fill]:not(
  [fill="none"],
  [fill^="url"]
)) {
    fill: currentColor;
}

/**
  Приводим к единому цвету svg-элементы
  (за исключением тех, у которых уже указан
  атрибут stroke со значением 'none')
 */
:where([stroke]:not(
  [stroke="none"],
  [stroke^="url"]
)) {
    stroke: currentColor;
}

/**
  Чиним баг задержки смены цвета при взаимодействии с svg-элементами
 */
svg * {
    transition-property: fill, stroke;
}

/**
  Приведение рамок таблиц в классический 'collapse' вид
 */
:where(table) {
    border-collapse: collapse;
    border-color: currentColor;
}

/**
  Удаляем все анимации и переходы для людей,
  которые предпочитают их не использовать
 */
@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    transition: background .4s, color .4s;
}
.glass {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.lang-btn {
    padding: .4rem 1rem;
    border-radius: .6rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: #bbb;
    transition: all .3s;
}
.lang-btn.active {
    background: rgba(167, 139, 250, 0.3);
    border-color: #a78bfa;
    color: #fff;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .9rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    padding: .4rem .7rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all .3s;
}
.theme-toggle:hover {
    background: rgba(255,255,255,0.15);
}
footer {
    background: rgba(255,255,255,0.05);
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    padding: 1.5rem 0;
    color: #aaa;
    font-size: .9rem;
}
footer a {
    color: #a78bfa;
    transition: color .3s;
}
footer a:hover {
    color: #d8b4fe;
}
.gradient-text {
    background: linear-gradient(to right, #ec4899, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
@media (max-width: 640px) {
    header {
        flex-direction: column;
        align-items: center;
        gap: 0.6rem;
        text-align: center;
    }

    header h1 {
        font-size: 1.4rem;
        line-height: 1.2;
    }

    header i {
        font-size: 1.3rem;
    }

    main {
        margin-top: 0.5rem;
    }

    .theme-toggle {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    .glass {
        padding: 1.2rem;
    }
}

/* ================================
   COOKIE MODAL
=================================*/
.cookie-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s ease;
}


.cookie-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.cookie-content {
    max-width: 420px;
    width: 100%;
    padding: 1.6rem;
    border-radius: 1rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 8px 30px rgba(0,0,0,0.35);
    backdrop-filter: blur(12px);

    color: #e5e5e5;
    text-align: center;
    line-height: 1.5;
}

body.light .cookie-content {
    background: rgba(255,255,255,0.6);
    color: #111;
}

.cookie-content a {
    color: #a78bfa;
    text-decoration: underline;
}

.cookie-actions {
    margin-top: 1rem;
}

.cookie-btn {
    background: linear-gradient(90deg, #8b5cf6, #ec4899);
    border: none;
    padding: .6rem 1.2rem;
    color: #fff;
    border-radius: .6rem;
    font-weight: 600;
    transition: transform .25s, opacity .25s;
}

.cookie-btn:hover {
    transform: translateY(-2px);
    opacity: .9;
}
/* ================================
   SHARE WIDGET
=================================*/
.share-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9000;
}

/* Toggle Button */
.share-btn {
    width: 52px;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;
    color: #fff;

    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border: none;
    border-radius: 50%;
    cursor: pointer;

    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    transition: transform .25s, opacity .25s;
}

.share-btn:hover {
    transform: scale(1.08);
    opacity: .95;
}

body.light .share-btn {
    background: linear-gradient(135deg, #7c3aed, #db2777);
}

/* Panel */
.share-panel {
    position: absolute;
    bottom: 65px;
    right: -6px;

    display: flex;
    flex-direction: column;
    gap: .4rem;

    padding: .8rem;
    border-radius: 1rem;

    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(14px);

    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .3s, transform .3s;
}

body.light .share-panel {
    background: rgba(255,255,255,0.65);
    border-color: rgba(0,0,0,0.1);
}

/* Active */
.share-panel.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Share icon buttons */
.share-panel .sh {
    font-size: 22px;
    width: 45px;
    height: 45px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: .6rem;
    color: #fff;
    cursor: pointer;
    background: rgba(255,255,255,0.08);

    border: 1px solid rgba(255,255,255,0.15);
    transition: background .25s, transform .25s;
}

.share-panel .sh:hover {
    transform: translateY(-3px);
    background: rgba(255,255,255,0.2);
}

body.light .share-panel .sh {
    color: #222;
    background: rgba(255,255,255,0.5);
    border-color: rgba(0,0,0,0.1);
}

body.light .share-panel .sh:hover {
    background: rgba(255,255,255,0.7);
}
input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: .3rem;
    border: 2px solid rgba(255,255,255,0.35);
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all .25s ease;
}

body.light input[type="checkbox"] {
    border-color: rgba(0,0,0,0.35);
}

input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-color: transparent;
}

input[type="checkbox"]:checked::after {
    content: "✔";
    position: absolute;
    color: #fff;
    font-size: 14px;
    left: 3px;
    top: -3px;
}

body.light input[type="checkbox"]:checked::after {
    color: white;
}
.preset-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: .7rem;
    padding: .6rem .8rem;
    font-weight: 600;
    transition: .25s;
    backdrop-filter: blur(8px);
}

.preset-btn:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

body.light .preset-btn {
    background: rgba(255,255,255,0.6);
    border-color: rgba(0,0,0,0.15);
}

body.light .preset-btn:hover {
    background: rgba(255,255,255,0.8);
}
