/* Стили шаблона miracle_shorts.php. Порядок правил и подключения сохранён; файл кэшируется браузером. */
/* ============================================================
   MIRACLE SHORTS — TIKTOK STYLE
============================================================ */

html {
    scroll-behavior: smooth;
}

body {
    background: #0f0f0f;
}

.miracle-shorts-page {
    position: relative;
    min-height: 100vh;
    background: #0f0f0f;
    color: #ffffff;
    overflow: hidden;
}

.miracle-shorts-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at top left, rgba(196, 69, 92, 0.14), transparent 360px),
        radial-gradient(circle at bottom right, rgba(196, 69, 92, 0.10), transparent 420px),
        #0f0f0f;
    pointer-events: none;
}

.miracle-shorts-shell {
    position: relative;
    z-index: 2;
}

/* Верхняя панель */

.shorts-topbar {
    position: fixed;
    top: 14px;
    left: 50%;
    z-index: 100;
    width: min(1350px, calc(100% - 28px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.015)),
        rgba(20, 20, 20, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.shorts-topbar__left,
.shorts-topbar__right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shorts-back {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.18s ease, border-color 0.18s ease;
}

.shorts-back:hover {
    color: #ffffff;
    background: rgba(196, 69, 92, 0.18);
    border-color: rgba(196, 69, 92, 0.32);
}

.shorts-back svg {
    width: 19px;
    height: 19px;
}

.shorts-logo {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shorts-logo__title {
    color: #ffffff;
    font-size: 15px;
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.shorts-logo__sub {
    color: rgba(255, 255, 255, 0.52);
    font-size: 11px;
    line-height: 1;
    font-weight: 650;
}

.shorts-count {
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.80);
    background: rgba(196, 69, 92, 0.12);
    border: 1px solid rgba(196, 69, 92, 0.28);
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
    white-space: nowrap;
}

.shorts-top-btn {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: none;
    border-radius: 999px;
    color: #ffffff;
    background: var(--accent, #c4455c);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease;
}

.shorts-top-btn:hover {
    background: var(--accent-hover, #d75970);
}

.shorts-top-btn svg {
    width: 19px;
    height: 19px;
}

/* Список видео */

.shorts-feed {
    position: relative;
    z-index: 2;
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.shorts-feed::-webkit-scrollbar {
    display: none;
}

.shorts-item {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 620px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
    background: #050505;
}

.shorts-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-size: cover;
    background-position: center;
    opacity: 0.35;
    filter: blur(22px);
}

.shorts-bg::after {
    content: "";
    position: absolute;
    inset: -2px;
    background:
        linear-gradient(90deg, rgba(15,15,15,0.86), rgba(15,15,15,0.35), rgba(15,15,15,0.86)),
        linear-gradient(180deg, rgba(15,15,15,0.72), transparent 22%, transparent 58%, rgba(15,15,15,0.86));
}

.shorts-video-frame {
    position: relative;
    z-index: 2;
    width: min(430px, calc(100vw - 34px));
    height: min(760px, calc(100vh - 34px));
    border-radius: 28px;
    overflow: hidden;
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.11);
}

.shorts-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000000;
}

.shorts-video-frame.is-contain .shorts-video {
    object-fit: contain;
}

/* Затемнения поверх видео */

.shorts-video-shade {
    position: absolute;
    inset: 0;
    z-index: 3;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.44), transparent 24%, transparent 56%, rgba(0,0,0,0.86)),
        linear-gradient(90deg, transparent 62%, rgba(0,0,0,0.20));
    pointer-events: none;
}

.shorts-video-progress {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 14px;
    z-index: 5;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.20);
    overflow: hidden;
}

.shorts-video-progress span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent-hover, #d75970);
}

/* Информация снизу */

.shorts-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    padding: 22px 72px 22px 18px;
    pointer-events: none;
}

.shorts-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.shorts-name {
    color: #ffffff;
    font-size: 22px;
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: -0.035em;
    text-decoration: none;
    pointer-events: auto;
}

.shorts-name:hover {
    color: #ffffff;
}

.verified-badge {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    border-radius: 999px;
    color: #ffffff;
    background: var(--accent, #c4455c);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.verified-badge svg {
    width: 14px;
    height: 14px;
}

.shorts-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.shorts-meta span {
    min-height: 26px;
    padding: 6px 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.84);
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.10);
    font-size: 12px;
    line-height: 1;
    font-weight: 750;
}

