/* Actions bar (views + like/dislike + save/share/report) для fstory при $rating_bar=2.
   Подключается в templates_ru/main.tpl и templates/main.tpl. */

.actions-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 16px auto;
    padding: 0 10px;
    max-width: 720px;
}

/* Базовый компонент — для статистики (views) и кнопок (like/dislike/save/share/report).
   Фон #2a2a2a — единый с .myButton / .menu-toggle / .btn-auth-primary, на сером
   фоне сайта (#666) выделяется и не «фарит». Текст #c8c8c8 — приглушённый. */
.actions-bar .action-stat,
.actions-bar .action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    box-sizing: border-box;
    background: #2a2a2a;
    color: #c8c8c8;
    border: none;
    border-radius: 19px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: default;
    transition: background 0.15s, color 0.15s;
}

.actions-bar .action-btn {
    cursor: pointer;
}
.actions-bar .action-btn:hover {
    background: #1a1a1a;
    color: #ffffff;
}
.actions-bar .action-btn:active {
    transform: translateY(1px);
}
.actions-bar .action-btn:disabled,
.actions-bar .action-btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.actions-bar svg {
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
}

/* Подсветка кнопки которой пользователь уже проголосовал */
.actions-bar .vote-btn.voted {
    background: #2a2a2a;
    color: #ffffff;
}
.actions-bar .vote-btn[data-vote="like"].voted {
    background: #2a8a2a;     /* зелёный для like */
}
.actions-bar .vote-btn[data-vote="dislike"].voted {
    background: #b54040;     /* красноватый для dislike */
}

/* Save (закладка): когда сохранено — золотистый акцент. */
.actions-bar .save-btn.voted {
    background: #EBBE5E;
    color: #2a2a2a;
}
.actions-bar .save-btn.voted:hover {
    background: #d9a945;
    color: #1a1a1a;
}

/* Pulse при успешном клике (визуальный feedback) */
.actions-bar .action-btn.pulse {
    animation: action-pulse 0.4s ease;
}
@keyframes action-pulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* Мобильный: чуть компактнее, без ужимания текста до невидимости */
@media (max-width: 480px) {
    .actions-bar {
        gap: 6px;
        margin: 12px 0;
    }
    .actions-bar .action-stat,
    .actions-bar .action-btn {
        height: 40px;
        padding: 0 12px;
        font-size: 13px;
    }
}

/* === SHARE MODAL ===
   Создаётся динамически в JS (см. actions.js). Без backend — чисто клиентский popup
   со ссылкой, кнопкой Copy и набором соц-сетей (набор зависит от $lang). */
.share-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
}
.share-modal {
    background: #2a2a2a;
    color: #c8c8c8;
    border-radius: 12px;
    padding: 24px;
    max-width: 460px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    font-family: inherit;
}
.share-modal h3 {
    margin: 0 0 16px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
}
.share-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: #c8c8c8;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 50%;
}
.share-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.share-url-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.share-url-row input {
    flex: 1;
    min-width: 0;             /* нужно для корректного flex-сжатия в IE/legacy */
    padding: 10px 12px;
    background: #1a1a1a;
    color: #c8c8c8;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.share-copy-btn {
    padding: 10px 18px;
    background: #EBBE5E;
    color: #2a2a2a;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.share-copy-btn:hover {
    background: #d9a945;
}
.share-copy-btn.copied {
    background: #2a8a2a;
    color: #ffffff;
}

.share-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.share-socials a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    background: #1a1a1a;
    color: #c8c8c8;
    border-radius: 19px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}
.share-socials a:hover { color: #ffffff; }
/* Брендовые цвета на hover (чтобы пользователь визуально опознавал сеть). */
.share-socials a[data-net="telegram"]:hover { background: #229ED9; color: #fff; }
.share-socials a[data-net="vk"]:hover       { background: #4680C2; color: #fff; }
.share-socials a[data-net="ok"]:hover       { background: #EE8208; color: #fff; }
.share-socials a[data-net="whatsapp"]:hover { background: #25D366; color: #fff; }
.share-socials a[data-net="email"]:hover    { background: #888888; color: #fff; }
.share-socials a[data-net="twitter"]:hover  { background: #000000; color: #fff; }
.share-socials a[data-net="facebook"]:hover { background: #1877F2; color: #fff; }
.share-socials a[data-net="reddit"]:hover   { background: #FF4500; color: #fff; }

@media (max-width: 480px) {
    .share-modal { padding: 18px; }
    .share-url-row { flex-direction: column; }
    .share-copy-btn { width: 100%; }
    .share-socials a { font-size: 12px; padding: 0 12px; height: 36px; }
}

/* Компактный actions-bar для fstory в режиме $rating_bar=1 — содержит только
   save-кнопку рядом со звёздами. Inline, без фона, без padding'ов «полного» бара. */
.actions-bar.actions-bar-mini {
    display: inline-flex;
    margin: 0 0 0 12px;
    padding: 0;
    background: transparent;
    border: none;
    vertical-align: middle;
    gap: 0;
}
