/* ========================================
   MODERN STORY CLICK DESIGN SYSTEM
   Phase 1: Foundation & Home Page
   ======================================== */

/* ROOT VARIABLES */
:root {
    --primary-color: #e50914;
    --primary-dark: #831010;
    --secondary-color: #564d4d;
    --accent-color: #fff;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --bg-primary: #141414;
    --bg-secondary: #221f1f;
    --border-color: #333333;
    --transition-speed: 0.3s;
}

/* ========================================
   GLOBAL STYLES
   ======================================== */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Remove scroll bar on body initially */
body.no-scroll {
    overflow: hidden;
}

/* ========================================
   CONTAINER & LAYOUT
   ======================================== */
.inner-content {
    max-width: 2545px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

#page-wrapper {
    width: 100%;
    background-color: var(--bg-primary);
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
}

h2 {
    font-size: 2.5rem;
    font-weight: 700;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

a {
    text-decoration: none;
    color: var(--text-primary);
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--accent-color);
}

/* ========================================
   LAYOUT WRAPPER
   ======================================== */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.inner-content {
    flex: 1;
}

/* ========================================
   HERO BANNER SECTION
   ======================================== */
.hero-banner-section {
    position: relative;
    height: 650px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a1a 0%, var(--bg-secondary) 100%);
    margin: 0 auto 0 auto;
    border-radius: 0;
    max-width: 2545px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.hero-carousel {
    height: 100%;
    position: relative;
}

.hero-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}

.hero-slide.active {
    opacity: 1;
    z-index: 2;
}

.hero-background {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.45) contrast(1.1);
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 50px 60px;
    background: linear-gradient(to top, rgba(20, 20, 20, 0.98), rgba(20, 20, 20, 0.8), transparent);
    z-index: 3;
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    min-height: 200px;
    gap: 30px;
}

.hero-content-text {
    flex: 1;
    max-width: 65%;
}

.hero-content-text h2 {
    margin-bottom: 15px;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.9);
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.hero-content-text p {
    font-size: 1.05rem;
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #c60812 100%);
    color: var(--text-primary);
    border: none;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 20px rgba(229, 9, 20, 0.3);
    text-decoration: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #990a0a 100%);
    transform: translateY(-3px);
    text-decoration: none;
    box-shadow: 0 12px 30px rgba(229, 9, 20, 0.5);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.hero-carousel-controls {
    position: absolute;
    bottom: 30px;
    right: 60px;
    display: flex;
    gap: 12px;
    z-index: 4;
}

.carousel-control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
}

.carousel-control-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* ========================================
   STORIES SECTION
   ======================================== */
.stories-section {
    padding: 0 40px 50px 40px;
    background: linear-gradient(to bottom, transparent 0%, rgba(229, 9, 20, 0.03) 100%);
    border-radius: 16px;
    margin: 20px auto;
    max-width: 2545px;
    width: 100%;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 15px;
}

.section-title::before {
    content: '';
    width: 5px;
    height: 32px;
    background: linear-gradient(to bottom, var(--primary-color), transparent);
    border-radius: 3px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, var(--primary-color), transparent);
}

/* Horizontal scrolling section */
.stories-container {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 15px 0 25px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    user-select: none;
    -webkit-user-select: none;
    overscroll-behavior: contain;
    touch-action: manipulation;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.stories-container::-webkit-scrollbar {
    display: none;
}

.stories-section {
    position: relative;
}

.scroll-buttons-container {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    pointer-events: none;
    z-index: 20;
    display: none;
}

.scroll-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(229, 9, 20, 0.9);
    border: 2px solid var(--primary-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    pointer-events: auto;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4);
}

.scroll-btn:hover {
    background-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(229, 9, 20, 0.6);
}

.scroll-btn:active {
    transform: scale(0.95);
}

.story-card {
    flex: 0 0 300px;
    height: 450px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    background-color: var(--bg-secondary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    touch-action: manipulation;
}

.story-card-auto {
    width: 100%;
    aspect-ratio: 2/3;
    height: auto !important;
}

.story-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 15px 40px rgba(229, 9, 20, 0.4);
    border-color: rgba(229, 9, 20, 0.3);
}

