/* Discover Page Specific Styles */
.discover-page .filters-bar {
    /* Add some visual separation */
}

.discover-page .form-label {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.discover-page .form-select,
.discover-page .form-control {
    font-size: 0.9rem;
}

.story-card-public {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.story-card-public:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.story-card-public .card-img-top {
    width: 100%;
    height: 200px; /* Fixed height for uniform card size */
    object-fit: cover; /* Crop image to fit, maintain aspect ratio */
}

.story-card-public .card-body {
    display: flex;
    flex-direction: column;
}

.story-card-public .card-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.story-card-public .card-title a {
    color: inherit; /* Inherit color from card for consistent link styling */
    text-decoration: none;
}

.story-card-public .card-title a:hover {
    color: var(--bs-primary); /* Theme primary color on hover */
}

.story-card-public .card-text.small {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.story-card-public .card-text:not(.small) { /* Synopsis */
    font-size: 0.9rem;
    line-height: 1.4;
    /* Controlling synopsis length with JS is better, but CSS can help for overflow */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Show approx 3 lines */
    -webkit-box-orient: vertical;
    min-height: calc(1.4em * 3); /* Ensure space for 3 lines to avoid jumpiness */
}

.story-card-public .story-interactions small {
    font-size: 0.85rem;
}

.story-card-public .btn-outline-primary {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
}

.story-card-public .card-footer {
    font-size: 0.8rem;
}

/* Pagination styling enhancements */
.pagination .page-link {
    font-size: 0.9rem;
}

.pagination .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Ensure loading and no-stories messages are centered within the grid layout */
#stories-container .col p {
    width: 100%; /* Make the paragraph take full width of the column */
}

/* Hero Discover Stories Section */
.hero-discover-stories .carousel-item {
    height: 450px; /* Adjust height as needed */
    min-height: 300px;
}

.hero-slide-content {
    height: 100%;
    background-size: cover;
    background-position: center center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    border-radius: 0.5rem; /* Match Bootstrap card radius */
    overflow: hidden;
}

.hero-slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 60%, rgba(0, 0, 0, 0.0) 100%);
    color: #fff;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end; 
    padding-bottom: 6rem; /* Desktop: Increased further to drop text lower (was 4rem) */
    text-align: left;
}

.hero-pill-tag {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #ffffff; /* White background */
    color: #000000; /* Black text */
    padding: 0.4em 0.8em; /* Slightly adjusted padding */
    font-size: 0.8rem; /* Slightly smaller */
    font-weight: 600; /* Bolder */
    border-radius: 50rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Subtle shadow */
}

.hero-story-title {
    font-size: 2.2rem; /* Slightly adjusted */
    font-weight: 700;
    margin-bottom: 0.5rem; /* Reduced margin */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
    width: 100%; /* Ensure it takes full width before button potentially pushes it */
}

.hero-story-synopsis {
    font-size: 1rem;
    margin-bottom: 1.25rem;
    max-width: 70%;
    line-height: 1.5;
    height: 3em; /* 2 lines * 1.5em line-height */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.hero-read-btn {
    /* This class is no longer used as button is removed, but kept for history or future use */
    /* display: none; */ 
}

/* Carousel Controls Styling for better visibility */
.hero-discover-stories .carousel-control-prev-icon,
.hero-discover-stories .carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 10px; /* Increase hit target */
    width: 40px; /* Ensure min 44pt equivalent */
    height: 40px;
}

