/* ==========================================================================
   TikNovel Theme - Story Detail Drawer / Bottom Sheet Modal (story.png)
   ========================================================================== */

.story-drawer-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}
.story-drawer-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.story-drawer-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    background-color: #14171f;
    border-radius: 24px 24px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.85);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.story-drawer-backdrop.is-open .story-drawer-panel {
    transform: translateX(-50%) translateY(0);
}

/* Drag Handle */
.story-drawer-handle {
    width: 44px;
    height: 5px;
    border-radius: 9999px;
    background-color: #3f3f46;
    margin: 12px auto 8px auto;
    flex-shrink: 0;
    cursor: grab;
}

/* Drawer Body Scroll Container */
.story-drawer-content {
    padding: 12px 24px 32px 24px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.story-drawer-content::-webkit-scrollbar {
    width: 4px;
}
.story-drawer-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* Top Header */
.story-drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.story-drawer-title {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.3;
    margin: 0;
}
.story-drawer-bookmark-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #262626;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}
.story-drawer-bookmark-btn:hover {
    background-color: #333333;
}
.story-drawer-bookmark-btn.is-saved {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.4);
}

/* Author Section */
.story-drawer-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    text-decoration: none;
}
.story-drawer-author-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #18181b;
    border: 1.5px solid #fe2c55;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fe2c55;
}
.story-drawer-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.story-drawer-author-meta {
    display: flex;
    flex-direction: column;
}
.story-drawer-author-name {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
}
.story-drawer-author-handle {
    font-size: 12px;
    color: #71717a;
}

/* Category Tag Pills */
.story-drawer-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.story-drawer-tag-pill {
    padding: 4px 12px;
    border-radius: 9999px;
    background-color: #262626;
    color: #e4e4e7;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s;
}
.story-drawer-tag-pill:hover {
    background-color: #333333;
    color: #ffffff;
}

/* Synopsis / Description */
.story-drawer-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #cbd5e1;
    margin-bottom: 16px;
}

/* Stats Row */
.story-drawer-stats {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 13px;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 22px;
}
.story-drawer-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.story-drawer-stat-item i {
    color: #71717a;
    font-size: 14px;
}

/* Action Buttons Row */
.story-drawer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.story-drawer-btn-read {
    height: 46px;
    border-radius: 12px;
    background-color: #fe2c55;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(254, 44, 85, 0.45);
    transition: all 0.2s;
}
.story-drawer-btn-read:hover {
    background-color: #e02447;
    color: #ffffff;
    transform: translateY(-1px);
}

.story-drawer-btn-audio {
    height: 46px;
    border-radius: 12px;
    background-color: #262626;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.2s;
}
.story-drawer-btn-audio:hover {
    background-color: #333333;
    color: #ffffff;
}

/* Chapter List Grid */
.story-drawer-chap-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 18px;
}
.story-drawer-chap-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 14px;
}

.story-drawer-chap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 10px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.story-drawer-chap-btn {
    aspect-ratio: 1;
    border-radius: 12px;
    background-color: #262626;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-decoration: none;
    transition: all 0.18s ease;
}
.story-drawer-chap-btn:hover {
    background-color: #333333;
    color: #ffffff;
    transform: scale(1.05);
}
.story-drawer-chap-btn.active,
.story-drawer-chap-btn.is-read {
    background-color: #fe2c55;
    color: #ffffff;
    border-color: #fe2c55;
    box-shadow: 0 0 10px rgba(254, 44, 85, 0.4);
}
.story-drawer-chap-btn.is-vip {
    background-color: #1a1a1e;
    border-color: rgba(251, 191, 36, 0.35);
    color: #fbbf24;
}
.story-drawer-chap-btn .chap-headphone-icon {
    position: absolute;
    top: 4px;
    right: 5px;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.85);
}
.story-drawer-chap-btn .chap-lock-icon {
    position: absolute;
    top: 4px;
    right: 5px;
    font-size: 9px;
    color: #fbbf24;
}