.story-card-image {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
    filter: brightness(0.9);
}

.story-card:hover .story-card-image {
    transform: scale(1.1);
    filter: brightness(1);
}

.story-card-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.95) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 14px;
    z-index: 2;
    transition: background 0.4s ease;
}

.story-card:hover .story-card-overlay {
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.2) 0%, rgba(0, 0, 0, 0.98) 100%);
}

.story-card-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.story-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.story-card-author {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.story-card-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    margin-top: 2px;
}

.star-icon {
    color: var(--accent-color);
    font-size: 0.95rem;
}

.story-card-action {
    display: flex;
    gap: 10px;
}

.story-card-btn {
    flex: 1;
    padding: 8px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.story-card-btn:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

/* Grid view for smaller categories - 4-5 items per row */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

/* Horizontal scroll for category stories - single row */
.stories-container {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 15px 0 25px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    user-select: none;
    -webkit-user-select: none;
    overscroll-behavior: contain;
    touch-action: manipulation;
}

.stories-container::-webkit-scrollbar {
    height: 6px;
}

.stories-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.stories-container::-webkit-scrollbar-thumb {
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    transition: all 0.3s ease;
}

.stories-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ========================================
   LOAD MORE SECTION
   ======================================== */
.section-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0 40px 0;
    gap: 15px;
}

.btn-show-more {
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #c60812 100%);
    border: none;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 20px rgba(229, 9, 20, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-show-more:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #990a0a 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(229, 9, 20, 0.5);
    text-decoration: none;
    color: var(--text-primary);
}

.load-more-section {
    text-align: center;
    padding: 40px 20px;
}

.btn-load-more {
    padding: 14px 40px;
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.btn-load-more:hover {
    background-color: var(--primary-color);
    color: var(--text-primary);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet - 768px and below */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .inner-content {
        max-width: 100%;
        padding: 15px;
    }

    .hero-banner-section {
        height: 380px;
        /*margin-bottom: 40px;*/
    }

    .hero-content {
        padding: 30px;
    }

    .hero-content-text {
        max-width: 100%;
    }

    .hero-content-text h2 {
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .hero-content-text p {
        font-size: 0.95rem;
        margin-bottom: 15px;
        -webkit-line-clamp: 2;
    }

    .hero-actions {
        gap: 10px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 12px 24px;
        font-size: 0.95rem;
    }

    .hero-carousel-controls {
        right: 25px;
        bottom: 20px;
        gap: 10px;
    }

    .carousel-control-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .stories-section {
        padding: 0 25px 40px 25px;
        margin: 15px 10px;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .story-card {
        flex: 0 0 260px;
        height: 390px;
    }

    .stories-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 16px;
    }

    .stories-container {
        gap: 16px;
    }

    .story-card-overlay {
        padding: 12px;
    }

    .story-card-title {
        font-size: 0.9rem;
    }

    .story-card-author {
        font-size: 0.75rem;
    }
}

/* Mobile - 480px and below */
@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    .inner-content {
        max-width: 100%;
        padding: 16px;
    }

    .hero-banner-section {
        /*height: 480px;*/
        /*margin-bottom: 40px;*/
        margin-left: -16px;
        margin-right: -16px;
        border-radius: 0;
        width: calc(100% + 32px);
    }

    .hero-content {
        padding: 30px 20px 20px 20px;
        flex-direction: column;
        gap: 20px;
        min-height: auto;
        justify-content: flex-end;
        align-items: stretch;
    }

    .hero-content-text {
        max-width: 100%;
        flex: none;
    }

    .hero-content-text h2 {
        font-size: 2rem;
        margin-bottom: 12px;
        line-height: 1.2;
        font-weight: 800;
    }

    .hero-content-text p {
        font-size: 0.9rem;
        margin-bottom: 20px;
        -webkit-line-clamp: 2;
        line-height: 1.5;
    }

    .hero-actions {
        margin-bottom: 50px;
        width: 100%;
        flex-direction: column;
        gap: 12px;
        flex-wrap: nowrap;
        padding-bottom: 0;
        margin-top: auto;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 14px 20px;
        font-size: 0.95rem;
        justify-content: center;
    }

    .hero-carousel-controls {
        right: 15px;
        bottom: 15px;
        gap: 12px;
    }

    .carousel-control-btn {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }

    .stories-section {
        padding: 0 16px 40px 16px;
        margin: 0px -16px 0 -16px;
        width: calc(100% + 32px);
        background: linear-gradient(to bottom, transparent 0%, rgba(229, 9, 20, 0.03) 100%);
    }

    .section-title {
        font-size: 1.4rem;
        margin-bottom: 20px;
        padding-left: 16px;
        margin-left: -16px;
    }

    .story-card {
        flex: 0 0 200px;
        height: 300px;
    }

    .story-card:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        border-color: rgba(255, 255, 255, 0.05);
    }

    .stories-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }

    .stories-container {
        gap: 16px;
        padding: 15px 0 25px 0;
    }

    .story-card-overlay {
        padding: 12px;
    }

    .story-card-title {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .story-card-author {
        font-size: 0.7rem;
    }

    .story-card-btn {
        padding: 8px;
        font-size: 0.75rem;
    }

    .btn-show-more {
        padding: 12px 28px;
        font-size: 0.9rem;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   PHASE 2: STORY DETAIL PAGE
   ======================================== */

.story-detail-wrapper {
    position: relative;
    max-width: 2545px;
    margin: 0 auto;
    width: 100%;
    background-color: var(--bg-primary);
    padding: 0;
}

/* Story Hero Section */
.story-hero-section {
    position: relative;
    height: 500px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a1a 0%, var(--bg-secondary) 100%);
    border-radius: 0;
}

.story-hero-image {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.45) contrast(1.1);
    z-index: 1;
}

.story-hero-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    /* background: linear-gradient(to top, rgba(20, 20, 20, 0.98), rgba(20, 20, 20, 0.7), transparent); */
    z-index: 2;
}