.hero-discover-stories .carousel-indicators [data-bs-target] {
    width: 12px; /* Larger dots */
    height: 12px;
    border-radius: 50%;
    margin: 0 6px; /* More spacing */
    background-color: rgba(255, 255, 255, 0.6); /* More opaque */
    border: 1px solid rgba(0, 0, 0, 0.2); /* Subtle border */
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.hero-discover-stories .carousel-indicators .active {
    background-color: #6a11cb; /* Purple for active indicator */
    opacity: 1;
    width: 14px; /* Slightly larger active dot */
    height: 14px;
}


/* Responsive adjustments for hero */
@media (max-width: 768px) { /* Tablet and below */
    .hero-slide-overlay {
        align-items: center; /* Center align items on mobile */
        text-align: center; /* Center text on mobile */
        padding: 1.5rem;
    }
    .hero-story-title {
        font-size: 1.8rem;
        max-width: 100%;
    }
    .hero-story-synopsis {
        font-size: 0.9rem;
        margin-bottom: 1rem;
        max-width: 90%; /* Allow more width on mobile */
    }
    .hero-read-btn {
        align-self: center; /* Center button on mobile */
        padding: 0.6rem 1.2rem;
        font-size: 1rem;
    }
}

@media (max-width: 576px) { /* Small mobile */
    .hero-discover-stories .carousel-item {
        height: 370px; /* Increased height slightly more for synopsis room */
    }
    .hero-slide-overlay {
        padding-bottom: 1.5rem; /* Mobile: Adjusted for better text placement */
        justify-content: flex-end; /* Ensure content aligns to bottom */
    }
    .hero-story-title {
        font-size: 1.6rem;
    }
    .hero-story-synopsis {
        font-size: 0.85rem;
        line-height: 1.4; /* Explicit line-height for mobile synopsis */
        height: 2.8em; /* 2 lines * 1.4em */
        -webkit-line-clamp: 2;
        margin-bottom: 0.5rem; /* Ensure some space below synopsis before edge */
    }
    /* .hero-read-btn styling removed as button is gone */
    /* Mobile: Ensure images in Most Popular fill their wrappers */
    .top-10-list .story-card-popular .card-img-top-wrapper {
        height: auto; /* Mobile: auto height for wrapper */
    }
    .top-10-list .story-card-popular .card-img-top {
        width: 100%;
        height: auto; /* Adjust if wrapper is auto */
        object-fit: cover; /* Or contain, depending on desired effect with auto height */
    }
    /* Mobile: Ensure images in Story Type sections fill their wrappers */
    .story-type-row .story-card-spotify .card-img-top-wrapper,
    .story-type-row .story-card-spotify .card-img-top {
        height: auto; /* Mobile: auto height for wrapper and image */
        width: 100%;
        object-fit: cover;
    }
}

/* New Discover Page Section Styling */
.discover-section {
    margin-bottom: 2.5rem; /* More space between sections */
}

.discover-section .section-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-left: 15px; /* Align with potential container padding */
    text-transform: capitalize;
}

.horizontal-scroll-wrapper {
    overflow-x: auto;
    white-space: nowrap; /* Prevent items from wrapping to next line */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    padding-bottom: 15px; /* Space for scrollbar without content overlap */
    margin-bottom: -15px; /* Counteract padding-bottom for layout */
}

