/* CSS Gradients for default covers */
.bg-grad-1 {
    background: linear-gradient(135deg, #2b5876 0%, #4e4376 100%);
}

.bg-grad-2 {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.bg-grad-3 {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.bg-grad-4 {
    background: linear-gradient(135deg, #cc208e 0%, #6713d2 100%);
}

.bg-grad-5 {
    background: linear-gradient(135deg, #f857a6 0%, #ff5858 100%);
}

/* Flattened details cover wrapper */
.book-cover-3d-wrapper {
    position: relative;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    aspect-ratio: 3/4;
    width: 100%;
    background: #1a1a2e;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform, box-shadow;
}

.book-cover-3d-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(139, 92, 246, 0.3);
}

.book-cover-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem 1rem 1rem 1.5rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    position: relative;
}

/* Gift selection styling */
.gift-item-card {
    cursor: pointer;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    transition: border-color 0.2s ease, background-color 0.2s ease, background 0.2s ease;
    background: var(--input-bg);
    color: var(--text-main);
    will-change: border-color, background;
}

.gift-item-card:hover {
    border-color: rgba(255, 193, 7, 0.4);
    background: rgba(255, 193, 7, 0.08);
}

.gift-item-card.selected {
    border-color: #ffc107 !important;
    background: rgba(255, 193, 7, 0.15) !important;
}

/* Gift Modal styling */
.gift-modal-content {
    background: var(--dropdown-bg) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-main) !important;
}

.gift-modal-content .bg-custom-card {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
}

.gift-modal-content .form-control-custom {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}

.gift-modal-content .form-control-custom:focus {
    background: var(--input-bg-focus);
    border-color: #f59e0b;
    color: var(--text-main);
    box-shadow: none;
}

/* Light Theme text-warning & gold contrast adjustments for Modals & BXH */
[data-bs-theme="light"] .text-warning {
    color: #d97706 !important; /* Deep rich amber/gold for high contrast on light background */
}

[data-bs-theme="light"] .bg-warning {
    background-color: #d97706 !important;
}

[data-bs-theme="light"] .bg-warning.bg-opacity-10 {
    background-color: rgba(217, 119, 6, 0.12) !important;
}

/* Custom Tag Badges for high contrast in dark and light themes */
.story-tag-badge {
    background: rgba(14, 165, 233, 0.18) !important;
    border: 1px solid rgba(56, 189, 248, 0.4) !important;
    color: #38bdf8 !important;
    transition: all 0.2s ease;
}

.story-tag-badge:hover {
    background: rgba(14, 165, 233, 0.35) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

[data-bs-theme="light"] .story-tag-badge {
    background: rgba(2, 132, 199, 0.1) !important;
    border: 1px solid rgba(2, 132, 199, 0.3) !important;
    color: #0284c7 !important;
}

[data-bs-theme="light"] .story-tag-badge:hover {
    background: #0284c7 !important;
    color: #ffffff !important;
}

[data-bs-theme="light"] .gift-modal-content .alert-warning,
[data-bs-theme="light"] .flower-modal-content .alert-warning {
    color: #b45309 !important;
    background-color: rgba(217, 119, 6, 0.1) !important;
    border-color: rgba(217, 119, 6, 0.2) !important;
}

[data-bs-theme="light"] .gift-item-card .text-warning {
    color: #d97706 !important;
}

[data-bs-theme="light"] .gift-item-card.selected {
    border-color: #d97706 !important;
    background: rgba(217, 119, 6, 0.12) !important;
}

[data-bs-theme="light"] .flower-modal-content .btn-outline-warning {
    color: #d97706 !important;
    border-color: #d97706 !important;
}

[data-bs-theme="light"] .flower-modal-content .btn-outline-warning:hover {
    color: #ffffff !important;
    background-color: #d97706 !important;
}

/* Top 10 Gift Donors Flashing & Glowing Effects */
@keyframes gold-text-glow {

    0%,
    100% {
        color: #ffd700;
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.4);
    }

    50% {
        color: #ff8c00;
        text-shadow: 0 0 10px rgba(255, 165, 0, 0.8);
    }
}

@keyframes gold-border-glow {

    0%,
    100% {
        border-color: #ffd700;
        box-shadow: 0 0 3px #ffd700;
    }

    50% {
        border-color: #ff8c00;
        box-shadow: 0 0 8px #ff8c00;
    }
}

@keyframes silver-text-glow {

    0%,
    100% {
        color: #f1f5f9;
        text-shadow: 0 0 5px rgba(241, 245, 249, 0.4);
    }

    50% {
        color: #cbd5e1;
        text-shadow: 0 0 10px rgba(203, 213, 225, 0.8);
    }
}

@keyframes silver-border-glow {

    0%,
    100% {
        border-color: #c0c0c0;
        box-shadow: 0 0 3px #c0c0c0;
    }

    50% {
        border-color: #cbd5e1;
        box-shadow: 0 0 8px #cbd5e1;
    }
}

@keyframes bronze-text-glow {

    0%,
    100% {
        color: #f59e0b;
        text-shadow: 0 0 5px rgba(245, 158, 11, 0.4);
    }

    50% {
        color: #d97706;
        text-shadow: 0 0 10px rgba(217, 119, 6, 0.7);
    }
}

@keyframes bronze-border-glow {

    0%,
    100% {
        border-color: #cd7f32;
        box-shadow: 0 0 3px #cd7f32;
    }

    50% {
        border-color: #b45309;
        box-shadow: 0 0 8px #b45309;
    }
}

@keyframes rank4-text {

    0%,
    100% {
        color: #e9d5ff;
        text-shadow: 0 0 4px #c084fc;
    }

    50% {
        color: #d8b4fe;
        text-shadow: 0 0 8px #c084fc;
    }
}

@keyframes rank4-border {

    0%,
    100% {
        border-color: #a855f7;
    }

    50% {
        border-color: #c084fc;
        box-shadow: 0 0 6px #a855f7;
    }
}

@keyframes rank5-text {

    0%,
    100% {
        color: #fca5a5;
        text-shadow: 0 0 4px #f87171;
    }

    50% {
        color: #f87171;
        text-shadow: 0 0 8px #f87171;
    }
}

@keyframes rank5-border {

    0%,
    100% {
        border-color: #ef4444;
    }

    50% {
        border-color: #f87171;
        box-shadow: 0 0 6px #ef4444;
    }
}

@keyframes rank6-text {

    0%,
    100% {
        color: #bbf7d0;
        text-shadow: 0 0 4px #4ade80;
    }

    50% {
        color: #86efac;
        text-shadow: 0 0 8px #4ade80;
    }
}

@keyframes rank6-border {

    0%,
    100% {
        border-color: #22c55e;
    }

    50% {
        border-color: #4ade80;
        box-shadow: 0 0 6px #22c55e;
    }
}

@keyframes rank7-text {

    0%,
    100% {
        color: #99f6e4;
        text-shadow: 0 0 4px #2dd4bf;
    }

    50% {
        color: #5eead4;
        text-shadow: 0 0 8px #2dd4bf;
    }
}

@keyframes rank7-border {

    0%,
    100% {
        border-color: #0d9488;
    }

    50% {
        border-color: #2dd4bf;
        box-shadow: 0 0 6px #2dd4bf;
    }
}

@keyframes rank8-text {

    0%,
    100% {
        color: #fbcfe8;
        text-shadow: 0 0 4px #f472b6;
    }

    50% {
        color: #f472b6;
        text-shadow: 0 0 8px #f472b6;
    }
}

@keyframes rank8-border {

    0%,
    100% {
        border-color: #db2777;
    }

    50% {
        border-color: #f472b6;
        box-shadow: 0 0 6px #db2777;
    }
}

@keyframes rank9-text {

    0%,
    100% {
        color: #bfdbfe;
        text-shadow: 0 0 4px #60a5fa;
    }

    50% {
        color: #93c5fd;
        text-shadow: 0 0 8px #60a5fa;
    }
}

@keyframes rank9-border {

    0%,
    100% {
        border-color: #2563eb;
    }

    50% {
        border-color: #60a5fa;
        box-shadow: 0 0 6px #2563eb;
    }
}

@keyframes rank10-text {

    0%,
    100% {
        color: #fed7aa;
        text-shadow: 0 0 4px #fb923c;
    }

    50% {
        color: #fdba74;
        text-shadow: 0 0 8px #fb923c;
    }
}

@keyframes rank10-border {

    0%,
    100% {
        border-color: #ea580c;
    }

    50% {
        border-color: #fb923c;
        box-shadow: 0 0 6px #ea580c;
    }
}

/* Light Theme Text Animations for readability */
@keyframes gold-text-light {

    0%,
    100% {
        color: #d97706;
    }

    50% {
        color: #92400e;
    }
}

@keyframes silver-text-light {

    0%,
    100% {
        color: #475569;
    }

    50% {
        color: #1e293b;
    }
}

@keyframes bronze-text-light {

    0%,
    100% {
        color: #b45309;
    }

    50% {
        color: #78350f;
    }
}

@keyframes rank4-text-light {

    0%,
    100% {
        color: #7e22ce;
    }

    50% {
        color: #581c87;
    }
}

@keyframes rank5-text-light {

    0%,
    100% {
        color: #dc2626;
    }

    50% {
        color: #991b1b;
    }
}

@keyframes rank6-text-light {

    0%,
    100% {
        color: #16a34a;
    }

    50% {
        color: #166534;
    }
}

@keyframes rank7-text-light {

    0%,
    100% {
        color: #0891b2;
    }

    50% {
        color: #155e75;
    }
}

@keyframes rank8-text-light {

    0%,
    100% {
        color: #db2777;
    }

    50% {
        color: #9d174d;
    }
}

@keyframes rank9-text-light {

    0%,
    100% {
        color: #2563eb;
    }

    50% {
        color: #1e3a8a;
    }
}

@keyframes rank10-text-light {

    0%,
    100% {
        color: #ea580c;
    }

    50% {
        color: #9a3412;
    }
}

/* Assign Animations to ranks */
.rank-1-text {
    animation: gold-text-glow 2s infinite ease-in-out;
    font-weight: 700 !important;
}

.rank-1-avatar {
    border: 2px solid;
    animation: gold-border-glow 2s infinite ease-in-out;
}

.rank-2-text {
    animation: silver-text-glow 2s infinite ease-in-out;
    font-weight: 700 !important;
}

.rank-2-avatar {
    border: 2px solid;
    animation: silver-border-glow 2s infinite ease-in-out;
}

.rank-3-text {
    animation: bronze-text-glow 2s infinite ease-in-out;
    font-weight: 700 !important;
}

.rank-3-avatar {
    border: 2px solid;
    animation: bronze-border-glow 2s infinite ease-in-out;
}

.rank-4-text {
    animation: rank4-text 2.5s infinite ease-in-out;
    font-weight: 600 !important;
}

.rank-4-avatar {
    border: 2px solid;
    animation: rank4-border 2.5s infinite ease-in-out;
}

.rank-5-text {
    animation: rank5-text 2.5s infinite ease-in-out;
    font-weight: 600 !important;
}

.rank-5-avatar {
    border: 2px solid;
    animation: rank5-border 2.5s infinite ease-in-out;
}

.rank-6-text {
    animation: rank6-text 2.5s infinite ease-in-out;
    font-weight: 600 !important;
}

.rank-6-avatar {
    border: 2px solid;
    animation: rank6-border 2.5s infinite ease-in-out;
}

.rank-7-text {
    animation: rank7-text 2.5s infinite ease-in-out;
    font-weight: 600 !important;
}

.rank-7-avatar {
    border: 2px solid;
    animation: rank7-border 2.5s infinite ease-in-out;
}

.rank-8-text {
    animation: rank8-text 2.5s infinite ease-in-out;
    font-weight: 600 !important;
}

.rank-8-avatar {
    border: 2px solid;
    animation: rank8-border 2.5s infinite ease-in-out;
}

.rank-9-text {
    animation: rank9-text 2.5s infinite ease-in-out;
    font-weight: 600 !important;
}

.rank-9-avatar {
    border: 2px solid;
    animation: rank9-border 2.5s infinite ease-in-out;
}

.rank-10-text {
    animation: rank10-text 2.5s infinite ease-in-out;
    font-weight: 600 !important;
}

.rank-10-avatar {
    border: 2px solid;
    animation: rank10-border 2.5s infinite ease-in-out;
}

/* Light Theme Overrides for top 10 text colors */
[data-bs-theme="light"] .rank-1-text {
    animation: gold-text-light 2s infinite ease-in-out;
}

[data-bs-theme="light"] .rank-2-text {
    animation: silver-text-light 2s infinite ease-in-out;
}

[data-bs-theme="light"] .rank-3-text {
    animation: bronze-text-light 2s infinite ease-in-out;
}

[data-bs-theme="light"] .rank-4-text {
    animation: rank4-text-light 2.5s infinite ease-in-out;
}

[data-bs-theme="light"] .rank-5-text {
    animation: rank5-text-light 2.5s infinite ease-in-out;
}

[data-bs-theme="light"] .rank-6-text {
    animation: rank6-text-light 2.5s infinite ease-in-out;
}

[data-bs-theme="light"] .rank-7-text {
    animation: rank7-text-light 2.5s infinite ease-in-out;
}

[data-bs-theme="light"] .rank-8-text {
    animation: rank8-text-light 2.5s infinite ease-in-out;
}

[data-bs-theme="light"] .rank-9-text {
    animation: rank9-text-light 2.5s infinite ease-in-out;
}

[data-bs-theme="light"] .rank-10-text {
    animation: rank10-text-light 2.5s infinite ease-in-out;
}

/* Rank Badge Base Styles - Left Chevron Clip-Path for ALL Ranks (Safari Mobile Supported) */
.rank-badge {
    width: 32px;
    height: 22px;
    font-size: 0.75rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    text-align: center;
    border: none !important;
    border-radius: 0 !important;
    outline: none !important;
    -webkit-clip-path: polygon(20% 0%, 100% 0%, 80% 50%, 100% 100%, 20% 100%, 0% 50%);
    clip-path: polygon(20% 0%, 100% 0%, 80% 50%, 100% 100%, 20% 100%, 0% 50%);
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: #ffffff;
    transition: all 0.25s ease;
}

[data-bs-theme="light"] .rank-badge {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    color: #ffffff;
}

/* Rank 1: Gold Hexagon Gradient */
.rank-badge-1 {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%) !important;
    color: #000000 !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Rank 2: Silver Hexagon Gradient */
.rank-badge-2 {
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 50%, #94a3b8 100%) !important;
    color: #0f172a !important;
}

/* Rank 3: Bronze Hexagon Gradient */
.rank-badge-3 {
    background: linear-gradient(135deg, #fb923c 0%, #ea580c 50%, #c2410c 100%) !important;
    color: #ffffff !important;
}

/* Rank 4: Purple Hexagon Gradient */
.rank-badge-4 {
    background: linear-gradient(135deg, #c084fc 0%, #a855f7 50%, #7e22ce 100%) !important;
    color: #ffffff !important;
}

/* Rank 5: Pink Hexagon Gradient */
.rank-badge-5 {
    background: linear-gradient(135deg, #f472b6 0%, #ec4899 50%, #be185d 100%) !important;
    color: #ffffff !important;
}

/* Floating Toast Notification */
#custom-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.custom-toast {
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    max-width: 350px;
    pointer-events: auto;
    animation: toast-slide-in 0.3s ease forwards, toast-fade-out 0.3s ease 2.7s forwards;
}

.custom-toast.toast-success {
    border-left: 4px solid #10b981;
}

.custom-toast.toast-error {
    border-left: 4px solid #ef4444;
}

.custom-toast.toast-info {
    border-left: 4px solid #3b82f6;
}

[data-bs-theme="light"] .custom-toast {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

@keyframes toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@keyframes toast-fade-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Flower Modal styling */
.flower-modal-content {
    background: rgba(15, 15, 25, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.flower-modal-content .text-muted-custom {
    color: rgba(255, 255, 255, 0.6);
}

.flower-modal-content .bg-custom-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.flower-modal-content .form-control-custom {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.flower-modal-content .form-control-custom:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #22c55e;
    color: #fff;
    box-shadow: none;
}

.flower-modal-content .btn-close-custom {
    filter: invert(1);
}

/* Light Theme overrides for Flower Modal */
[data-bs-theme="light"] .flower-modal-content {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #0f172a;
}

[data-bs-theme="light"] .flower-modal-content .text-muted-custom {
    color: #475569;
}

[data-bs-theme="light"] .flower-modal-content .bg-custom-card {
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-bs-theme="light"] .flower-modal-content .form-control-custom {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-bs-theme="light"] .flower-modal-content .form-control-custom:focus {
    background: #ffffff;
    border-color: #10b981;
    color: #0f172a;
}

[data-bs-theme="light"] .flower-modal-content .btn-close-custom {
    filter: none;
}

/* Glassmorphism Safari Support */
.glass-card {
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

/* Responsive Navigation Tabs for Mobile Safari */
.nav-tabs-responsive {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 2px solid var(--glass-border) !important;
    padding-bottom: 2px;
}

.nav-tabs-responsive::-webkit-scrollbar {
    display: none;
}

.nav-tabs-responsive .nav-item {
    flex: 0 0 auto;
}

.nav-tabs-responsive .nav-link {
    white-space: nowrap;
    border: none !important;
    background: transparent !important;
    color: var(--text-muted) !important;
    position: relative;
    padding: 0.75rem 1.25rem;
    transition: color 0.2s ease;
}

.nav-tabs-responsive .nav-link.active {
    color: var(--accent-primary, #8b5cf6) !important;
    font-weight: 700;
}

.nav-tabs-responsive .nav-link.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 15%;
    width: 70%;
    height: 3px;
    background: linear-gradient(90deg, #8b5cf6 0%, #6366f1 100%);
    border-radius: 3px;
}

/* Responsive Hero & Mobile Safari Optimizations */
@media (max-width: 575.98px) {
    .glass-card {
        padding: 1rem !important;
    }

    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .hero-mobile-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
        margin-bottom: 1.25rem;
    }

    .hero-mobile-cover {
        width: 130px !important;
        max-width: 130px !important;
        flex-shrink: 0;
        border-radius: 8px;
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.15);
    }

    .hero-mobile-info {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.4rem;
    }

    .hero-mobile-title {
        font-size: 1.25rem !important;
        margin-bottom: 0 !important;
        line-height: 1.3;
        font-weight: 800 !important;
    }

    .hero-mobile-author {
        font-size: 0.85rem !important;
        margin-bottom: 0 !important;
    }

    .hero-mobile-badges {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
        margin-top: 0.2rem;
    }

    .hero-mobile-badges .badge {
        font-size: 0.88rem !important;
        padding: 7px 14px !important;
    }

    .hero-stats-row {
        display: flex;
        justify-content: space-around;
        background: rgba(255, 255, 255, 0.05);
        padding: 10px;
        border-radius: 10px;
        margin-bottom: 1.25rem;
        font-size: 0.75rem !important;
        border: 1px solid rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .hero-stats-item {
        text-align: center;
        flex: 1;
    }

    .hero-stats-item:not(:last-child) {
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }

    .hero-action-buttons {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
        width: 100%;
    }

    .hero-action-buttons .btn {
        width: 100% !important;
        padding: 10px 8px !important;
        font-size: 0.78rem !important;
        margin: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        height: 40px;
        box-sizing: border-box;
    }

    .hero-action-buttons .btn-primary-action {
        grid-column: span 2;
        height: 44px;
        font-size: 0.85rem !important;
        font-weight: 700;
    }
}

/* Custom Premium Pagination Styling */
.pagination-custom .page-link {
    background: var(--card-bg, rgba(255, 255, 255, 0.05)) !important;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1)) !important;
    color: var(--text-main, #f7fafc) !important;
    padding: 0.5rem 1rem;
    border-radius: 8px !important;
    transition: all 0.25s ease;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    min-width: 40px;
}

.pagination-custom .page-link:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%) !important;
    border-color: transparent !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

.pagination-custom .page-item.disabled .page-link {
    background: rgba(128, 128, 128, 0.05) !important;
    border-color: var(--glass-border, rgba(255, 255, 255, 0.05)) !important;
    color: var(--text-muted, rgba(255, 255, 255, 0.3)) !important;
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.pagination-custom .active-info span {
    border-radius: 8px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%) !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    border: none;
}

/* Loading transitions for chapters list */
#chaptersListContainer {
    transition: opacity 0.2s ease-in-out;
}

.loading-chapters {
    opacity: 0.3;
    pointer-events: none;
}

/* Story Intro Collapse Styles */
.intro-wrapper {
    position: relative;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
}

.intro-wrapper:not(.collapsed) {
    max-height: 500px;
    overflow-y: auto;
}

.intro-wrapper.collapsed {
    max-height: 200px;
}

.intro-wrapper.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: linear-gradient(180deg, transparent 0%, var(--card-bg) 100%);
    opacity: 0.6;
    pointer-events: none;
}

#btnToggleIntro {
    background: transparent !important;
    border: none !important;
    color: var(--accent-primary, #8b5cf6) !important;
    font-weight: 600;
    box-shadow: none !important;
    padding: 6px 12px !important;
    transition: color 0.2s ease-in-out;
}

#btnToggleIntro:hover {
    color: var(--accent-secondary, #ec4899) !important;
    background: transparent !important;
    text-decoration: underline;
}

.intro-text {
    font-size: 1.02rem;
}

@media (max-width: 767.98px) {
    .intro-text {
        font-size: 1.12rem;
    }
}

/* Facebook Style Comment Box */
.comment-box-fb {
    width: 100%;
}

.input-container-fb {
    background-color: var(--input-bg, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    border-radius: 20px;
    padding: 8px 45px 8px 16px;
    min-height: 40px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.input-container-fb:focus-within {
    border-color: var(--accent-primary, #8b5cf6) !important;
    background-color: var(--input-bg-focus, rgba(255, 255, 255, 0.08)) !important;
}

.comment-textarea-fb {
    background: transparent !important;
    border: none !important;
    color: var(--text-main, #fff) !important;
    padding: 0 !important;
    margin: 0 !important;
    resize: none;
    box-shadow: none !important;
    font-size: 16px !important; /* Prevent iOS auto-zoom (must be >= 16px) */
    line-height: 1.4;
    overflow-y: hidden;
    height: 24px;
}

.comment-textarea-fb::placeholder {
    color: var(--text-muted, rgba(255, 255, 255, 0.5)) !important;
}

.btn-send-fb {
    position: absolute;
    right: 12px;
    bottom: 4px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent !important;
    border: none !important;
    color: var(--text-muted, rgba(255, 255, 255, 0.5)) !important;
    padding: 0 !important;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s, background-color 0.2s;
}

.comment-textarea-fb:focus ~ .btn-send-fb,
.comment-textarea-fb:valid ~ .btn-send-fb {
    color: var(--accent-primary, #8b5cf6) !important;
}

.btn-send-fb:hover {
    color: var(--accent-secondary, #ec4899) !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
    transform: scale(1.05);
}

/* Prevent iOS auto-zoom on inputs/selects/textareas on mobile devices */
@media (max-width: 767.98px) {
    input, 
    select, 
    textarea,
    .form-control,
    .form-select {
        font-size: 16px !important;
    }
}

/* Reply form cancel and submit button styles */
.replyForm .btn-cancel-reply {
    color: var(--text-muted, rgba(255, 255, 255, 0.5)) !important;
    transition: color 0.2s, transform 0.2s;
}

.replyForm .btn-cancel-reply:hover {
    color: #ef4444 !important;
    transform: scale(1.1);
}

.replyForm button[type="submit"] {
    color: var(--accent-primary, #8b5cf6) !important;
    transition: color 0.2s, transform 0.2s;
}

.replyForm button[type="submit"]:hover {
    color: var(--accent-secondary, #ec4899) !important;
    transform: scale(1.1);
}

/* Hover Gold Glow Effect for Chapters List */
.chapter-glow-gold {
    transition: all 0.3s ease !important;
}

.chapter-glow-gold:hover {
    border-color: #ffd700 !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5) !important;
    transform: translateY(-2px);
    background-color: rgba(255, 215, 0, 0.08) !important;
}

/* Custom Floating Toast Notifications (Top-Right Default Position) */
#custom-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: calc(100% - 48px);
    pointer-events: none;
}

/* Custom Interactive Confirm Toast (Centered Screen Position) */
#custom-confirm-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1095;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 380px;
    width: calc(100% - 48px);
    pointer-events: none;
}

.custom-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--dropdown-bg, #1a1a2e);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12));
    color: var(--text-main, #ffffff);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: toast-fade-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.custom-toast.toast-confirm {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

/* Centered Confirm Modal Backdrop */
.custom-confirm-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1085;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.custom-confirm-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.custom-confirm-modal {
    width: 100%;
    max-width: 400px;
    background: var(--dropdown-bg, #1a1a2e);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.15));
    border-radius: 16px;
    padding: 20px;
    color: var(--text-main, #ffffff);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: confirm-scale-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes confirm-scale-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes confirm-scale-out {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
}

@keyframes toast-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toast-fade-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
}