.story-hero-content {
    position: absolute;
    bottom: 40px;
    left: 60px;
    right: 60px;
    z-index: 3;
    max-width: 65%;
}

.story-hero-content h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 15px 0;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.9);
    line-height: 1.2;
}

.story-hero-content p {
    font-size: 1rem;
    margin: 0 0 25px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-hero-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.story-close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 10;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.story-close-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* Story Back Button (Left-sided navigation) */
.story-back-btn {
    position: absolute;
    top: 20px;
    left: 30px;
    z-index: 10;
    width: auto;
    height: auto;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.story-back-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateX(-2px);
    text-decoration: none;
}

.story-back-btn:active {
    transform: translateX(-4px);
}

/* ========================================
   CHATSTORY PAGE DESIGN
   ======================================== */

/* Chat message list - flex column with gap and slide-in animation */
.chat-message-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message-list li {
    animation: slideInMessage 0.4s ease;
}

@keyframes slideInMessage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Left (recipient) message bubble — dark gradient */
.message-left .message-text {
    max-width: 70%;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    color: var(--text-primary);
    border-radius: 16px 16px 16px 4px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: box-shadow var(--transition-speed);
    font-size: 0.95rem;
    line-height: 1.5;
    display: inline-block;
}

.message-left .message-text:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.message-left .message-text:after {
    border-color: transparent transparent transparent #2a2a2a;
}

/* Right (user) message bubble — red gradient */
.message-right .message-text {
    max-width: 70%;
    width: auto;
    /* background: linear-gradient(135deg, var(--primary-color) 0%, #c80810 100%); */
    color: var(--text-primary);
    border-radius: 16px 16px 4px 16px;
    padding: 12px 16px;
    /* box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3); */
    /* font-weight: 600; */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: left;
    transition: all var(--transition-speed);
    display: inline-block;
}

.message-right .message-text:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    /* box-shadow: 0 6px 20px rgba(229, 9, 20, 0.45); */
}

.message-right .message-text:after {
    border-color: var(--primary-color) var(--primary-color) transparent transparent;
}