/* Hide scrollbar visually but keep functionality */
.horizontal-scroll-wrapper::-webkit-scrollbar {
    display: none; /* For Chrome, Safari, and Opera */
}
.horizontal-scroll-wrapper {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.horizontal-scroll {
    display: inline-block; /* Allow items to sit side-by-side */
    padding-left: 15px; /* Initial padding for the first item */
    padding-right: 15px; /* Padding for the last item */
}

.horizontal-scroll > * {
    display: inline-block;
    vertical-align: top; /* Align items to the top */
    margin-right: 15px; /* Space between items */
    white-space: normal; /* Allow text wrapping within items */
}

.horizontal-scroll > *:last-child {
    margin-right: 0;
}

/* Section 1: Top 10 Most Popular */
.top-10-list-wrapper {
    /* overflow-x: hidden; /* Reverted: Prevent horizontal scrolling */
    overflow-x: auto; /* Added: Allow horizontal scroll */
    white-space: nowrap; /* Added: Essential for horizontal scroll of inline-blocks */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    padding-bottom: 15px; /* Space for scrollbar without content overlap */
    margin-bottom: -15px; /* Counteract padding-bottom for layout */
}

.top-10-list {
    /* display: flex; /* Reverted: Use flex for layout if not scrolling */
    /* justify-content: center; /* Reverted */
    /* flex-wrap: wrap; /* Reverted */
    display: inline-block; /* Added: Allow items to sit side-by-side for scroll */
    padding-left: 15px; /* Initial padding for the first item */
    padding-right: 15px; /* Padding for the last item */
}

.top-10-list .top-10-item {
    display: inline-flex; /* Keep this for item layout */
    align-items: center;
    width: 400px; /* Desktop */
    position: relative;
    margin-right: 20px; /* Desktop */
    margin-left: 20px; /* Desktop */
}

.top-10-list .top-10-number {
    letter-spacing: -50px;
    font-size: 20rem;
    font-weight: 700;
    color: #e0e0e000; /* Transparent color */
    line-height: 0; /* Adjusted line-height */
    margin-right: -10px; /* Desktop: Adjusted from 45px */
    z-index: 1;
    font-family: 'Arial Black', Gadget, sans-serif;
    -webkit-text-stroke: 4px #b9b9b9; /* Adjusted stroke */
    paint-order: stroke fill;
    transform: translateY(-20px); /* Added transform */
}

.top-10-list .story-card-popular {
    width: 100%; /* Card takes width from top-10-item adjusted for number */
    /* margin-left is removed as top-10-number positioning handles overlap */
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    /* height: auto; Set a fixed height if strict uniformity is absolutely needed across varying content */
}

.top-10-list .story-card-popular .card-img-top-wrapper {
    position: relative; /* For positioning interactions */
    height: 150px; /* Or desired fixed height */
}

.top-10-list .story-card-popular .card-img-top {
    width: 100%;
    height: 100%; /* Fill the wrapper */
    object-fit: cover;
}

.top-10-list .story-card-popular .story-interactions-on-image {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    z-index: 3; /* Above image */
}

.top-10-list .story-card-popular .story-interactions-on-image i {
    color: white;
}

.top-10-list .story-card-popular .card-body {
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.top-10-list .story-card-popular .card-title {
    font-size: 1rem; /* Adjust as needed */
    margin-bottom: 0.25rem;
    line-height: 1.3em;
    height: 2.6em; /* Fixed height for 2 lines */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.top-10-list .story-card-popular .card-title a, .top-10-list .story-card-popular .card-title {
    color: #212529 !important; /* Bootstrap's default .text-dark color */
    text-decoration: none;
}
.top-10-list .story-card-popular .card-text.small { /* Author By line */
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
    line-height: 1.3em;
    height: 1.3em; /* Fixed height for 1 line */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.top-10-list .story-card-popular .synopsis-text { /* Synopsis */
    font-size: 0.8rem;
    line-height: 1.4em;
    height: 2.8em; /* Fixed height for 2 lines (2 * 1.4em) */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    /* min-height removed as we use fixed height now */
}

/* Remove old story-interactions display from card body */
.top-10-list .story-card-popular .story-interactions,
.top-10-list .story-card-popular .btn-outline-primary {
    display: none !important;
}

.top-10-list .story-card-popular:hover {
    transform: none; /* Remove hover effect */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); /* Keep base shadow, remove hover shadow change */
}

/* Section 2: Characters */
.characters-list-wrapper {
    /* Specific wrapper styles if needed */
}
.characters-list .character-item {
    width: 120px; /* Width of character item */
    text-align: center;
    margin-right: 20px;
}
.characters-list .character-image-wrapper {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 10px auto;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.characters-list .character-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.characters-list .character-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
}

/* Section 3: Trending Stories (Wider Tiles) */
.trending-stories-wrapper {
    /* Specific wrapper styles if needed */
}
.trending-stories-list .story-card-trending {
    width: 300px; /* Wider card */
    height: auto; /* Adjust height based on content */
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.trending-stories-list .story-card-trending:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}
.trending-stories-list .story-card-trending .card-img-top {
    width: 100%;
    height: 180px; /* Adjust image height */
    object-fit: cover;
}

/* Added for trending interactions on image */
.trending-stories-list .story-card-trending .card-img-top-wrapper {
    position: relative;
    height: 180px; /* Match image height */
}

.trending-stories-list .story-card-trending .story-interactions-on-image {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    z-index: 3;
}

.trending-stories-list .story-card-trending .story-interactions-on-image i {
    color: white;
}

.trending-stories-list .story-card-trending .card-body {
    padding: 1rem;
}
.trending-stories-list .story-card-trending .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #222;
    line-height: 1.3em;
    height: 2.6em; /* Fixed for 2 lines */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.trending-stories-list .story-card-trending .card-title a {
    color: inherit;
    text-decoration: none;
}
.trending-stories-list .story-card-trending .card-title a:hover {
    color: var(--bs-primary);
}
/* Hide synopsis, author, interactions for trending cards for a cleaner look if desired */
.trending-stories-list .story-card-trending .card-text,
.trending-stories-list .story-card-trending .story-interactions,
.trending-stories-list .story-card-trending .card-footer {
    display: none;
}


/* Section 4+: Story Type Rows (Spotify-like) */
.story-type-section .section-title {
    font-size: 1.5rem; /* Slightly smaller for these sub-sections */
    margin-bottom: 0.8rem;
}

.story-type-row-wrapper {
    /* Specific wrapper styles if needed */
}

.story-type-row .story-card-spotify {
    width: 180px; /* Spotify-like card width */
    margin-right: 15px;
}
.story-type-row .story-card-spotify .card-img-top {
    height: 180px; /* Square-ish image */
    object-fit: cover;
    border-radius: 6px; /* Rounded images */
}

/* Added for story type interactions on image */
.story-type-row .story-card-spotify .card-img-top-wrapper {
    position: relative;
    height: 180px; /* Match image height */
}

.story-type-row .story-card-spotify .story-interactions-on-image {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 3px 6px; /* Smaller padding */
    border-radius: 4px;
    font-size: 0.7rem; /* Smaller font */
    z-index: 3;
}

.story-type-row .story-card-spotify .story-interactions-on-image i {
    color: white;
}

.story-type-row .story-card-spotify .card-body {
    padding: 0.75rem 0.25rem; /* Less padding for compact look */
    text-align: left;
}
.story-type-row .story-card-spotify .card-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #222; /* Black title color */
}
.story-type-row .story-card-spotify .author-text { /* Author */
    font-size: 0.75rem; /* Reduced size */
    font-weight: 500; /* Increased weight */
    color: #6c757d;
}
.story-type-row .story-card-spotify .card-text.small { /* Author */
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Hide synopsis, interactions, footer for spotify cards */
.story-type-row .story-card-spotify .card-text:not(.small),
.story-type-row .story-card-spotify .story-interactions,
.story-type-row .story-card-spotify .btn-outline-primary,
.story-type-row .story-card-spotify .card-footer {
    display: none;
}

@media (max-width: 768px) {
    .discover-section .section-title {
        font-size: 1.5rem;
        padding-left: 10px;
    }
    .horizontal-scroll {
        padding-left: 10px;
        padding-right: 10px;
    }
    .top-10-list .top-10-item {
        width: 350px;
        margin-left: 0px;
        margin-right: 5px;
    }
    .top-10-list .top-10-number {
        font-size: 15rem;
        margin-right: -20px; /* Mobile: specific margin */
        letter-spacing: -30px;
        /* transform: translateY(-10px); /* Mobile specific transform if needed */
    }
    .top-10-list .story-card-popular .card-img-top-wrapper {
        height: auto; /* Mobile: auto height for wrapper */
    }
    .top-10-list .story-card-popular .card-title {
        font-size: 0.9rem; /* Mobile title size */
        height: 2.4em; /* Recalculate for 2 lines if font-size changes */
         -webkit-line-clamp: 2;
    }
    .top-10-list .story-card-popular .synopsis-text {
        font-size: 0.75rem; /* Mobile synopsis size */
        height: 2.6em;  /* Recalculate for 2 lines if font-size changes */
        -webkit-line-clamp: 2;
    }
    .top-10-list .story-card-popular .story-interactions-on-image {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
    .characters-list .character-item {
        width: 100px;
    }
    .characters-list .character-image-wrapper {
        width: 80px;
        height: 80px;
    }

    /* Trending Stories Mobile - Match Desktop Appearance */
    .trending-stories-list .story-card-trending {
        width: 300px; /* Match desktop width */
        /* Other properties like box-shadow, border-radius are inherited or same */
    }
    .trending-stories-list .story-card-trending .card-img-top-wrapper,
    .trending-stories-list .story-card-trending .card-img-top {
        height: auto; /* Mobile: auto height for wrapper and image */
    }
    .trending-stories-list .story-card-trending .card-title {
        font-size: 1.1rem; /* Match desktop title font size */
        height: 2.6em; /* Match desktop title height (2 lines) */
        -webkit-line-clamp: 2;
    }
    .trending-stories-list .story-card-trending .story-interactions-on-image {
        font-size: 0.75rem; /* Match desktop interactions font size */
        padding: 4px 8px; /* Match desktop interactions padding */
    }

    /* Story Type Rows on Mobile - Ensure matches Desktop Appearance */
    .story-type-row .story-card-spotify {
        width: 180px; /* Already set to match desktop width */
        margin-right: 15px;
    }
    .story-type-row .story-card-spotify .card-img-top-wrapper,
    .story-type-row .story-card-spotify .card-img-top {
        height: auto; /* Mobile: auto height for wrapper and image */
        width: 100%;
        object-fit: cover;
    }
    /* Title and Author text for Spotify cards are simple and responsive, 
       ensuring they don't have conflicting mobile-specific overrides is key */
    .story-type-row .story-card-spotify .card-title {
        font-size: 0.95rem; /* Re-assert desktop size if it was changed for mobile */
         /* white-space, overflow, text-overflow are inherited */
    }
    .story-type-row .story-card-spotify .author-text {
        font-size: 0.75rem; /* Re-assert desktop size */
        font-weight: 500;   /* Re-assert desktop weight */
         /* white-space, overflow, text-overflow are inherited */
    }
    .story-type-row .story-card-spotify .story-interactions-on-image {
        font-size: 0.7rem; /* Match desktop style (or make consistent if different) */
        padding: 3px 6px;  /* Match desktop style */
    }
} 