.shorts-meta svg {
    width: 13px;
    height: 13px;
    color: var(--accent-hover, #d75970);
}

.shorts-desc {
    max-width: 300px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    pointer-events: auto;
}

/* Кнопки справа */

.shorts-actions {
    position: absolute;
    right: 12px;
    bottom: 112px;
    z-index: 7;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shorts-action-btn,
.shorts-action-link {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.shorts-action-btn:hover,
.shorts-action-link:hover {
    background: rgba(196, 69, 92, 0.88);
    border-color: rgba(196, 69, 92, 0.88);
    color: #ffffff;
}

.shorts-action-btn svg,
.shorts-action-link svg {
    width: 21px;
    height: 21px;
}

.shorts-action-label {
    display: none;
}

/* Подсказка свайпа */

.shorts-swipe-hint {
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 80;
    padding: 9px 13px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.76);
    background: rgba(20, 20, 20, 0.66);
    border: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 12px;
    line-height: 1;
    font-weight: 750;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.shorts-swipe-hint.is-hidden {
    opacity: 0;
}

/* История */

.shorts-history-toggle {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 130;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 999px;
    color: #ffffff;
    background: var(--accent, #c4455c);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s ease;
}

.shorts-history-toggle:hover {
    background: var(--accent-hover, #d75970);
}

.shorts-history-toggle svg {
    width: 20px;
    height: 20px;
}

.shorts-history {
    position: fixed;
    left: 50%;
    bottom: -190px;
    z-index: 120;
    width: min(1350px, calc(100% - 28px));
    padding: 14px;
    border-radius: 24px 24px 0 0;
    background:
        radial-gradient(circle at top left, rgba(196, 69, 92, 0.16), transparent 280px),
        linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.015)),
        rgba(20, 20, 20, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-bottom: none;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    pointer-events: none;
    transition: bottom 0.25s ease, opacity 0.25s ease;
}

.shorts-history.is-open {
    bottom: 0;
    opacity: 1;
    pointer-events: auto;
}

.shorts-history__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.shorts-history__title {
    margin: 0;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 850;
}

.shorts-history__close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shorts-history__close svg {
    width: 16px;
    height: 16px;
}

.shorts-playlist {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(196, 69, 92, 0.6) rgba(255,255,255,0.08);
}

.shorts-playlist-item {
    flex: 0 0 82px;
    border: none;
    padding: 0;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    text-align: left;
}

.shorts-playlist-thumb {
    position: relative;
    width: 82px;
    aspect-ratio: 9 / 16;
    border-radius: 14px;
    overflow: hidden;
    background: #000000;
    border: 2px solid transparent;
}

.shorts-playlist-item.is-active .shorts-playlist-thumb {
    border-color: var(--accent-hover, #d75970);
}

.shorts-playlist-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.86;
}

.shorts-playlist-item.is-active img {
    opacity: 1;
}

.shorts-playlist-play {
    position: absolute;
    inset: auto 6px 6px auto;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(196, 69, 92, 0.90);
    color: #ffffff;
}

.shorts-playlist-play svg {
    width: 12px;
    height: 12px;
}

.shorts-playlist-name {
    display: block;
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shorts-playlist-item.is-active .shorts-playlist-name {
    color: #ffffff;
}

/* Нет видео */

.shorts-empty {
    position: relative;
    z-index: 2;
    min-height: calc(100vh - 120px);
    width: min(680px, calc(100% - 28px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.shorts-empty__box {
    padding: 34px 28px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(196, 69, 92, 0.13), transparent 260px),
        rgba(35, 34, 32, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.shorts-empty__icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    border-radius: 18px;
    color: var(--accent-hover, #d75970);
    background: rgba(196, 69, 92, 0.14);
    border: 1px solid rgba(196, 69, 92, 0.32);
    display: flex;
    align-items: center;
    justify-content: center;
}

.shorts-empty__icon svg {
    width: 30px;
    height: 30px;
}

.shorts-empty__title {
    margin: 0;
    color: #ffffff;
    font-size: 26px;
    line-height: 1.15;
    font-weight: 900;
}

.shorts-empty__text {
    margin: 12px auto 0;
    max-width: 420px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 15px;
    line-height: 1.55;
}

/* Мобильная версия */

@media (max-width: 768px) {
    .shorts-topbar {
        top: 10px;
        width: calc(100% - 20px);
        padding: 10px;
    }

    .shorts-logo__title {
        font-size: 14px;
    }

    .shorts-logo__sub {
        display: none;
    }

    .shorts-count {
        display: none;
    }

    .shorts-item {
        min-height: 100vh;
        height: 100svh;
    }

    .shorts-video-frame {
        width: 100%;
        height: 100svh;
        border-radius: 0;
        border: none;
    }

    .shorts-bg {
        display: none;
    }

    .shorts-overlay {
        padding: 0 74px 26px 16px;
    }

    .shorts-name {
        font-size: 21px;
    }

    .shorts-desc {
        max-width: 100%;
        font-size: 13px;
    }

    .shorts-actions {
        right: 12px;
        bottom: 110px;
        gap: 12px;
    }

    .shorts-action-btn,
    .shorts-action-link {
        width: 46px;
        height: 46px;
    }

    .shorts-history-toggle {
        right: 12px;
        bottom: 18px;
        width: 46px;
        height: 46px;
    }

    .shorts-swipe-hint {
        bottom: 18px;
        font-size: 11px;
    }

    .shorts-history {
        width: 100%;
        border-radius: 22px 22px 0 0;
        padding: 14px 12px;
    }

    .shorts-playlist-item {
        flex-basis: 74px;
    }

    .shorts-playlist-thumb {
        width: 74px;
    }
}

@media (max-width: 480px) {
    .shorts-topbar {
        width: calc(100% - 16px);
        top: 8px;
    }

    .shorts-back,
    .shorts-top-btn {
        width: 36px;
        height: 36px;
    }

    .shorts-overlay {
        padding-left: 14px;
        padding-right: 68px;
        padding-bottom: 24px;
    }

    .shorts-name {
        font-size: 20px;
    }

    .shorts-meta {
        gap: 6px;
    }

    .shorts-meta span {
        font-size: 11px;
        padding: 6px 8px;
    }

    .shorts-actions {
        right: 10px;
    }

    .shorts-action-btn,
    .shorts-action-link,
    .shorts-history-toggle {
        width: 44px;
        height: 44px;
    }

    .shorts-playlist-item {
        flex-basis: 68px;
    }

    .shorts-playlist-thumb {
        width: 68px;
        border-radius: 12px;
    }
}