.message-right .message-contet,
.message-left .message-contet {
    background: transparent;
}

/* Sender name — gold accent */
.message-left .message-sender,
.message-right .message-sender {
    color: #f5b73a;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}

/* Message timestamps */
.message-left .message-time {
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-family: inherit;
}

.message-right .message-time {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
    font-family: inherit;
}

/* Admin / system messages */
.message-admin .message-text {
    background: rgba(245, 183, 58, 0.15);
    color: #f5b73a;
    border: 1px solid rgba(245, 183, 58, 0.3);
    border-radius: 8px;
}

/* Image messages */
.img-msg img {
    border-radius: 12px;
    max-height: 300px;
    width: auto;
    max-width: 100%;
}

/* Audio messages */
.audio-msg .message-text {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    color: var(--text-primary);
    border-radius: 12px;
    min-width: 200px;
}

/* Interactive option buttons */
.inOptions {
    background: rgba(229, 9, 20, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(229, 9, 20, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.inOptions:hover {
    background: rgba(229, 9, 20, 0.25);
    transform: translateX(4px);
    border-color: var(--primary-color);
    cursor: pointer;
}

/* Loading spinner — golden dots */
.spinner>div {
    background: #f5b73a;
}

/* Responsive chat — tablet */
@media (max-width: 768px) {

    .message-left .message-text,
    .message-right .message-text {
        max-width: 85%;
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .img-msg img {
        max-height: 250px;
    }
}

/* Responsive chat — mobile */
@media (max-width: 480px) {

    .message-left .message-text,
    .message-right .message-text {
        max-width: 90%;
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .img-msg img {
        max-height: 200px;
    }
}

/* Story Info Card */
.story-info-card {
    max-width: 2545px;
    margin: 0 auto;
    padding: 40px;
    width: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(229, 9, 20, 0.02) 100%);
}

.story-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 15px 0;
    color: var(--text-primary);
}

.story-metadata {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.story-metadata-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.story-author {
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.story-reading-time {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.story-rating-display {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-color);
    font-weight: 600;
}

.story-rating-star {
    font-size: 1.1rem;
    color: var(--accent-color);
}

.story-description {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 30px;
    max-width: 800px;
}

.story-actions-primary {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.btn-read-story {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #c60812 100%);
    color: var(--text-primary);
    border: none;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 20px rgba(229, 9, 20, 0.3);
    text-decoration: none;
    display: inline-flex;
}

.btn-read-story:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #990a0a 100%);
    transform: translateY(-3px);
    text-decoration: none;
    box-shadow: 0 12px 30px rgba(229, 9, 20, 0.5);
}

.btn-story-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
}

.btn-story-action:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
}

/* Similar Stories Section */
.similar-stories-section {
    max-width: 2545px;
    margin: 50px auto 0 auto;
    padding: 0 40px 50px 40px;
    width: 100%;
    position: relative;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 15px;
}

.section-title::before {
    content: '';
    width: 5px;
    height: 32px;
    background: linear-gradient(to bottom, var(--primary-color), transparent);
    border-radius: 3px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, var(--primary-color), transparent);
}

.similar-stories-container {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 15px 0 25px 0;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    user-select: none;
    -webkit-user-select: none;
    overscroll-behavior: contain;
    touch-action: manipulation;
}

.similar-stories-container::-webkit-scrollbar {
    display: none;
}

.similar-story-card {
    flex: 0 0 300px;
    height: 450px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    background-color: var(--bg-secondary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    touch-action: manipulation;
}

.similar-story-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 15px 40px rgba(229, 9, 20, 0.4);
    border-color: rgba(229, 9, 20, 0.3);
}

.similar-story-image {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
    filter: brightness(0.9);
}

.similar-story-card:hover .similar-story-image {
    transform: scale(1.1);
    filter: brightness(1);
}

.similar-story-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.95) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 14px;
    z-index: 2;
    transition: background 0.4s ease;
}

.similar-story-card:hover .similar-story-overlay {
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.2) 0%, rgba(0, 0, 0, 0.98) 100%);
}

