/* WP Stories — Viewer & Shortcode Styles */

:root {
    --wps-primary: #333333;
    --wps-accent: #e1306c;
    --wps-bg: #ffffff;
    --wps-text: #333333;
    --wps-border-gradient: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    --wps-border-seen: #cccccc;
    --wps-circle-size: 64px;
    --wps-viewer-bg: rgba(0, 0, 0, 0.95);
    --wps-font: inherit;
}

/* ─── Stories Row (Shortcode) ──────────────────────────── */

.wps-stories-wrapper {
    font-family: var(--wps-font);
}

.wps-stories-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 12px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.wps-stories-row::-webkit-scrollbar {
    display: none;
}

.wps-story-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.wps-circle-border {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--wps-circle-size);
    height: var(--wps-circle-size);
    border-radius: 50%;
    background: var(--wps-border-gradient);
    padding: 3px;
    transition: transform 0.2s ease;
}

.wps-story-circle:hover .wps-circle-border {
    transform: scale(1.05);
}

.wps-story-circle.wps-seen .wps-circle-border {
    background: var(--wps-border-seen);
}

.wps-circle-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: var(--wps-bg);
    border: 2px solid var(--wps-bg);
}

.wps-circle-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wps-circle-label {
    font-size: 11px;
    color: var(--wps-text);
    max-width: var(--wps-circle-size);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

/* ─── Highlights Row ───────────────────────────────────── */

.wps-highlights-row {
    padding: 16px 0 8px;
}

.wps-highlights-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--wps-text);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wps-highlights-list {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
}

.wps-highlights-list::-webkit-scrollbar {
    display: none;
}

.wps-highlight-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.wps-highlight-cover {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--wps-border-seen);
    background: #f5f5f5;
}

.wps-highlight-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wps-highlight-name {
    font-size: 11px;
    color: var(--wps-text);
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

/* ─── Viewer Overlay ───────────────────────────────────── */

.wps-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--wps-viewer-bg);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wps-viewer-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    height: 100%;
    max-height: 750px;
    display: flex;
    flex-direction: column;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

@media (max-width: 480px) {
    .wps-viewer-container {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

/* Close */
.wps-viewer-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    padding: 4px 8px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.wps-viewer-close:hover {
    opacity: 1;
}

/* Progress Bars */
.wps-viewer-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 3px;
    padding: 8px 8px 0;
    z-index: 10;
}

.wps-progress-bar {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.wps-progress-fill {
    height: 100%;
    background: #fff;
    width: 0%;
    border-radius: 2px;
    transition: none;
}

.wps-progress-fill.wps-progress-complete {
    width: 100% !important;
}

.wps-progress-fill.wps-progress-animating {
    transition: width linear;
}

/* Header */
.wps-viewer-header {
    position: absolute;
    top: 18px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.wps-viewer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: #333;
}

.wps-viewer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wps-viewer-group-name {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

/* Media Area */
.wps-viewer-media {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
}

.wps-viewer-media img,
.wps-viewer-media video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Tap Zones */
.wps-viewer-tap {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 5;
    cursor: pointer;
}

.wps-viewer-tap--left {
    left: 0;
}

.wps-viewer-tap--right {
    right: 0;
}

/* Swipe Up */
.wps-viewer-swipe-up {
    position: absolute;
    bottom: 100px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 10;
}

.wps-viewer-swipe-up a {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.wps-viewer-swipe-up a:hover {
    opacity: 1;
}

.wps-swipe-icon {
    font-size: 20px;
    animation: wps-swipe-bounce 1.5s infinite;
}

@keyframes wps-swipe-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ─── Poll ─────────────────────────────────────────────── */

.wps-viewer-poll {
    position: absolute;
    bottom: 90px;
    left: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 16px;
    z-index: 10;
}

.wps-poll-question {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    text-align: center;
}

.wps-poll-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wps-poll-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0f0f0;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s;
}

.wps-poll-option:hover {
    border-color: var(--wps-accent);
}

.wps-poll-option.wps-poll-voted {
    cursor: default;
}

.wps-poll-label {
    position: relative;
    z-index: 2;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.wps-poll-bar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    z-index: 1;
}

.wps-poll-bar-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: rgba(225, 48, 108, 0.15);
    border-radius: 6px;
    transition: width 0.6s ease;
}

.wps-poll-percent {
    position: relative;
    z-index: 2;
    font-size: 13px;
    font-weight: 700;
    color: #333;
    display: none;
}

.wps-poll-option.wps-poll-voted .wps-poll-percent {
    display: inline;
}

/* ─── Bottom Bar ───────────────────────────────────────── */

.wps-viewer-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    z-index: 10;
}

.wps-viewer-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.wps-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 13px;
    background: none;
    border: none;
    cursor: default;
    padding: 0;
}

.wps-stat--btn {
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.wps-stat--btn:hover {
    opacity: 1;
}

.wps-stat svg {
    flex-shrink: 0;
}

.wps-stat.wps-liked svg {
    fill: var(--wps-accent);
    stroke: var(--wps-accent);
}

/* Comment Input */
.wps-viewer-comment {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wps-viewer-comment input {
    flex: 1;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 8px 14px;
    color: #fff;
    font-size: 13px;
    outline: none;
}

.wps-viewer-comment input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.wps-viewer-comment input:focus {
    border-color: rgba(255, 255, 255, 0.6);
}

#wps-comment-send {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#wps-comment-send:hover {
    opacity: 1;
}

/* Share Menu */
.wps-share-menu {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 8px;
    margin-top: 8px;
}

.wps-share-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: background 0.15s;
}

.wps-share-option:hover {
    background: #f0f0f0;
}

/* ─── Utilities ────────────────────────────────────────── */

.wps-stories-empty {
    display: none;
}

/* Responsive */
@media (max-width: 480px) {
    .wps-viewer-overlay {
        align-items: stretch;
    }

    .wps-viewer-container {
        border-radius: 0;
    }

    :root {
        --wps-circle-size: 56px;
    }

    .wps-stories-row {
        gap: 8px;
        padding: 8px 4px;
    }
}
