/* ==========================================================================
   RedNews 2 - WhatsApp / Instagram Style Stories Stylesheet
   ========================================================================== */

.rn-stories-wrap {
    margin: 16px 0 24px 0;
    padding: 16px 20px;
    background: var(--dt-card-bg, #ffffff);
    border: 1px solid var(--dt-border, #E2E8F0);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.rn-stories-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--dt-border, #E2E8F0);
}

.rn-stories-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    letter-spacing: 0.5px;
    color: var(--dt-text, #1c232e);
}

.rn-stories-title strong {
    color: var(--dt-primary, #DE2910);
    font-weight: 800;
}

.rn-stories-subtitle {
    font-size: 12px;
    color: var(--dt-text-muted, #8C98A9);
    font-weight: 400;
}

.rn-stories-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--dt-primary, #DE2910);
    box-shadow: 0 0 0 0 rgba(222, 41, 16, 0.7);
    animation: rn-pulse 1.8s infinite;
}

@keyframes rn-pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(222, 41, 16, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(222, 41, 16, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(222, 41, 16, 0);
    }
}

.rn-stories-arrows {
    display: flex;
    gap: 6px;
}

.rn-stories-arrow {
    background: var(--dt-bg, #F4F6F8);
    border: 1px solid var(--dt-border, #E2E8F0);
    color: var(--dt-text, #1c232e);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rn-stories-arrow:hover {
    background: var(--dt-primary, #DE2910);
    color: #fff;
    border-color: var(--dt-primary, #DE2910);
}

/* Horizontal Track */
.rn-stories-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 4px 2px 8px 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.rn-stories-track::-webkit-scrollbar {
    display: none;
}

.rn-story-circle-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 78px;
    cursor: pointer;
    outline: none;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rn-story-circle-item:hover {
    transform: translateY(-3px);
}

/* Gradient Ring (WA / Instagram status style) */
.rn-story-ring {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(45deg, #DE2910, #FA6400, #FFDE00);
    box-shadow: 0 3px 10px rgba(222, 41, 16, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.rn-story-circle-item.is-viewed .rn-story-ring {
    background: #CBD5E1;
    box-shadow: none;
}

.rn-story-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid var(--dt-card-bg, #ffffff);
    background-color: #E2E8F0;
    transition: transform 0.3s ease;
}

.rn-story-circle-item:hover .rn-story-avatar {
    transform: scale(1.05);
}

.rn-story-author {
    margin-top: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--dt-text, #1c232e);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* ==========================================================================
   STORY VIEWER MODAL
   ========================================================================== */
.rn-story-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.rn-story-modal.is-active {
    opacity: 1;
    visibility: visible;
}

.rn-story-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 19, 32, 0.92);
    backdrop-filter: blur(16px);
}

.rn-story-viewer {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    height: 90vh;
    max-height: 740px;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: rn-story-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rn-story-pop {
    0% { transform: scale(0.92); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Progress Segment Bar */
.rn-story-progress-container {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    z-index: 10;
    display: flex;
    gap: 4px;
}

.rn-story-progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 3px;
    overflow: hidden;
}

.rn-story-progress-fill {
    width: 0%;
    height: 100%;
    background: #ffffff;
    transition: width 0.05s linear;
}

.rn-story-progress-bar.completed .rn-story-progress-fill {
    width: 100%;
}

/* Modal Header */
.rn-story-modal-header {
    position: absolute;
    top: 26px;
    left: 14px;
    right: 14px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rn-story-modal-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rn-story-modal-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #fff;
    background-size: cover;
    background-position: center;
    background-color: #333;
}

.rn-story-modal-info {
    display: flex;
    flex-direction: column;
}

.rn-story-modal-category {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.rn-story-modal-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
}

.rn-story-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rn-story-modal-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.rn-story-modal-btn:hover {
    background: rgba(222, 41, 16, 0.8);
}

/* Visual Stage */
.rn-story-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px 20px 28px 20px;
    box-sizing: border-box;
}

.rn-story-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.3s ease;
}

.rn-story-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.85) 80%, rgba(0,0,0,0.95) 100%);
}

.rn-story-content {
    position: relative;
    z-index: 5;
    color: #fff;
}

.rn-story-badge {
    display: inline-block;
    background: var(--dt-primary, #DE2910);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.rn-story-headline {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.35;
    color: #ffffff;
    margin: 0 0 10px 0;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.rn-story-excerpt {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.88);
    margin: 0 0 18px 0;
}

.rn-story-cta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rn-story-cta-btn {
    background: #ffffff;
    color: var(--dt-primary, #DE2910) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    padding: 12px 20px;
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, background 0.2s;
    text-decoration: none;
}

.rn-story-cta-btn:hover {
    background: var(--dt-primary, #DE2910);
    color: #ffffff !important;
    transform: translateY(-2px);
}

.rn-story-swipe-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

/* Tap Zones */
.rn-story-tap-zone {
    position: absolute;
    top: 70px;
    bottom: 120px;
    width: 50%;
    z-index: 4;
    cursor: pointer;
}

.rn-story-tap-prev {
    left: 0;
}

.rn-story-tap-next {
    right: 0;
}

/* Nav Arrows outside modal on Desktop */
.rn-story-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 10;
}

.rn-story-nav-btn:hover {
    background: var(--dt-primary, #DE2910);
    transform: translateY(-50%) scale(1.1);
}

.rn-story-nav-prev {
    left: -60px;
}

.rn-story-nav-next {
    right: -60px;
}

@media (max-width: 580px) {
    .rn-story-viewer {
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .rn-story-nav-btn {
        display: none;
    }
}