.similar-story-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.similar-story-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.similar-story-author {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.similar-story-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    margin-top: 2px;
}

/* Scroll Buttons */
.story-scroll-buttons {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    pointer-events: none;
    z-index: 20;
    display: none;
}

.story-scroll-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(229, 9, 20, 0.9);
    border: 2px solid var(--primary-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    pointer-events: auto;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4);
}

.story-scroll-btn:hover {
    background-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(229, 9, 20, 0.6);
}

.story-scroll-btn:active {
    transform: scale(0.95);
}

/* Reviews Section */
.story-reviews-section {
    max-width: 2545px;
    margin: 0 auto;
    padding: 0 40px 50px 40px;
    width: 100%;
}

.story-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-item {
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.review-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(229, 9, 20, 0.3);
}

.review-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px 0;
}

.review-author {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ========================================
   PHASE 2: RESPONSIVE DESIGN
   ======================================== */

/* Tablet - 768px and below */
@media (max-width: 768px) {
    .story-hero-section {
        height: 350px;
    }

    .story-hero-content {
        bottom: 30px;
        left: 30px;
        right: 30px;
        max-width: 100%;
    }

    .story-hero-content h2 {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }

    .story-hero-content p {
        font-size: 0.9rem;
        margin-bottom: 15px;
        -webkit-line-clamp: 2;
    }

    .story-hero-actions {
        gap: 10px;
    }

    .story-back-btn {
        padding: 8px 14px;
        font-size: 0.9rem;
        top: 15px;
        left: 15px;
    }

    .btn-read-story,
    .btn-story-action {
        padding: 12px 24px;
        font-size: 0.95rem;
    }

    .story-info-card {
        padding: 25px;
    }

    .story-title {
        font-size: 1.5rem;
    }

    .story-metadata {
        gap: 15px;
    }

    .story-metadata-item {
        font-size: 0.85rem;
    }

    .story-description {
        font-size: 0.9rem;
    }

    .similar-stories-section {
        padding: 0 25px 40px 25px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .similar-story-card {
        flex: 0 0 260px;
        height: 390px;
    }

    .similar-story-title {
        font-size: 0.9rem;
    }

    .similar-story-author {
        font-size: 0.75rem;
    }

    .story-reviews-section {
        padding: 0 25px 40px 25px;
    }
}

/* Mobile - 480px and below */
@media (max-width: 480px) {
    .story-detail-wrapper {
        padding: 0;
    }

    .story-hero-section {
        height: 250px;
    }

    .story-hero-content {
        bottom: 20px;
        left: 20px;
        right: 20px;
        max-width: 100%;
    }

    .story-hero-content h2 {
        font-size: 1.4rem;
        margin-bottom: 8px;
    }

    .story-back-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        top: 12px;
        left: 12px;
    }

    .story-hero-content p {
        font-size: 0.8rem;
        margin-bottom: 12px;
        -webkit-line-clamp: 1;
    }

    .story-hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-read-story,
    .btn-story-action {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    .story-close-btn {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
        top: 15px;
        right: 15px;
    }

    .story-info-card {
        padding: 12px;
    }

    .story-title {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    .story-metadata {
        gap: 12px;
        flex-direction: column;
        align-items: flex-start;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 15px;
    }

    .story-metadata-item {
        font-size: 0.75rem;
    }

    .story-description {
        font-size: 0.8rem;
        margin-bottom: 20px;
    }

    .similar-stories-section {
        padding: 0 12px 30px 12px;
    }

    .section-title {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    .similar-story-card {
        flex: 0 0 180px;
        height: 270px;
    }

    .similar-story-title {
        font-size: 0.85rem;
    }

    .similar-story-author {
        font-size: 0.65rem;
    }

    .story-reviews-section {
        padding: 0 12px 30px 12px;
    }

    .review-item {
        padding: 15px;
    }

    .review-title {
        font-size: 0.9rem;
    }

    .review-author {
        font-size: 0.75rem;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0a0a0a;
        --bg-secondary: #1a1a1a;
    }
}