:root {
    --story-bg: #1a202c;
}

.stories-section {
    border-bottom: 1px solid #2424;
}

body.dark .stories-section {
    border-bottom: 1px solid #2d3748;
}

.stories-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #242244;
    padding: 20px 0px 10px 0px;
}

body.dark .stories-header {
    border-bottom: 1px solid #F5F5F5;
}

.stories-title-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stories-nav-controls {
    display: flex;
    gap: 10px;
}

.stories-nav-control-btn {
    width: 40px;
    height: 40px;
    background: #F5F5F5;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(245, 101, 101, 0.3);
    border: 1px solid #2424;
    z-index: 10;
    flex-shrink: 0;
}

.stories-nav-control-btn:hover {
    background: #e47200;
    color: #F5F5F5;
    transform: scale(1.1);
}

.stories-header i {
    color: #e47200;
    font-size: 32px;
}

.stories-title {
    font-size: 30px;
    font-weight: 700;
    color: #242424;
    margin: 0;
}

body.dark .stories-title {
    color: #f7fafc;
}

/* Carousel Container */
.stories-carousel-container {
    position: relative;
    width: 100%;
    padding: 20px 0;
    overflow: hidden;
}

.stories-track {
    display: flex;
    gap: 20px;
    transition: transform 0.5s ease;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
    padding-bottom: 10px;
}

.stories-track::-webkit-scrollbar {
    display: none;
}

.story-card {
    width: 238px;
    aspect-ratio: 9 / 12;
    background: #f7fafc;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    flex-shrink: 0;
}

body.dark .story-card {
    background: #2d3748;
}

.story-card:hover {
    transform: translateY(-8px) scale(1.02);
    z-index: 5;
}

.story-image-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.story-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.story-card:hover .story-image {
    transform: scale(1.05);
}

.story-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    z-index: 2;
}

.story-card .story-title {
    color: white;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    text-align: left;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* FULL SCREEN VIEWER */
.story-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.story-viewer-modal.active {
    display: flex;
}

.story-viewer-content {
    position: relative;
    width: 100%;
    max-width: 450px;
    height: 90vh;
    background: var(--story-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.story-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 10002;
    transition: 0.3s;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.story-viewer-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

@media (min-width: 1025px) {
    .story-viewer-close {
        right: -60px;
        top: 0;
        background: transparent;
        border: none;
        font-size: 32px;
    }

    .story-viewer-close:hover {
        transform: scale(1.2) rotate(90deg);
        background: transparent;
    }
}

@media (max-width: 768px) {
    .story-viewer-content {
        height: 100dvh;
        /* Use dynamic viewport height */
        max-width: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .story-viewer-close {
        top: 20px;
        right: 15px;
    }
}

.story-progress-container {
    position: absolute;
    top: 15px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 10;
}

.story-progress-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    flex: 1;
    border-radius: 2px;
    overflow: hidden;
}

.story-progress-fill {
    height: 100%;
    background: white;
    width: 0%;
    transition: width linear;
}

.story-viewer-image-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.story-viewer-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Changed from cover to show full image */
    background: #000;
}

.story-nav-area {
    position: absolute;
    top: 0;
    width: 30%;
    height: 100%;
    z-index: 5;
    cursor: pointer;
}

.story-nav-prev {
    left: 0;
}

.story-nav-next {
    right: 0;
    width: 70%;
}

.story-viewer-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px 20px 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    z-index: 6;
}

.story-viewer-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.story-read-news-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white !important;
    padding: 12px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-top: 10px;
}

.story-read-news-btn:hover {
    background: #e47200;
    border-color: #e47200;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(228, 114, 0, 0.4);
}

.story-read-news-btn i {
    font-size: 18px;
}

@media (max-width: 768px) {
    .story-card {
        width: 180px;
    }

    .stories-title {
        font-size: 24px;
    }
}

/* New Global Navigation Styles */
.story-global-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: 0.3s;
    backdrop-filter: blur(5px);
}

.story-global-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.story-global-nav.prev {
    left: 30px;
}

.story-global-nav.next {
    right: 30px;
}

@media (max-width: 1024px) {
    .story-global-nav {
        display: none;
    }
}