:root {
    --primary: #D48C11;
    --primary-hover: #b87a0f;
    --bg-main: #fbf9f6;
    --text-main: #302419;
    --text-muted: #7a736d;
    --white: #ffffff;
    --surface-1: #ffffff;
    --surface-2: #fdf6ee;
    --ink-1: #2b2723;
    --ink-2: #5b544d;
    --ring: rgba(212, 140, 17, 0.35);
    --border-soft: rgba(0, 0, 0, 0.05);
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-premium: 0 10px 40px rgba(48, 36, 25, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 100px;
    --container-max: 1300px;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-ui: 'Outfit', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-ui);
    line-height: 1.5;
}

html.no-scroll,
body.no-scroll {
    overflow: hidden !important;
}


/* Premium Reveal Animations */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    visibility: hidden;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Staggered Delay Utilities */
.delay-100 {
    transition-delay: 100ms;
}

.delay-200 {
    transition-delay: 200ms;
}

.delay-300 {
    transition-delay: 300ms;
}

.delay-400 {
    transition-delay: 400ms;
}

.delay-500 {
    transition-delay: 500ms;
}

.delay-600 {
    transition-delay: 600ms;
}

.delay-700 {
    transition-delay: 700ms;
}

.delay-800 {
    transition-delay: 800ms;
}

/* Scroll Progress Bar */
.scroll-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 10001;
    pointer-events: none;
    overflow: hidden;
}

.scroll-progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    box-shadow: 0 0 10px rgba(212, 140, 17, 0.3);
}

/* Navbar Scrolled State */
.global-header {
    transition: all 0.3s ease;
}

.global-header.scrolled {
    background-color: rgba(251, 249, 246, 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(48, 36, 25, 0.1);
    padding: 8px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/*header*/
/* Global Header */
.global-header {
    width: 100%;
    position: sticky;
    top: 0;
    background-color: var(--bg-main);
    border-bottom: 1px solid var(--border-soft);
    z-index: 1000;
    padding: 12px 0;
}

.header-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 1024px) {
    .header-container {
        padding: 0 20px;
    }
}

.logo-inkwell {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #302419;
    font-family: Georgia, serif;
    font-size: 24px;
    font-weight: 700;
}

.logo-inkwell i {
    color: #D48C11;
    font-size: 22px;
}

.header-center {
    display: none;
}

@media (min-width: 1024px) {
    .header-center {
        display: block;
        flex: 1;
    }
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--text-main);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 25px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.user-actions .signin {
    text-decoration: none;
    color: #302419;
    font-size: 14px;
    font-weight: 700;
    font-family: system-ui, sans-serif;
}

.user-actions .signin:hover {
    color: #fff;
    background-color: #D48C11;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-start-writing {
    background-color: #D48C11;
    color: #fff !important;
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-family: system-ui, sans-serif;
}

.btn-start-writing:hover {
    background-color: #b87a0f;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 140, 17, 0.3);
}

.username-link {
    text-decoration: none;
    color: #D48C11;
    font-weight: 700;
    font-size: 14px;
}

.username-link {
    color: #302419;
}

.header-right .signin {
    color: #302419;
    padding: 10px 15px;
    border-radius: 6px;
    transition: all 0.2s ease;
}


.header-right .startwriting {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #D48C11;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.header-right .startwriting:hover {
    background-color: #bf7e0f;
}

/* ==========================================================================
   DISCOVER SECTION
   ========================================================================== */

.discover-page {
    background-color: var(--bg-main);
    min-height: 100vh;
    padding-bottom: 80px;
}

.discover-hero {
    padding: 60px 20px;
    text-align: center;
    background: radial-gradient(circle at center, rgba(212, 140, 17, 0.03) 0%, transparent 70%);
}

@media (min-width: 1024px) {
    .discover-hero {
        padding: 100px 20px;
    }
}

.discover-container {
    max-width: 800px;
    margin: 0 auto;
}

.discover-header-icon {
    width: 80px;
    height: 80px;
    background: #D48C11;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 32px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.discover-hero h1 {
    font-family: Georgia, serif;
    font-size: clamp(36px, 10vw, 72px);
    color: var(--text-main);
    margin: 0 auto 24px;
    letter-spacing: -1px;
    font-weight: 800;
    line-height: 1.1;
}

.discover-hero .subtitle {
    font-size: clamp(16px, 4vw, 22px);
    color: var(--text-muted);
    margin-bottom: 40px;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-container {
    max-width: 650px;
    margin: 0 auto;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--white);
    padding: 16px 24px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-premium);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

@media (min-width: 768px) {
    .search-bar {
        padding: 22px 30px;
    }
}

.search-bar:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(212, 140, 17, 0.12);
    border-color: rgba(212, 140, 17, 0.2);
}

.search-bar i {
    font-size: 18px;
    color: var(--primary);
    margin-right: 15px;
}

.search-bar input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 18px;
    font-family: system-ui, sans-serif;
    color: #302419;
    background: transparent;
}

.search-bar input::placeholder {
    color: #b0aba6;
}

/* Trending Now */
.trending-section {
    padding: 40px 20px 80px;
}

@media (min-width: 1024px) {
    .trending-section {
        padding: 20px 60px 80px;
    }
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
}

.section-title i {
    color: #D48C11;
    font-size: 24px;
}

.section-title h2 {
    font-family: Georgia, serif;
    font-size: 32px;
    color: #302419;
    font-weight: 700;
}

.trending-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    justify-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .trending-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
        justify-items: stretch;
    }
}

@media (min-width: 1200px) {
    .trending-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }
}

.trending-card {
    display: flex;
    gap: 24px;
    background: #fff;
    padding: 28px;
    border-radius: 20px;
    border: 1px solid rgba(48, 36, 25, 0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    width: 100%;
    max-width: 400px;
    /* Prevent cards from being too wide on mobile */
}

@media (min-width: 768px) {
    .trending-card {
        max-width: none;
    }
}

.trending-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(48, 36, 25, 0.08);
    border-color: rgba(212, 140, 17, 0.1);
}

.trending-rank {
    font-family: Georgia, serif;
    font-size: 36px;
    font-weight: 800;
    color: rgba(212, 140, 17, 0.15);
    line-height: 1;
}

.trending-info {
    flex: 1;
}

.trending-info h3 {
    font-family: Georgia, serif;
    font-size: 20px;
    color: #302419;
    margin-bottom: 6px;
    font-weight: 700;
}

.trending-info .author {
    font-family: system-ui, sans-serif;
    font-size: 14px;
    color: #7a736d;
    margin-bottom: 16px;
    font-weight: 500;
}

.trending-info .stats {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #9c948d;
    font-weight: 600;
}

.trending-info .stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.trending-info .stats i {
    color: #D48C11;
}

/* ==========================================================================
   END DISCOVER SECTION
   ========================================================================== */

/* footer */

footer {
    position: relative;
    bottom: 0;
    width: 100%;

    background-color: #fbf9f6de;
}

footer .upper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 40px 0;
    margin: 0 20px;
    border-bottom: 1px solid var(--border-soft);
}

@media (min-width: 768px) {
    footer .upper {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        margin: 0 48px;
    }
}

footer .upper div .heads {
    margin: 30px 0;
    font-family: Georgia, serif;
}

footer .upper div li {
    list-style-type: none;
    margin-bottom: 12px;
}

footer .upper div li a {
    text-decoration: none;
    color: #7a736d;
    font-size: 14px;
    font-family: system-ui, sans-serif;
}

footer .upper div li a:hover {
    color: #302419;
}

footer .upper div {
    flex: 1;
    margin-right: 12px;

}

footer .upper div .saying {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

footer .upper div .socials {
    display: flex;
    gap: 18px;
    margin: 20px 0;
    align-items: center;
}

.social-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 44px;
    border-radius: 10px;
    background: rgba(48, 36, 25, 0.06);
    color: #7a736d;
    font-size: 20px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(48, 36, 25, 0.08);
}

.social-icon-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.social-icon-btn:has(.fa-instagram):hover {
    background: radial-gradient(circle at 30% 110%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    color: #fff;
    border-color: transparent;
}

.social-icon-btn:has(.fa-tiktok):hover {
    background: #000;
    color: #fff;
    border-color: transparent;
}

.social-icon-btn:has(.fa-telegram):hover {
    background: #2AABEE;
    color: #fff;
    border-color: transparent;
}

@media (max-width: 768px) {
    .social-icon-btn {
        width: 44px;
        height: 40px;
        font-size: 18px;
        border-radius: 8px;
    }

    footer .upper div .socials {
        gap: 20px;
    }
}

footer .upper div .logo-bm {
    text-decoration: none;
    font-family: Georgia, serif;
    font-size: 22px;
    color: #302419;
    font-weight: 600;
    display: block;
    margin: 30px 0;

}

footer .lower {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

footer .lower p {
    color: #7a736d;
    font-size: 14px;
    font-family: system-ui, sans-serif;
}

/* index content */

.first {
    min-height: 85vh;
    position: relative;
    z-index: 1;
    background-image: url("../images/bg1.png");
    background-size: cover;
    background-repeat: no-repeat;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.first .top {
    margin: 60px 0 30px 0;
    width: 100%;
    max-width: 900px;
    padding: 0 20px;
    text-align: center;
}

.first .top h1 {
    font-size: clamp(40px, 12vw, 70px);
    font-family: Georgia, serif;
    color: var(--text-main);
    line-height: 1;
    letter-spacing: -2px;
}

.first .top h1 span {
    color: #D48C11;
}

.first .mid {
    width: 100%;
    max-width: 700px;
    padding: 0 20px;
    text-align: center;
    margin-bottom: 40px;
}

.first .mid p {

    color: #7a736d;
    font-family: Georgia, serif;
    font-size: 20px;
    font-weight: 500;
}

.first .btns {
    margin-bottom: 20px;
}

.first .btns a {
    padding: 12px 20px;
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-family: system-ui, sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .first .btns a {
        padding: 15px 25px;
    }
}

.first .btns a:hover {
    background-color: #DFA01F;
    color: #fff;
}

.first .btns .swf {

    color: #fff;
    font-size: 16px;
    font-family: system-ui, sans-serif;
    margin-right: 10px;
    font-weight: 500;
    border-color: #D48C11;
    background-color: #D48C11;
}

.first .btns .es {
    color: #302419;
    font-size: 16px;
    font-family: system-ui, sans-serif;
    margin-right: 10px;
    font-weight: 500;
    background-color: #fbf9f6de;
}

.first .statstics {
    display: flex;
    width: 100%;
    max-width: 450px;
    align-items: center;
    justify-content: space-between;
    margin-top: 40px;
    padding: 0 20px;
}

.first .statstics div {
    text-align: center;
}

.first .statstics div .nums {
    font-family: Georgia, serif;
    font-weight: 600;
    font-size: 30px;
    color: #302419;
}

.first .statstics div .labels {
    color: #7a736d;
    font-size: 14px;
    font-family: system-ui, sans-serif;
    font-weight: 600;
    margin-top: 12px;
}

.second {
    width: 100%;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #e4dfd563;
}

.second h1 {
    font-family: Georgia, serif;
    font-size: 36px;
    font-weight: 600;
    color: #302419;
    margin: 20px 0;
    text-align: center;
    padding: 0 15px;
}

.second .sy {
    color: #7a736d;
    font-size: 18px;
    font-family: Georgia, serif;
    text-align: center;
    padding: 0 15px;
}

.second .listed {
    width: 95%;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
    margin: 40px 60px;
}

.second .listed div {
    flex: 1 1 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 10px 10px 0 0;
    background-color: #fff;
    height: 160px;
    border-radius: 12px;
    border: 1px solid rgba(128, 128, 128, 0.201);

}

.second .listed div:hover {
    transition: 0.3s ease-in-out;
    cursor: pointer;
    transform: translateY(-8px);
    box-shadow: 0 3px 10px rgba(128, 128, 128, 0.062);
}

.second .listed div .titles {
    font-family: system-ui, sans-serif;
    font-weight: 500;
    color: #000;

}

.second .listed div .numbers {
    font-family: system-ui, sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #7a736d;
}

.third {

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    background-color: #fbf9f6de;
    padding: 22px 43px;
}

.third h1 {
    font-family: Georgia, serif;
    font-size: 36px;
    font-weight: 600;
    color: #302419;
    margin: 15px 0;
}

.third .pa {
    display: flex;
    width: 100%;
    justify-content: space-between;
}

.third .pa {
    color: #7a736d;
    font-size: 18px;
    font-family: Georgia, serif;
}

.third .pa a {
    text-decoration: none;
    color: #302419;
    font-family: system-ui, sans-serif;
    font-weight: 500;
    font-size: 14px;
    padding: 10px 10px;
    border-radius: 4px;

}

.third .pa a:hover {
    transition: 0.3s ease;
    background-color: #DFA01F;
    color: #fff;

}

.third .book-listed {
    width: 100%;
    margin: 40px 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    justify-items: center;
    /* Center cards on mobile */
}

@media (min-width: 768px) {
    .third .book-listed {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
        justify-items: stretch;
    }
}

@media (min-width: 1100px) {
    .third .book-listed {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
}

.third .book-listed .book {
    position: relative;
    width: 100%;
    max-width: 380px;
    /* Prevent cards from being too wide on mobile */
    background-color: #f5f5f5b0;
    border: 1px solid #e4dfd563;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
}

@media (min-width: 768px) {
    .third .book-listed .book {
        max-width: none;
    }
}

.third .book-listed .book:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(48, 36, 25, 0.12);
    border-color: rgba(212, 140, 17, 0.2);
}

.third .book-listed .book:hover .img-bg img {
    transform: scale(1.05);
}

.third .book-listed .book .img-bg {
    height: 200px;
    background: linear-gradient(#c1b9a8, #ac986b);

}

.third .book-listed .book .img-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.third .book-listed .book .ty-mar {
    position: absolute;
    top: 10px;
    left: 10px;
}

.third .book-listed .book .ty-mar p {
    background-color: #FFF;
    padding: 5px 10px;
    color: #302419;
    font-family: system-ui, serif;
    font-weight: 600;
    font-size: 12px;
    border-radius: 12px;

}

.third .book-listed .book .infos {
    padding: 12px 10px;
    position: relative;
}

.third .book-listed .book .infos .b-name {
    margin-bottom: 12px;
    font-family: Georgia, serif;
    font-size: 18px;
    font-weight: 600;
    color: #302419;
    margin: 15px 0;
}

.third .book-listed .book .infos p {
    font-family: systme-ui, serif;
    font-size: 16px;
    font-weight: 400;
    color: #7a736d;
    margin-bottom: 15px;
}

.third .book-listed .book .infos .infooo {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;

}

.third .book-listed .book .infos .infooo .nu {
    display: flex;

}

.third .book-listed .book .infos .infooo .nu .views {
    margin-right: 6px;

}

.fourth {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    background-image: url("../images/bg2.png");
    background-size: cover;
    background-repeat: repeat;
}

.fourth h1 {
    width: 100%;
    max-width: 900px;
    padding: 0 20px;
    text-align: center;
    font-family: Georgia, serif;
    font-size: clamp(32px, 8vw, 70px);
    font-weight: 600;
    color: #302419;
    margin: 15px 0;
}

.fourth .saying {
    width: 100%;
    max-width: 700px;
    padding: 0 20px;
    text-align: center;
    color: #7a736d;
    font-family: Georgia, serif;
    font-size: clamp(16px, 4vw, 20px);
    font-weight: 500;
}

.fourth .comps {
    display: flex;
    flex-wrap: wrap;
    margin: 20px 0;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.fourth .comps a {
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    color: #fff;
    font-size: 16px;
    font-family: system-ui, sans-serif;
    font-weight: 500;
    border-color: #D48C11;
    background-color: #D48C11;
}

.fourth .comps pre {
    color: #7a736d;
    font-size: smaller;
    font-family: system-ui, serif;
    font-weight: 500;
    white-space: pre-wrap;
    text-align: center;
}

/*stories*/

.st {
    padding: 32px 45px;
    background-color: #fbf9f6de;
}

.stories {
    padding-top: 60px;
    padding-bottom: 40px;
    background: transparent;
}

.stories-header-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Reduced gap */
    margin-bottom: 15px;
    /* Significantly reduced margin for closer vertical spacing */
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding: 0 40px;
}

@media (max-width: 768px) {
    .stories-header-content {
        padding: 0 20px;
        text-align: center;
        align-items: center;
    }
}

.stories-title-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stories-title-row h1 {
    font-family: 'Playfair Display', "Crimson Text", "Georgia", serif;
    font-size: 48px;
    font-weight: 900;
    color: var(--text-main);
    margin: 0;
    letter-spacing: -0.02em;
}

.stories-title-row i {
    font-size: 24px;
    color: var(--primary);
    background: var(--white);
    padding: 8px;
    border: 2px solid var(--primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    box-shadow: 0 4px 10px rgba(212, 140, 17, 0.1);
}

.stories h1 {
    font-size: 72px;
    font-family: Georgia, serif;
    color: #302419;
    font-weight: 800;
    letter-spacing: -1px;
}

.stories-desc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stories-desc-row p {
    color: #7a736d;
    font-size: 18px;
    font-family: system-ui, sans-serif;
    max-width: 700px;
    line-height: 1.5;
}

.mobile-filter-wrapper {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
}

.filter-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 320px;
    padding: 12px 20px;
    background: var(--white);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-full);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.filter-dropdown-toggle:hover {
    border-color: var(--primary);
}

.filter-dropdown-toggle i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.mobile-filter-wrapper.active .filter-dropdown-toggle i {
    transform: rotate(180deg);
}

/* Global Filter Resets */
.filters {
    list-style: none !important;
    padding: 0;
    margin: 0;
}

.filters li {
    list-style: none !important;
}

.filters li a {
    text-decoration: none !important;
    color: var(--text-main);
}

/* Mobile-only Filter Styles */
@media (max-width: 767px) {
    .stories .filters {
        display: none;
        flex-direction: column;
        width: 100%;
        max-width: 320px;
        background: var(--white);
        border-radius: var(--radius-lg);
        border: 1px solid var(--border-soft);
        margin-top: 10px;
        box-shadow: var(--shadow-premium);
        z-index: 10;
        padding: 10px;
        gap: 5px;
    }

    .mobile-filter-wrapper.active .filters {
        display: flex;
    }

    .stories .filters li {
        width: 100%;
        margin: 0 !important;
        padding: 0 !important;
    }

    .stories .filters li a {
        width: 100%;
        border-radius: var(--radius-md);
        border: none;
        padding: 12px 15px;
        text-align: left;
        background: transparent;
        font-weight: 600;
        display: block;
        transition: all 0.2s ease;
    }
}

.stories .filters li a:hover {
    background: rgba(212, 140, 17, 0.05);
    color: var(--primary) !important;
}

.stories .filters li a.active {
    background: var(--primary) !important;
    color: var(--white) !important;
    box-shadow: none;
}

@media (min-width: 768px) {
    .filter-dropdown-toggle {
        display: none;
    }

    .mobile-filter-wrapper {
        padding: 0;
        width: 100%;
        display: block;
    }

    .stories .filters {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        max-width: none;
        background: transparent;
        border: none;
        box-shadow: none;
        margin-top: 0;
        padding: 10px 40px;
        /* Reduced vertical padding */
        gap: 8px;
        /* Closer spacing between pills */
        position: static;
        width: 100%;
    }

    .stories .filters li {
        width: auto;
    }

    .stories .filters li a {
        width: auto;
        border: 1px solid var(--border-soft);
        background: var(--white);
        color: var(--text-muted);
        border-radius: var(--radius-full);
        padding: 8px 20px;
        font-size: 14px;
        font-weight: 600;
        transition: all 0.3s ease;
    }

    .stories .filters li a:hover {
        border-color: var(--primary-soft);
        color: var(--primary);
        background: var(--surface);
    }

    .stories .filters li a.active {
        background: var(--primary);
        /* Solid primary as seen in user error image */
        color: var(--white) !important;
        /* Ensure text is visible (WHITE) */
        border-color: var(--primary);
        box-shadow: 0 4px 12px rgba(212, 140, 17, 0.2);
    }
}

.stories-box {
    min-height: 70vh;
    padding: 40px 0;
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .stories-box {
        padding: 20px 0;
    }
}

.stories-box .boxed {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 20px;
    justify-items: start;
    justify-content: start;
}

@media (min-width: 768px) {
    .stories-box .boxed {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: stretch;
        max-width: var(--container-max);
        /* Align with header */
        margin: 0;
        /* Left align on page */
        gap: 25px;
        padding: 20px 40px;
    }

    .stories-box .boxed .premium-story-card {
        flex: 0 0 calc((100% - 80px) / 3);
        /* Adjust for 2 gaps + potential wrapper padding */
        max-width: calc((100% - 80px) / 3);
        min-width: 300px;
    }
}


.stories-box .boxed .books {
    flex: 1 1 330px;

    background-color: #f5f5f5b0;
    border: 1px solid #e4dfd563;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
}

.stories-box .boxed .books:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(48, 36, 25, 0.12);
    border-color: rgba(212, 140, 17, 0.2);
}

.stories-box .boxed .books:hover .img-box img {
    transform: scale(1.05);
}

.img-box {
    height: 180px;
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-box::before {
    content: "📖";
    font-size: 40px;
    opacity: 0.3;
}

.img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.others {
    padding: 13px 20px;
}

.others .tvh {
    display: flex;
    width: 40%;
}

.others .tvh p {
    flex: 1;
    font-family: system-ui, sans-serif;
    font-size: 14px;
    color: #7a736d;
}

.others p {
    margin-bottom: 12px;
}

.others .type {
    width: fit-content;
    font-family: system-ui, sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #302419;
    background-color: #e4dfd563;
    border-radius: 5px;
    padding: 4px 8px;
}

.others .b-name {
    font-family: Georgia, serif;
    font-size: 20px;
    font-weight: 600;
}

.others .samee {
    font-family: system-ui, sans-serif;
    font-size: 14px;
    color: #7a736d;
}

.stories-box .below {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 40px 0;
}

.stories-box .below a {
    text-decoration: none;
    color: #302419;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 35px;
    border: 1px solid rgba(48, 36, 25, 0.1);
    border-radius: 50px;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.stories-box .below a:hover {
    background-color: #302419;
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(48, 36, 25, 0.15);
}

.stories-box .below a:hover {
    background-color: #DFA01F;
    color: #fff;
}

.st .head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 40px;
    margin-bottom: 25px;
}

.st .head a {
    text-decoration: none;
    color: #302419;
    font-family: system-ui, sans-serif;
    font-weight: 500;
    font-size: 14px;
    padding: 10px 10px;
    border-radius: 4px;
}

.st .head a:hover {
    transition: 0.3s ease;
    background-color: #DFA01F;
    color: #fff;

}

.st .head p {
    font-family: Georgia, serif;
    font-size: 36px;
    font-weight: 600;
    color: #302419;
    margin: 15px 0;
}

.st .scripts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    margin-top: 45px;
}

.st .scripts-list .script-item {
    position: relative;
    flex: 1 1 500px;
    background-color: #f5f5f5b0;

    border: 1px solid #e4dfd563;
    border-radius: 12px;
    box-shadow: 2px gray;
    list-style-type: none;
    display: flex;
    border-radius: 12px;
}

.st .scripts-list .script-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(48, 36, 25, 0.12);
    border-color: rgba(212, 140, 17, 0.2);
}

.st .scripts-list .script-item:hover .inform h3 {
    color: #D48C11;
}

.st .scripts-list .script-item:hover .script-img img {
    transform: scale(1.05);
}

.st .scripts-list .script-item .script-img {
    height: auto;
    width: 150px;
    background: linear-gradient(#c1b9a8, #ac986b);
    margin-right: 15px;
    border-radius: 12px 0 0 12px;
    overflow: hidden;
}

.st .scripts-list .script-item .script-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.st .scripts-list .script-item:nth-child(1) .script-img {
    background: linear-gradient(135deg, #10b981, #0d9488);
}

.st .scripts-list .script-item:nth-child(2) .script-img {
    background: linear-gradient(135deg, #d946ef, #9333ea);
}

.st .scripts-list .script-item:nth-child(3) .script-img {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
}

.st .scripts-list .script-item:nth-child(4) .script-img {
    background: linear-gradient(135deg, #3b82f6, #4f46e5);
}

.st .scripts-list .script-item .inform {
    padding: 12px 10px;
    position: relative;
    flex: 1;
    height: auto;
}

.st .scripts-list .script-item .inform .gener {
    display: flex;
    gap: 8px;
    top: 10px;
    left: 10px;
    margin-bottom: 5px;
}

.st .scripts-list .script-item .inform .gener li p {
    background-color: #FFF;
    padding: 5px 10px;
    color: #302419;
    font-family: system-ui, serif;
    font-weight: 600;
    font-size: 12px;
    border-radius: 12px;
}

.st .scripts-list .script-item .inform .gener li:nth-child(1) p {
    background-color: #c1b9a8;
    color: #302419;
}

.st .scripts-list .script-item .inform h3 {
    font-family: Georgia, serif;
    font-size: 20px;
    font-weight: 600;
    color: #302419;
    margin-bottom: 10px;
}

.st .scripts-list .script-item .inform p {
    font-family: system-ui, serif;
    font-size: 14px;
    font-weight: 400;
    color: #7a736d;
    margin-bottom: 10px;
}

.book .forbook {
    width: 55%;
    margin: 20px 0;
}

.book .forbook li a {
    border-radius: 12px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;

}

.img-bg .book-list {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    margin-top: 45px;
    margin-bottom: 20px;
}

.book-item {
    display: flex;
    flex-direction: column;
    width: unset;
    flex: 1 1 300px;
    position: relative;
    background-color: #f5f5f5b0;
    border: 1px solid #e4dfd563;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
}

.book-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(48, 36, 25, 0.12);
    border-color: rgba(212, 140, 17, 0.2);
}

.book-item:hover .book-img img {
    transform: scale(1.05);
}

.book-img {
    height: 200px;
    background: linear-gradient(#c1b9a8, #ac986b);
    overflow: hidden;
    position: relative;
}

.book-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.book-item .book-img {
    width: 100%;
    height: 200px;
    background: linear-gradient(#c1b9a8, #ac986b);
}

.book-list .book-item:nth-child(1) .book-img {
    background: linear-gradient(135deg, #8B5CF6, #4F46E5);
}

.book-list .book-item:nth-child(2) .book-img {
    background: linear-gradient(135deg, #FBBF24, #F97316);
}

.book-list .book-item:nth-child(3) .book-img {
    background: linear-gradient(135deg, #64748B, #3F3F46);
}

.book-item .inform {
    padding: 12px 10px;
    background-color: transparent;
    position: relative;
    flex: 1;
    list-style-type: none;
}

.book-item .inform .gener {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
}

.book-item .inform .gener li p {
    background-color: #e4dfd563;
    padding: 5px 10px;
    color: #302419;
    font-family: system-ui, serif;
    font-weight: 600;
    font-size: 12px;
    border-radius: 12px;
}

.book-item .inform h3 {
    font-family: Georgia, serif;
    font-size: 20px;
    font-weight: 600;
    color: #302419;
    margin-bottom: 10px;
}

.book-item .inform p {
    font-family: system-ui, serif;
    font-size: 14px;
    font-weight: 400;
    color: #7a736d;
    margin-bottom: 10px;
}

.book-item .inform .more-info {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
}

.book-item .inform .more-info div {
    display: flex;
    gap: 12px;
}

.book-item .book-img .rank {
    display: flex;
    position: absolute;
    top: 10px;
    right: 10px;
    color: #fff;
    padding: 6px 10px;
    border-radius: 12px;
    background-color: rgb(0, 0, 0, 0.4);
}

.released {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    padding: 32px 45px;
    background-color: #e4dfd569;

}

.newreleases .newhead {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 767px) {
    .newreleases .newhead {
        width: 100%;
        margin-bottom: 40px;
    }
}

.newreleases .newhead a {
    text-decoration: none;
    color: #302419;
    font-family: system-ui, sans-serif;
    font-weight: 500;
    font-size: 14px;
    padding: 10px 10px;
    border-radius: 4px;
}

.newreleases .newhead a:hover {
    transition: 0.3s ease;
    background-color: #DFA01F;
    color: #fff;

}

.newreleases .newlist {
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping on narrow screens */
    gap: 25px;
    margin-top: 45px;
}

@media (min-width: 900px) {
    .newreleases .newlist {
        flex-direction: row;
        flex-wrap: wrap;
        /* Force single row width behavior */
        justify-content: flex-start;
        /* Don't stretch items */
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
        gap: 25px;
    }

    .newreleases .newlist .newitem {
        flex: 0 0 calc((100% - 50px) / 3);
        /* 3 items per row, fixed width */
    }
}

.newreleases .newlist .newitem {
    position: relative;
    flex: 1 1 80px;
    background-color: #ffffffaa;
    padding: 13px 15px;
    border: 1px solid #e4dfd563;
    border-radius: 12px;
    box-shadow: 2px gray;
    list-style-type: none;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
}

.newreleases .newlist .newitem:hover {
    cursor: pointer;
    border-color: #f59e0b;
    transition: 0.3s ease-in-out;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.newreleases .newlist .newitem .newimg {
    height: 300px;
    width: 100%;
    background: linear-gradient(hsl(35 15% 93%), hsl(35 15% 93% / 0.5));
    margin-right: 15px;
    border-radius: 12px 12px;
}

.newreleases .newlist .newitem .newinfo {
    padding: 12px 10px;
    position: relative;
    flex: 1;
    height: auto;

}

.newreleases .newlist .newitem .newinfo .newgener {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
}

.newreleases .newlist .newitem .newinfo .newgener p {
    background-color: #fff;
    padding: 5px 10px;
    color: #302419;
    font-family: system-ui, serif;
    font-weight: 600;
    font-size: 12px;
    border-radius: 12px;
    border: 1px solid #e4dfd563;
}

.newreleases .newlist .newitem .newinfo div .newtitle {
    font-family: Georgia, serif;
    font-size: 14px;
    font-weight: 400;
    color: #302419;
    margin-bottom: 4px;
}

.newreleases .newlist .newitem .newinfo div .newauthor {
    font-family: system-ui, serif;
    font-size: 12px;
    font-weight: 400;
    color: #7a736d;
}

/* wite page */

.headeded {
    padding: 12px 24px;
    background-color: #fbf9f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(48, 36, 25, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.headeded ul {
    display: flex;
    align-items: center;
    justify-content: center;
}

.headeded ul li {
    list-style-type: none;
    margin-right: 20px;
}

.headeded ul li a {
    text-decoration: none;
    color: #7a736d;
    font-family: system-ui, sans-serif;
    font-weight: 500;
    font-size: 14px;
    padding: 10px 10px;
    border-radius: 4px;
}

.headeded ul li .back {
    color: #7a736d;
}

.headeded .middle {
    background-color: transparent;
    padding: 0;
    display: flex;
    gap: 12px;
    border-radius: 0;
}

.headeded .middle li {
    margin: 0;
}

.headeded ul li .tab-btn {
    text-decoration: none;
    color: #302419;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 20px;
    border: 1px solid rgba(48, 36, 25, 0.08);
    border-radius: 100px;
    font-family: system-ui, sans-serif;
    transition: all 0.3s ease;
    background: #fff;
    display: inline-block;
}

.headeded ul li .tab-btn.active {
    background-color: #D48C11;
    color: #FFF;
    border-color: #D48C11;
    box-shadow: 0 4px 12px rgba(212, 140, 17, 0.2);
}

.headeded ul li .tab-btn:hover:not(.active) {
    background-color: rgba(212, 140, 17, 0.05);
    color: #D48C11;
    border-color: rgba(212, 140, 17, 0.2);
    transform: translateY(-1px);
}

.headeded ul li .save {
    padding: 10px 14px;
    border-radius: 10px;
}

.headeded ul li .save:hover {
    background-color: #DFA01F;
    color: #fff;
}

.headeded ul li .publish {
    background-color: #D48C11;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
}

.headeded ul li .publish:hover {
    background-color: #DFA01F;
    color: #fff;
}

.headeded ul li a:hover {
    transition: 0.3s ease;
    color: #302419;

}

.writeing-section {
    padding: 32px 0;
    min-height: 100vh;
    background-color: #fbf9f6de;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;

}

.writeing-section .customize {
    display: flex;
    width: 60%;
    padding: 5px 0;
    border-bottom: 1px solid rgba(128, 128, 128, 0.194);
}

.writeing-section .customize div {
    padding: 0 4px;
}

.writeing-section .customize div button {
    background-color: transparent;
    color: #7a736d;
    border: none;
    padding: 4px 8px;
}

.writeing-section .customize div button.active {
    background-color: #f59f0b6f;
    border-radius: 4px;
    color: #D48C11;
}

.writeing-section .customize div button,
.writeing-section .customize div label {
    background-color: transparent;
    border: none;
    padding: 10px 15px;
    font-size: 15px;
    color: #7a736d;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.writeing-section .customize div button:hover,
.writeing-section .customize div label:hover {
    background-color: #e4dfd563;
    border-radius: 4px;
}

.tool-btn-input {
    display: none;
}

.tool-btn-input:checked+label {
    background: rgba(212, 140, 17, 0.1) !important;
    color: #D48C11 !important;
    border-radius: 4px;
}

.writeing-section .customize .aligns {
    border: 1px solid #7a736d80;
    border-top: none;
    border-bottom: none;
}

.writeing-section .formcont {
    width: 100%;
    max-width: 800px;
    margin: 10px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
    /* Added padding to push content right and add breathing room */
}

.writeing-section .formcont form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    display: none;
    gap: 5px;
}

.writeing-section .formcont form.active {
    display: flex;
}

.writeing-section .formcont form.Story {
    padding-left: 0;
    align-items: flex-start;
}

.writeing-section .formcont form.Poem {
    padding-left: 15%;
    padding-right: 15%;
    text-align: left;
    /* Ensure text alignment is left */
}

.writeing-section .formcont form.Poem .poem-editor,
.writeing-section .formcont form.Poem .poem-sub-name {
    text-align: left;
}

/* Force align inputs for Poem form to match editor content */
.writeing-section .formcont form.Poem .titlee,
.writeing-section .formcont form.Poem .cn {
    text-align: left !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
    margin-left: 0 !important;
    width: 100%;
}

.writeing-section .formcont form.Poem .titlee {
    margin-bottom: 40px !important;
    /* Wide separation */
}

.writeing-section .formcont form.Poem .cn {
    font-family: Georgia, 'Times New Roman', Times, serif;
    color: #302419 !important;
    /* Dark color like headers */
    font-size: 20px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 10px;
}

.writeing-section .formcont form.Poem .cn::placeholder {
    color: #30241950 !important;
    /* Semi-transparent dark for placeholder */
}

.writeing-section .formcont form input {
    margin: 12px 0;
    background-color: transparent;
    border: none;

}

.writeing-section .formcont form input::placeholder {
    color: #7a736da9;
}

.writeing-section .formcont form input:focus {
    border: none;
    outline: none;
}

.writeing-section .formcont form .titlee {
    font-weight: 600;
    font-size: 16px;
    font-family: Georgia, 'Times New Roman', Times, serif;
}

.writeing-section .formcont form .cn {
    font-family: system-ui, sans-serif;
    color: #7a736da9;
    font-size: 14px;
}

.writeing-section .formcont form .editor-content {
    margin: 10px 0;
    background-color: transparent;
    color: #302419;
    width: 100%;
    min-height: 100px;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 20px;
    line-height: 1.6;
    word-wrap: break-word;
    cursor: text;
}

/* Placeholder for contenteditable */
.editor-content:empty:before {
    content: attr(placeholder);
    color: #7a736da9;
    pointer-events: none;
    display: inline-block;
    font-style: inherit;
    text-decoration: inherit;
    font-weight: inherit;
}

/* --- Editor Toolbar Layout --- */
.mobile-toolbar-toggle {
    display: none;
}

.editor-toolbar {
    display: none;
    width: 100%;
}

.desktop-customize {
    display: flex;
}

.mode-tabs-container {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.mobile-tabs {
    display: none;
}

.mobile-tab-btn {
    display: none;
}

/* --- Writing Page Mobile Responsiveness --- */
@media (max-width: 768px) {
    .headeded {
        flex-wrap: wrap;
        padding: 10px;
        gap: 10px;
        justify-content: space-between;
    }

    .headeded ul {
        padding: 0;
        margin: 0;
        flex-wrap: wrap;
        gap: 10px;
    }

    .headeded ul li {
        margin-right: 0;
    }

    .headeded ul li a {
        padding: 6px 12px;
        font-size: 13px;
    }

    .headeded ul li .tab-btn {
        padding: 6px 14px;
        font-size: 13px;
    }

    /* Mobile Writing Toolbar Dropdown */
    .mobile-toolbar-toggle {
        display: flex;
        justify-content: center;
        width: 100%;
        margin-bottom: 10px;
    }

    .mobile-toolbar-toggle button {
        background: #fff;
        border: 1px solid rgba(212, 140, 17, 0.4);
        color: #D48C11;
        padding: 10px 20px;
        border-radius: 8px;
        font-family: system-ui, sans-serif;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        box-shadow: 0 4px 6px rgba(212, 140, 17, 0.1);
        transition: all 0.2s ease;
    }

    .editor-toolbar {
        display: none;
        /* Hidden by default behind toggle */
        flex-direction: column;
        align-items: center;
        background: #fff;
        padding: 15px;
        border-radius: 12px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
        border: 1px solid rgba(0, 0, 0, 0.03);
        margin-bottom: 15px;
        width: 100%;
        gap: 10px;
    }

    .editor-toolbar.active {
        display: flex;
    }

    .mode-tabs-container {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
        order: 3;
        margin-top: 5px;
    }

    .desktop-tabs {
        display: none !important;
    }

    .mobile-tabs {
        display: flex !important;
    }

    .desktop-customize {
        display: none !important;
    }

    .writeing-section {
        padding: 15px 10px;
    }

    .writeing-section .customize {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .writeing-section .formcont {
        padding: 0 10px;
    }

    .writeing-section .formcont form.Poem {
        padding-left: 0;
        padding-right: 0;
    }

    .writeing-section .customize div button,
    .writeing-section .customize div label {
        padding: 8px 12px;
    }

    /* Script editor wider spacing on mobile */
    #editor-script {
        line-height: 2.2;
        font-size: 16px;
    }

    #editor-script>div,
    #editor-script>p {
        margin-bottom: 16px;
    }

    /* Floating Tab key button - only visible in script mode */
    .mobile-tab-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 16px;
        left: 16px;
        z-index: 9999;
        background: #fff;
        border: 1.5px solid rgba(212, 140, 17, 0.5);
        color: #D48C11;
        font-family: system-ui, sans-serif;
        font-size: 15px;
        font-weight: 700;
        padding: 10px 22px;
        border-radius: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
        cursor: pointer;
        user-select: none;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    body.script-mode .mobile-tab-btn {
        opacity: 1;
        pointer-events: auto;
    }
}

/* ==========================================================================
   DASHBOARD SECTION
   ========================================================================== */

.dashboard-page {
    background-color: #fbf9f6;
    min-height: 100vh;
    padding-bottom: 80px;
}

.dashboard-header {
    padding: 60px 20px 40px;
    background: linear-gradient(to bottom, rgba(212, 140, 17, 0.05), transparent);
}

.dashboard-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.dashboard-header h1 {
    font-family: Georgia, serif;
    font-size: 36px;
    color: #302419;
    margin-bottom: 12px;
}

.dashboard-header .subtitle {
    font-size: 18px;
    color: #7a736d;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 40px 0 60px;
}

.stat-card {
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid rgba(48, 36, 25, 0.04);
    box-shadow: 0 10px 30px rgba(48, 36, 25, 0.04);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: rgba(212, 140, 17, 0.1);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #D48C11;
}

.stat-info .stat-label {
    display: block;
    font-size: 14px;
    color: #7a736d;
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-info .stat-value {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: #302419;
    font-family: Georgia, serif;
}

/* My Stories List */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-family: Georgia, serif;
    font-size: 28px;
    color: #302419;
}

.btn-primary {
    background-color: #D48C11;
    color: #fff;
    padding: 12px 24px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #bf7e0f;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 140, 17, 0.2);
}

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

.dashboard-story-card {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 30px;
    border: 1px solid rgba(48, 36, 25, 0.04);
    transition: all 0.3s ease;
}

.dashboard-story-card:hover {
    transform: translateX(10px);
    border-color: rgba(212, 140, 17, 0.2);
    box-shadow: 0 10px 40px rgba(48, 36, 25, 0.06);
}

.story-image {
    width: 80px;
    height: 110px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.story-image img,
.image-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder {
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 24px;
}

.story-details {
    flex: 1;
}

.story-details h3 {
    font-family: Georgia, serif;
    font-size: 20px;
    color: #302419;
    margin-bottom: 8px;
}

.story-meta,
.story-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #7a736d;
}

.story-meta {
    margin-bottom: 12px;
}

.story-meta span,
.story-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.story-stats i {
    color: #D48C11;
}

.story-actions {
    display: flex;
    gap: 12px;
}

.btn-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #7a736d;
    border: 1px solid #eee;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: #fbf9f6;
    color: #D48C11;
    border-color: #D48C11;
    transform: scale(1.1);
}

.empty-state {
    text-align: center;
    padding: 80px 40px;
    background: #fff;
    border-radius: 20px;
    border: 2px dashed #eee;
}

.empty-state i {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 24px;
}

.empty-state p {
    color: #7a736d;
    font-size: 18px;
    margin-bottom: 30px;
}

/* ==========================================================================
   BOOK MANAGEMENT & CHAPTERS
   ========================================================================== */

.header-with-back {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-back {
    text-decoration: none;
    color: #7a736d;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.btn-back:hover {
    color: #D48C11;
}

.stories-list {
    margin-bottom: 20px;
}

.customize .chapter-order {
    font-family: Georgia, serif;
    font-size: 24px;
    font-weight: 800;
    color: rgba(212, 140, 17, 0.2);
    width: 40px;
    margin-bottom: 30px;
}

.status-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.published {
    background: rgba(21, 128, 61, 0.1);
    color: #15803d;
}

.status-badge.draft {
    background: rgba(122, 115, 109, 0.1);
    color: #7a736d;
}

/* Continuous Writing Flow */
.chapter-separator {
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(212, 140, 17, 0.3), transparent);
    margin: 40px 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
}

.chapter-separator span {
    background: #fbf9f6;
    padding: 0 15px;
    font-size: 11px;
    color: rgba(212, 140, 17, 0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

/* ==========================================================================
   END DASHBOARD SECTION
   ========================================================================== */

/* Publish Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    /* Controlled by JS */
    justify-content: center;
    align-items: center;
    z-index: 1000000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    width: 95%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease;
}

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

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

.modal-content h2 {
    font-family: Georgia, serif;
    margin-bottom: 20px;
    color: #302419;
}

.modal-field {
    margin-bottom: 20px;
}

.modal-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #7a736d;
}

.modal-field input[type="text"],
.modal-field textarea,
.modal-field select,
.modal-field input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.modal-field textarea {
    height: 100px;
    resize: vertical;
}

.modal-btns {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

.modal-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.modal-btn.cancel {
    background: #eee;
    color: #7a736d;
}

.modal-btn.confirm {
    background: #D48C11;
    color: #fff;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ===================================
   TOAST NOTIFICATION SYSTEM
   =================================== */

#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid #D48C11;
}

.toast.success {
    border-left-color: #4CAF50;
}

.toast.success ion-icon {
    color: #4CAF50;
}

.toast.error {
    border-left-color: #f44336;
}

.toast.error ion-icon {
    color: #f44336;
}

.toast.info {
    border-left-color: #2196F3;
}

.toast.info ion-icon {
    color: #2196F3;
}

.toast ion-icon {
    font-size: 24px;
}

.toast span {
    font-family: system-ui, sans-serif;
    font-size: 14px;
    color: #302419;
    font-weight: 500;
}

.toast.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

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

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* ===================================
   DELETE BUTTON STYLING
   =================================== */

.btn-delete {
    background: transparent;
    border: 1px solid rgba(244, 67, 54, 0.2);
    color: #f44336;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    background: #f44336;
    color: #fff;
    border-color: #f44336;
}

.modal-btn.confirm {
    background: #f44336;
}

.modal-btn.confirm:hover {
    background: #d32f2f;
}

/* ===================================
   PUBLIC BOOK VIEW PAGE
   =================================== */

.book-view-page {
    background-color: #fbf9f6;
    min-height: 100vh;
}

.book-hero {
    background: linear-gradient(135deg, rgba(212, 140, 17, 0.05) 0%, transparent 100%);
    padding: 80px 20px;
}

.book-container {
    max-width: 1000px;
    margin: 0 auto;
}

.book-header {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.book-cover {
    flex-shrink: 0;
    width: 250px;
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-info {
    flex: 1;
}

.book-info h1 {
    font-family: Georgia, serif;
    font-size: 48px;
    color: #302419;
    margin-bottom: 16px;
    font-weight: 700;
}

.author-name {
    font-family: system-ui, sans-serif;
    font-size: 18px;
    color: #7a736d;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.genre-badge {
    display: inline-block;
    background: #D48C11;
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.book-meta {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    font-family: system-ui, sans-serif;
    font-size: 14px;
    color: #7a736d;
}

.book-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.book-meta i {
    color: #D48C11;
}

.book-description h3 {
    font-family: Georgia, serif;
    font-size: 20px;
    color: #302419;
    margin-bottom: 12px;
}

.book-description p {
    font-family: system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #7a736d;
}

.chapters-list-section {
    padding: 60px 20px;
}

.chapters-list-section h2 {
    font-family: Georgia, serif;
    font-size: 32px;
    color: #302419;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chapters-list-section h2 i {
    color: #D48C11;
}

.public-chapters-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.public-chapter-card {
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(48, 36, 25, 0.06);
    display: flex;
    align-items: center;
    gap: 24px;
    transition: all 0.3s ease;
}

.public-chapter-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-color: rgba(212, 140, 17, 0.2);
}

.chapter-number {
    font-family: Georgia, serif;
    font-size: 36px;
    font-weight: 800;
    color: rgba(212, 140, 17, 0.2);
    min-width: 60px;
    text-align: center;
}

.chapter-details {
    flex: 1;
}

.chapter-details h3 {
    font-family: Georgia, serif;
    font-size: 20px;
    color: #302419;
    margin-bottom: 8px;
}

.chapter-meta {
    font-family: system-ui, sans-serif;
    font-size: 14px;
    color: #7a736d;
    display: flex;
    gap: 20px;
}

.chapter-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chapter-meta i {
    color: #D48C11;
}

.btn-read {
    background: #D48C11;
    color: #fff;
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-family: system-ui, sans-serif;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-read:hover {
    background: #bf7e0f;
    transform: translateX(4px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .book-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .book-cover {
        width: min(200px, 60vw);
        height: auto;
        aspect-ratio: 2/3;
    }

    .book-info h1 {
        font-size: clamp(24px, 8vw, 36px);
    }

    .book-meta {
        flex-direction: column;
        gap: 12px;
    }

    .public-chapter-card {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
}

/* ===================================
   PREMIUM READING INTERFACE
   =================================== */

.reading-interface {
    background-color: #ffffff;
    min-height: 100vh;
    color: #302419;
    font-family: 'Merriweather', Georgia, serif;
}

.reading-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

@media (min-width: 768px) {
    .reading-container {
        padding: 0 40px;
    }
}

.flex-col {
    display: flex;
    flex-direction: column;
}

/* Fixed Header */
.reading-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: #ffffff;
    z-index: 1000;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.reading-header .reading-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link {
    text-decoration: none;
    color: #7a736d;
    font-size: 14px;
    font-weight: 500;
    font-family: system-ui, sans-serif;
    transition: color 0.2s;
}

.back-link:hover {
    color: #302419;
}

.utility-icons {
    display: flex;
    gap: 20px;
}

.utility-icons button {
    background: none;
    border: none;
    color: #302419;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s, color 0.2s;
}

.utility-icons button:hover {
    opacity: 1;
    color: #D48C11;
}

/* Reading Content */
.reading-content {
    padding: 120px 0 100px;
    /* Spacing for fixed header and footer */
}

.story-meta-top {
    text-align: center;
    margin-bottom: 30px;
}

.book-title-accent {
    color: #D48C11;
    font-size: 16px;
    font-weight: 600;
    font-family: system-ui, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.author-attribution {
    color: #7a736d;
    font-size: 14px;
    font-family: system-ui, sans-serif;
}

.chapter-display-title {
    font-size: 48px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 12px;
    line-height: 1.2;
}

.chapter-sequence-muted {
    text-align: center;
    color: #7a736d;
    font-size: 15px;
    margin-bottom: 60px;
}

.chapter-body-text {
    font-size: 20px;
    line-height: 1.6;
    color: #302419;
    overflow-wrap: break-word;
    word-break: break-word;
}

.chapter-body-text p,
.chapter-body-text div {
    margin-bottom: 24px;
}

/* Drop Cap Styling */
.drop-cap-p::first-letter {
    color: #D48C11;
    float: left;
    font-size: 84px;
    line-height: 1;
    padding-top: 4px;
    padding-right: 12px;
    padding-left: 3px;
    font-family: Georgia, serif;
    font-weight: 400;
}

/* End Navigation */
.reading-end-nav {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-next-chapter,
.btn-prev-chapter {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #D48C11;
    color: #fff;
    padding: 16px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-prev-chapter {
    background: #7a736d;
    /* Muted color for previous */
}

.btn-next-chapter:hover,
.btn-prev-chapter:hover {
    transform: scale(1.05);
    background: #bf7e0f;
    box-shadow: 0 10px 25px rgba(212, 140, 17, 0.2);
}

.btn-prev-chapter:hover {
    background: #302419;
}

.end-message {
    color: #7a736d;
    font-style: italic;
}

/* Fixed Footer & Progress Bar */
.reading-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    z-index: 1000;
}

.footer-layout {
    display: flex;
    align-items: center;
    gap: 20px;
}

.progress-info-left,
.progress-info-right {
    font-size: 13px;
    color: #7a736d;
    font-family: system-ui, sans-serif;
    white-space: nowrap;
}

.progress-bar-container {
    flex: 1;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #D48C11;
    transition: width 0.3s ease;
}

/* TOC Sidebar */
.reading-sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100%;
    background: #fff;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
}

.reading-sidebar.active {
    right: 0;
}

.sidebar-header {
    padding: 25px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-family: system-ui, sans-serif;
    font-size: 18px;
    font-weight: 700;
}

.sidebar-header button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #7a736d;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.toc-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    text-decoration: none;
    color: #302419;
    border-radius: 10px;
    transition: background 0.2s;
}

.toc-item:hover {
    background: rgba(212, 140, 17, 0.05);
}

.toc-item.active {
    background: rgba(212, 140, 17, 0.1);
    color: #D48C11;
    font-weight: 600;
}

.toc-order {
    font-size: 12px;
    color: #7a736d;
    width: 20px;
}

.toc-title {
    font-size: 15px;
}

/* Themes */
.reading-interface.theme-sepia {
    background-color: #f4ecd8;
    color: #5b4636;
}

.reading-interface.theme-sepia .reading-header,
.reading-interface.theme-sepia .reading-footer,
.reading-interface.theme-sepia .reading-sidebar {
    background-color: #f4ecd8;
    border-color: rgba(91, 70, 54, 0.1);
}

.reading-interface.theme-sepia .back-link,
.reading-interface.theme-sepia .utility-icons button,
.reading-interface.theme-sepia .author-attribution,
.reading-interface.theme-sepia .chapter-sequence-muted,
.reading-interface.theme-sepia .progress-info-left,
.reading-interface.theme-sepia .progress-info-right {
    color: #5b4636;
    opacity: 0.8;
}

.reading-interface.theme-dark {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

.reading-interface.theme-dark .reading-header,
.reading-interface.theme-dark .reading-footer,
.reading-interface.theme-dark .reading-sidebar {
    background-color: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.1);
}

.reading-interface.theme-dark .back-link,
.reading-interface.theme-dark .utility-icons button,
.reading-interface.theme-dark .author-attribution,
.reading-interface.theme-dark .chapter-sequence-muted,
.reading-interface.theme-dark .progress-info-left,
.reading-interface.theme-dark .progress-info-right,
.reading-interface.theme-dark .chapter-display-title {
    color: #e0e0e0;
}

.reading-interface.theme-dark .chapter-body-text {
    color: #cccccc;
}

/* Settings Sidebar Specifics */
.settings-sidebar .sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 30px;
}

.setting-group p {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    font-family: system-ui, sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-group button {
    padding: 12px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.theme-dark .btn-group button {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-group button:hover {
    background: #D48C11;
    color: #fff;
    border-color: #D48C11;
}

.theme-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.theme-btn {
    padding: 15px 5px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.theme-btn.light {
    background: #fff;
    color: #333;
    border-color: #eee;
}

.theme-btn.sepia {
    background: #f4ecd8;
    color: #5b4636;
    border-color: #e4dbc4;
}

.theme-btn.dark {
    background: #1a1a1a;
    color: #fff;
    border-color: #333;
}

.theme-btn:hover {
    transform: scale(1.05);
}

/* Fullscreen leak prevention */
.reading-interface {
    position: relative;
    z-index: 10;
}

/* Hide global components if they leak (just in case) */
.reading-interface~header,
.reading-interface~footer {
    display: none !important;
}

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

    .reading-header,
    .reading-footer {
        padding: 0 15px;
    }

    .chapter-display-title {
        font-size: 32px;
    }

    .chapter-body-text {
        font-size: 18px;
    }

    .reading-sidebar {
        width: 100%;
        right: -100%;
    }
}

/* ==========================================================================
   PREMIUM STORY CARDS (Mockup Style)
   ========================================================================== */
.stories-box.st .boxed {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 20px 0;
    justify-items: center;
    justify-content: center;
}

/* Specific left-aligned flex row for Books and Poems */
.stories-box.st .boxed.book-list-view,
.stories-box.st .boxed.poem-list-view {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: stretch;
    padding: 20px 40px;
}

.book-list-view .premium-story-card,
.poem-list-view .premium-story-card {
    flex: 0 0 calc((100% - 80px) / 3);
    max-width: calc((100% - 80px) / 3);
    min-width: 300px;
}

@media (max-width: 1100px) {

    .book-list-view .premium-story-card,
    .poem-list-view .premium-story-card {
        flex: 0 0 calc((100% - 40px) / 2);
        max-width: calc((100% - 40px) / 2);
    }
}

@media (max-width: 768px) {

    .book-list-view .premium-story-card,
    .poem-list-view .premium-story-card {
        flex: 0 0 100%;
        max-width: 100%;
        min-width: unset;
    }

    .stories-box.st .boxed.book-list-view,
    .stories-box.st .boxed.poem-list-view {
        padding: 20px;
        justify-content: center;
    }
}

/* Cleaned up redundant .stories-box.st .boxed rules */

.premium-story-card {
    background: #ffffff;
    border-radius: 24px;
    /* More rounded premium feel */
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
}

@media (min-width: 768px) {
    .premium-story-card {
        max-width: 450px;
        /* Hard limit to prevent "ridiculously wide" if flex fails */
    }
}

.premium-story-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-premium);
    border-color: rgba(212, 140, 17, 0.2);
}

/* Header Backgrounds with Grain/Depth */
.v-purple {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.v-vibrant-orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.v-slate {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

.v-maroon {
    background: linear-gradient(135deg, #881337 0%, #4c0519 100%);
}

/* New Premium Gradients for Randomization */
.bg-grad-1 {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

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

.bg-grad-3 {
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
}

.bg-grad-4 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

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

.bg-grad-6 {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.bg-grad-7 {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.bg-grad-8 {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
}

.bg-grad-9 {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
}

.bg-grad-10 {
    background: linear-gradient(135deg, #64748b 0%, #334155 100%);
}

.bg-grad-11 {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

.bg-grad-12 {
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
}

/* Enhanced Comment Styles */
.comment-card {
    background: #f8fafc;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    margin-bottom: 20px;
    transition: transform 0.2s;
}

.comment-card:hover {
    background: #f1f5f9;
}

.comment-header {
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.comment-author {
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
    margin-right: 12px;
}

.comment-date {
    color: #94a3b8;
    font-size: 0.85rem;
}

.comment-content {
    color: #475569;
    line-height: 1.6;
    font-size: 1.05rem;
}

.comment-delete-btn {
    background: #fee2e2;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.9rem;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0.8;
}

.comment-delete-btn:hover {
    background: #fecaca;
    color: #b91c1c;
    opacity: 1;
    transform: scale(1.05);
}

.card-header-vibrant::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3BaseFilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/baseFilter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
}

.card-header-vibrant {
    height: 220px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #f8fafc;
    background-size: cover;
    background-position: center;
    /* Fallback background */
}

/* Rating Badge Overlay */
.card-rating-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 5;
}

.card-rating-badge i {
    color: #ffcc00;
    font-size: 10px;
}

/* Header Icon: Square Style with Book */
.card-icon-overlay {
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 28px;
    position: relative;
    z-index: 2;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.premium-story-card:hover .card-icon-overlay {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.9);
}

/* Book List View Overrides (Step 1183 design) */
.book-list-view .premium-story-card .card-rating-badge {
    display: none;
}

.book-list-view .premium-story-card .card-icon-overlay {
    border: none;
    box-shadow: none;
    font-size: 64px;
    opacity: 0.9;
}

.book-list-view .premium-story-card .card-metrics-footer {
    display: flex;
}

.card-body-content {
    padding: 35px;
    /* Increased padding */
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-badge-pill {
    display: inline-block;
    padding: 5px 14px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 12px;
    width: fit-content;
}

.card-story-title {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    /* Slightly smaller to match image */
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 6px;
    line-height: 1.25;
}

.card-author-line {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 15px;
}

.card-preview-text {
    font-size: 13.5px;
    line-height: 1.6;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* --- Contact Page Enhancements --- */
.contact-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding: 20px;
    background: #fbf9f6;
    border-radius: 15px;
}

.contact-item i {
    font-size: 24px;
    color: #D48C11;
}

.contact-item h4 {
    font-family: Georgia, serif;
    font-size: 18px;
    margin-bottom: 5px;
}

.contact-form-premium .form-group {
    margin-bottom: 20px;
}

.contact-form-premium label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 14px;
    color: #302419;
}

.contact-form-premium input,
.contact-form-premium textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.contact-form-premium input:focus,
.contact-form-premium textarea:focus {
    outline: none;
    border-color: #D48C11;
    box-shadow: 0 0 0 4px rgba(212, 140, 17, 0.1);
}

/* Global Polish */
html {
    scroll-behavior: smooth;
}

::selection {
    background: rgba(212, 140, 17, 0.2);
    color: #302419;
}

.card-metrics-footer {
    display: none;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    justify-content: flex-start;
    gap: 20px;
}

.card-metrics-footer .metric {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.card-metrics-footer .metric i {
    font-size: 16px;
    color: #94a3b8;
    /* Light slate icons as in image */
    transition: color 0.3s ease;
}

.premium-story-card:hover .card-metrics-footer .metric i {
    color: var(--primary);
}

/* Bookmarks Variation integration */

/* ==========================================================================
   PREMIUM BOOK PROFILE PAGE
   ========================================================================== */
.book-profile-page {
    background-color: #fbf9f6;
    min-height: 100vh;
    position: relative;
    padding-bottom: 100px;
    overflow-x: hidden;
}

.profile-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 500px;
    background-size: cover;
    background-position: center;
    filter: blur(80px) brightness(0.9);
    opacity: 0.15;
    z-index: 1;
}

.profile-hero-section {
    position: relative;
    z-index: 2;
    padding-top: 60px;
}

.profile-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 30px;
}

.profile-card {
    background: #ffffff;
    border-radius: 30px;
    padding: 50px;
    box-shadow: 0 20px 60px rgba(48, 36, 25, 0.08);
    border: 1px solid rgba(48, 36, 25, 0.03);
}

.profile-header-main {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.profile-cover-wrapper {
    flex-shrink: 0;
    width: 280px;
    position: relative;
    z-index: 3;
}

.main-cover {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    display: block;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.cover-shadow {
    position: absolute;
    bottom: -15px;
    left: 10%;
    width: 80%;
    height: 30px;
    background: rgba(0, 0, 0, 0.2);
    filter: blur(20px);
    z-index: -1;
}

.profile-content-main {
    flex: 1;
}

.profile-badge-row {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

.premium-badge {
    padding: 6px 16px;
    background: rgba(212, 140, 17, 0.1);
    color: #D48C11;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    font-family: system-ui, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.premium-badge.outline {
    background: none;
    border: 1px solid rgba(122, 115, 109, 0.2);
    color: #7a736d;
}

.profile-title {
    font-family: Georgia, serif;
    font-size: 48px;
    color: #302419;
    line-height: 1.1;
    margin-bottom: 20px;
    font-weight: 800;
}

.profile-author-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 35px;
}

.author-avatar-stub {
    width: 32px;
    height: 32px;
    background: #302419;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.author-label {
    font-size: 14px;
    color: #7a736d;
}

.author-value {
    font-size: 14px;
    color: #302419;
    font-weight: 700;
}

.profile-stats-row {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 35px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-family: Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    color: #302419;
}

.stat-lbl {
    font-size: 12px;
    color: #7a736d;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-sep {
    width: 1px;
    height: 30px;
    background: rgba(48, 36, 25, 0.1);
}

.profile-desc {
    font-size: 17px;
    line-height: 1.7;
    color: #5b5550;
    margin-bottom: 40px;
    max-width: 600px;
}

.profile-cta-row {
    display: flex;
    gap: 20px;
}

.btn-premium-solid {
    background: #302419;
    color: #fff;
    padding: 16px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    box-shadow: 0 10px 25px rgba(48, 36, 25, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-premium-solid:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(48, 36, 25, 0.3);
}

.btn-premium-outline {
    background: none;
    border: 2px solid rgba(48, 36, 25, 0.1);
    color: #302419;
    padding: 16px 35px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.btn-premium-outline:hover {
    background: rgba(48, 36, 25, 0.03);
    border-color: #302419;
}

/* Chapters Section */
.profile-chapters-section {
    padding-top: 80px;
}

.section-heading-row {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 40px;
}

.section-heading-row h2 {
    font-family: Georgia, serif;
    font-size: 28px;
    color: #302419;
    white-space: nowrap;
}

.heading-line {
    flex: 1;
    height: 1px;
    background: rgba(48, 36, 25, 0.1);
}

.premium-chapters-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.chapter-list-item {
    background: white;
    border-radius: 16px;
    padding: 25px 35px;
    display: flex;
    align-items: center;
    gap: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.chapter-list-item:hover {
    transform: translateX(10px);
    border-color: rgba(212, 140, 17, 0.3);
    box-shadow: 0 10px 30px rgba(48, 36, 25, 0.05);
}

.chap-index {
    font-family: Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    color: #D48C11;
    opacity: 0.5;
}

.chap-info {
    flex: 1;
}

.chap-name {
    font-size: 18px;
    font-weight: 700;
    color: #302419;
    margin-bottom: 4px;
}

.chap-meta {
    font-size: 13px;
    color: #7a736d;
}

.chap-action {
    color: #D48C11;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.chapter-list-item:hover .chap-action {
    opacity: 1;
    transform: translateX(0);
}

.empty-chapters {
    text-align: center;
    padding: 60px;
    background: white;
    border-radius: 24px;
    border: 2px dashed rgba(48, 36, 25, 0.1);
}

.empty-icon {
    font-size: 40px;
    color: rgba(48, 36, 25, 0.1);
    margin-bottom: 20px;
}

/* Premium Toast */
.toast.success-premium {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #302419;
    color: #fff;
    padding: 16px 30px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 111111;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 600;
    font-size: 14px;
}

.fa-sparkles {
    color: #D48C11;
}

@media (max-width: 992px) {
    .profile-header-main {
        flex-direction: column;
        gap: 40px;
        align-items: center;
        text-align: center;
    }

    .profile-badge-row,
    .profile-cta-row,
    .profile-stats-row {
        justify-content: center;
    }

    .profile-desc {
        margin: 0 auto 40px;
        max-width: 100%;
    }

    .profile-card {
        padding: 30px;
    }

    .profile-title {
        font-size: 36px;
    }
}

/* ==========================================================================
   PREMIUM INFORMATIONAL PAGES (About, Writing Tips, Community, etc.)
   ========================================================================== */
.static-page {
    background-color: #fbf9f6;
    min-height: 100vh;
}

.static-header {
    background: linear-gradient(135deg, #302419 0%, #4a3a2a 100%);
    color: #fff;
    padding: 100px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.static-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("../images/bg2.png");
    opacity: 0.1;
    pointer-events: none;
}

.static-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 30px;
    position: relative;
    z-index: 2;
}

.static-header h1 {
    font-family: Georgia, serif;
    font-size: 56px;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.static-header h1 i {
    color: #D48C11;
    margin-right: 15px;
    font-size: 0.8em;
}

.static-header .subtitle {
    font-size: 20px;
    opacity: 0.9;
    font-family: Georgia, serif;
    max-width: 700px;
    margin: 0 auto;
}

.static-content {
    padding: 80px 0;
}

.static-text-box {
    background: #fff;
    padding: 50px;
    border-radius: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.static-text-box h2 {
    font-family: Georgia, serif;
    font-size: 32px;
    color: #302419;
    margin-bottom: 25px;
}

.static-text-box p {
    color: #555;
    line-height: 1.8;
    font-size: 17px;
    margin-bottom: 20px;
}

/* --- Writing Tips Enhancements --- */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 35px;
}

.tip-card {
    background: #fff;
    padding: 40px;
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.tip-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px rgba(48, 36, 25, 0.08);
    border-color: rgba(212, 140, 17, 0.3);
}

.tip-icon {
    width: 60px;
    height: 60px;
    background: rgba(212, 140, 17, 0.1);
    color: #D48C11;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 28px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.tip-card:hover .tip-icon {
    background: #D48C11;
    color: #fff;
    transform: rotate(10deg);
}

.tip-card h3 {
    font-family: Georgia, serif;
    font-size: 22px;
    color: #302419;
    margin-bottom: 15px;
}

.tip-card p {
    color: #6b7280;
    line-height: 1.6;
    font-size: 15px;
}

/* --- Community Page Enhancements --- */
.community-hero {
    background: linear-gradient(135deg, #D48C11 0%, #b87a0f 100%);
    padding: 80px 40px;
    border-radius: 40px;
    color: #fff;
    margin-bottom: 60px;
    text-align: center;
    box-shadow: 0 30px 60px rgba(212, 140, 17, 0.2);
}

.community-hero h2 {
    font-size: 42px;
    font-family: Georgia, serif;
    margin-bottom: 20px;
}

.community-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

.community-card {
    background: #fff;
    padding: 45px;
    border-radius: 30px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.02);
    text-align: center;
    transition: all 0.3s ease;
}

.community-card:hover {
    border-color: #302419;
    transform: scale(1.02);
}

.community-card h3 {
    font-family: Georgia, serif;
    font-size: 26px;
    margin-bottom: 18px;
    color: #302419;
}

.community-card p {
    color: #7a736d;
    font-size: 16px;
    margin-bottom: 30px;
}

/* --- Contest Page Enhancements --- */
.active-contest {
    background: #fff;
    padding: 60px;
    border-radius: 40px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.active-contest::after {
    content: "🏆";
    position: absolute;
    bottom: -20px;
    right: -20px;
    font-size: 200px;
    opacity: 0.05;
    transform: rotate(-15deg);
}

.contest-badge {
    display: inline-block;
    background: #ef4444;
    color: #fff;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 25px;
}

.active-contest h2 {
    font-family: Georgia, serif;
    font-size: 48px;
    color: #302419;
    margin-bottom: 20px;
}

.contest-prizes {
    display: flex;
    gap: 40px;
    margin: 30px 0;
}

@media (max-width: 768px) {
    .contest-prizes {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
}

.contest-prizes span {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: #D48C11;
}

.contest-prizes i {
    font-size: 24px;
}

.contest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
    justify-items: center;
}

.contest-card-mini {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 35px;
    border-radius: 25px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    width: 100%;
    max-width: 400px;
}

.contest-card-mini:hover {
    background: #fff;
    border-color: #D48C11;
    box-shadow: 0 15px 30px rgba(212, 140, 17, 0.1);
}

.contest-card-mini h3 {
    font-family: Georgia, serif;
    font-size: 20px;
    margin-bottom: 10px;
    color: #302419;
}

.contest-card-mini p {
    color: #D48C11;
    font-weight: 700;
    font-size: 14px;
}

/* Script Editor Formatting */
.Script .editor-content {
    font-family: 'Courier New', 'Noto Sans Ethiopic', Courier, monospace !important;
    font-size: 13px;
    /* Smaller for Amharic */
    line-height: 1.2;
    font-weight: 300;
    /* Lighter for Amharic scripts */
    counter-reset: scene-counter;
}

.Story .editor-content {
    font-family: 'Georgia', 'Noto Serif Ethiopic', serif;
    font-size: 18px;
    /* Smaller default for Story */
}

/* refined script styles */
.script-center {
    text-align: center;
    margin: 5px 5% !important;
}

@media (min-width: 768px) {
    .script-center {
        margin: 5px 20% !important;
    }
}

.script-left {
    text-align: left;
    margin: 5px 0 !important;
}

/* Dedicated Classes */
.script-character {
    text-align: center;
    font-weight: 900;
    margin: 10px 10% 2px 10% !important;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (min-width: 768px) {
    .script-character {
        margin: 10px 35% 2px 35% !important;
    }
}

.script-dialogue {
    text-align: left;
    margin: 0 5% 0 5% !important;
}

@media (min-width: 768px) {
    .script-dialogue {
        margin: 0 20% 0 20% !important;
    }
}

.script-parenthetical {
    text-align: center;
    font-style: italic;
    margin: 0 30% 2px 30% !important;
}

/* Page Breaker for Script Editor */
.page-divider {
    height: 1px;
    background-color: #e4dfd5;
    margin: 40px -70px;
    position: relative;
    user-select: none;
    pointer-events: none;
    clear: both;
}

.page-divider::after {
    content: 'A4 PAGE BREAK';
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 0 12px;
    font-size: 10px;
    color: #b87a0f;
    font-family: system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
    border: 1px solid #e4dfd5;
    border-radius: 10px;
}

.script-transition {
    text-align: right;
    font-weight: bold;
    text-transform: uppercase;
    margin: 15px 0 15px 0 !important;
    /* Right aligned */
}

/* Scene Heading Style */
.script-scene {
    text-align: left;
    font-weight: bold;
    text-transform: uppercase;
    margin: 15px 0 5px 0 !important;
    position: relative;
    padding-right: 30px;
    /* Leave space for JS-injected number */
}

.editor-content div,
.editor-content p {
    min-height: 1.2em;
    margin: 0;
}

/* Poem Styles - Added for specialized poem editor flow */
#Form-poem {
    align-items: center !important;
    gap: 0 !important;
}


#Form-poem {
    align-items: center !important;
}

/* Extensive Poem Redesign - "Best" Look */
body.poem-mode .customize,
body.poem-mode .formcont,
body.poem-mode form {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

body.poem-mode .formcont {
    margin-top: 20px;
}

.Poem .titlee,
.Poem .cn {
    text-align: left;
    width: 100%;
    max-width: 800px;
    border: none;
    background: transparent;
    display: block;
    margin: 0 auto 10px auto !important;
    padding: 0 10px !important;
    font-family: 'Playfair Display', 'Noto Serif Ethiopic', serif;
    color: var(--text-main);
}

@media (min-width: 768px) {

    .Poem .titlee,
    .Poem .cn {
        width: 45%;
        padding: 0 !important;
    }
}

.Poem .titlee {
    font-size: 32px;
    /* Smaller title */
    font-weight: 900;
    /* Bolder for titles */
    margin-bottom: 5px !important;
    opacity: 0.9;
}

.Poem .titlee::placeholder {
    color: #302419;
    opacity: 0.3;
    font-style: italic;
}

.Poem .cn {
    font-size: 18px;
    /* Smaller subtitle */
    font-weight: 800;
    /* Bolder for subtitles */
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.7;
    margin-bottom: 40px !important;
    /* Space before body */
}

.Poem .cn::placeholder {
    color: #302419;
    opacity: 0.3;
}



/* Script Title Styling */
.Script .titlee {
    text-align: center;
    width: 100%;
    border: none;
    background: #ffffff;
    display: block;
    margin: 10px auto !important;
    padding: 8px 15px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #302419;
}


.poem-editor {
    width: 100%;
    max-width: 800px;
    margin: 0 auto !important;
    padding: 20px !important;
    background: transparent;
    min-height: 400px;
    border: none;
    font-family: 'Playfair Display', 'Noto Serif Ethiopic', Georgia, serif;
    font-size: 22px;
    line-height: 1.8;
    color: #4a3c31;
    text-align: left;
}

@media (min-width: 768px) {
    .poem-editor {
        width: 45%;
    }
}



/* Regular lines - single spaced */
.poem-editor div,
.poem-editor p {
    margin-bottom: 0px;
    padding: 0;
    line-height: 1.8;
}

/* Empty lines between stanzas - double spaced */
.poem-editor br+br,
.poem-editor div:empty,
.poem-editor p:empty {
    display: block;
    margin-bottom: 1.5em;
    /* Creates double spacing effect */
}

/* Stanza break marker */
.poem-stanza-break {
    display: block;
    height: 1.5em;
    margin: 0;
}

/* Stanza break style */
.poem-stanza-break {
    display: block;
    height: 1.5em;
    margin: 1.5em 0 0 0 !important;
}

.poem-line {
    text-align: left;
    margin-bottom: 0;
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    line-height: 1.5;
    color: #4a3c31;
    min-height: 1.2em;
}

.poem-sub-name {
    text-align: center;
    font-weight: 700;
    font-size: 24px;
    margin: 1.5em 0 0.75em 0 !important;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #302419;
    font-family: 'Playfair Display', serif;
}


/* Page Dividers & Counters */
.page-divider {
    border: none;
    border-top: 2px dashed #ddd;
    margin: 60px 0;
    position: relative;
    text-align: center;
    pointer-events: none;
    opacity: 0.6;
}

.page-divider::after {
    content: "PAGE BREAK";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: inherit;
    padding: 0 15px;
    font-size: 10px;
    color: #999;
    letter-spacing: 2px;
    font-family: system-ui, sans-serif;
}

.poem-editor .page-divider::after {
    background: #fdfbf7;
}

.page-indicator-floating {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(48, 36, 25, 0.9);
    color: #fff;
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    z-index: 1001;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s ease;
}

.page-indicator-floating i {
    color: #D48C11;
}

/* Header Page Counter */
.header-page-counter {
    background: rgba(0, 0, 0, 0.05);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 10px;
}

.header-page-counter i {
    color: #D48C11;
    font-size: 14px;
}

/* Professional Screenplay Formatting Definitions */
.script-scene {
    display: block;
    text-align: left;
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 24px;
    margin-bottom: 12px;
    width: 100%;
    counter-increment: scene-counter;
    padding-right: 2.5em;
    position: relative;
}

.script-scene::after {
    content: counter(scene-counter) ".";
    position: absolute;
    right: 0;
    font-weight: bold;
    opacity: 0.5;
    font-size: 0.85em;
}

.script-left {
    display: block;
    text-align: left;
    margin-bottom: 16px;
    width: 100%;
}

.script-character {
    display: block;
    margin-left: 37%;
    width: auto;
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 20px;
    margin-bottom: 2px;
}

.script-dialogue {
    display: block;
    margin-left: 25%;
    margin-right: 20%;
    width: auto;
    margin-bottom: 0;
}

.script-parenthetical {
    display: block;
    margin-left: 31%;
    font-style: italic;
    margin-bottom: 2px;
    width: auto;
}

.script-transition {
    display: block;
    text-align: right;
    text-transform: uppercase;
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: bold;
    width: 100%;
}

.editor-content {
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    line-height: 1.1;
    white-space: pre-wrap;
}

/* Write Page Mode Tabs */
.mode-tabs-container {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    font-family: system-ui, sans-serif;
}

.mode-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 400;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s ease;
    cursor: pointer;
    font-family: system-ui, sans-serif;
}

.mode-tab:hover {
    color: #333;
}

.mode-tab.active {
    color: #1a1a1a;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.mode-tab i {
    font-size: 13px;
    color: inherit;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #fff;
    color: #333;
    padding: 16px 30px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    font-weight: 600;
    font-size: 14px;
    animation: slideIn 0.3s ease-out;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.toast.fade-out {
    opacity: 0;
}

.toast.success {
    border-left: 4px solid #4CAF50;
}

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

.toast.info {
    border-left: 4px solid #2196F3;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

/* Fix for Story Form Width and Text Cutoff */
.formcont {
    width: 100%;
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.Story .editor-content {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 80px;
    background-color: transparent;
    /* Paper look removed */
    min-height: 80vh;
    box-shadow: none;
    line-height: 1.8;
    /* Improve readability */
    overflow-y: visible;
    /* Prevent cut off */
    white-space: pre-wrap;
    /* Preserve whitespace */
}

/* Ensure Titles are consistent */
.Story .titlee,
.Story .cn {
    max-width: 800px;
    margin: 0 auto 10px auto;
    text-align: left;
    padding-left: 80px;
}

.Story .titlee {
    font-size: 28px;
    font-weight: 700;
}

/* Fix for cut off text in contenteditable */
.editor-content,
.poem-editor {
    padding-bottom: 100px !important;
    /* Extra space at bottom */
}

/* Manage Book Page */
.manage-book-page {
    background-color: #fbf9f6;
    min-height: 100vh;
}

.manage-book-page .dashboard-header {
    background-color: #302419;
    color: #fff;
    padding: 60px 0 40px;
    margin-bottom: 40px;
}

.manage-book-page .dashboard-header h1 {
    font-family: Georgia, serif;
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

.manage-book-page .dashboard-header .subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    font-family: system-ui, sans-serif;
}

.header-with-back {
    margin-bottom: 20px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 15px;
    transition: color 0.2s;
}

.btn-back:hover {
    color: #fff;
}

/* Status Manager */
.status-manager {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 50px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-manager select {
    background: transparent;
    border: none;
    color: #fff;
    font-family: system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

.status-manager select option {
    background: #302419;
    color: #fff;
}

/* Chapters Section */
.chapters-section {
    padding-bottom: 80px;
}

.chapters-section .dashboard-story-card {
    display: flex;
    align-items: center;
    padding: 20px 30px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}

.chapters-section .dashboard-story-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
}

.chapter-order {
    font-family: Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    color: #e4dfd5;
    margin-right: 25px;
    min-width: 30px;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 10px;
}

.status-badge.draft {
    background: #f0f0f0;
    color: #7a736d;
}

.status-badge.published {
    background: #e6f4ea;
    color: #1e8e3e;
}

.status-badge.finished {
    background: #e8f0fe;
    color: #1967d2;
}

/* Hide page dividers in reading mode */
.chapter-body-text .page-divider {
    display: none !important;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Media Queries)
   ========================================================================== */

/* Mobile Menu Base Styles */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #302419;
    cursor: pointer;
    padding: 8px;
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(48, 36, 25, 0.95);
    z-index: 3000;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), visibility 0.4s;
    backdrop-filter: blur(10px);
    visibility: hidden;
    pointer-events: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav-overlay.active {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

.mobile-nav-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
}

.mobile-nav-header .logo-inkwell {
    color: #fff;
}

.close-mobile-menu {
    background: none;
    border: none;
    color: #fff;
    font-size: 30px;
}

.mobile-nav-links {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 50px;
}

.mobile-nav-links a {
    color: #fff;
    text-decoration: none;
    font-size: 24px;
    font-family: Georgia, serif;
    font-weight: 700;
}

.mobile-user-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: auto;
}

.mobile-signin,
.mobile-username {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
}

.mobile-btn-start {
    background: #D48C11;
    color: #fff;
    padding: 18px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
}

/* Tablet & Mobile Media Queries */
@media (max-width: 1024px) {
    .header-container {
        padding: 0 20px;
    }

    .nav-links {
        gap: 20px;
    }

    .first .top {
        width: 90%;
    }

    .first .top h1 {
        font-size: 50px;
    }

    .first .mid {
        width: 80%;
    }

    .fourth h1 {
        font-size: 50px;
    }

    .fourth .saying {
        width: 80%;
    }
}

@media (max-width: 768px) {

    /* Header */
    .header-center {
        display: none;
    }

    .header-right .user-actions {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    /* Hero Sections */
    .first .top h1 {
        font-size: 40px;
    }

    .first .mid p {
        font-size: 16px;
    }

    .first .statstics {
        width: 100%;
        padding: 0 20px;
    }

    .fourth h1 {
        font-size: 40px;
    }

    .fourth .saying {
        font-size: 16px;
    }

    /* Grids */
    .trending-grid {
        grid-template-columns: 1fr;
    }

    .second .listed {
        margin: 20px;
    }

    .third .book-listed .book {
        flex: 1 1 100%;
    }

    /* Footer */
    footer .upper {
        flex-direction: column;
        margin: 0 20px;
        padding-bottom: 40px;
    }

    footer .upper div {
        margin-right: 0;
        margin-bottom: 30px;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    footer .upper div .socials {
        margin: 20px auto;
        width: 100%;
        max-width: 200px;
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 20px;
        padding: 0;
        list-style: none;
    }

    footer .lower {
        text-align: center;
        padding: 20px;
    }

    /* Search Bar */
    .search-bar {
        padding: 15px 20px;
    }

    /* Editors & Readers */
    .formcont,
    .discover-container {
        padding: 0 15px;
    }

    .Poem .titlee,
    .Poem .cn,
    .poem-editor,
    .Story .editor-content,
    .Story .titlee,
    .Story .cn {
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .Story .editor-content {
        padding: 40px 20px !important;
    }

    /* Screenplay Formatting */
    .script-character {
        margin-left: 10%;
    }

    .script-dialogue {
        margin-left: 5%;
        margin-right: 5%;
    }

    .script-parenthetical {
        margin-left: 10%;
    }
}

@media (max-width: 480px) {

    .first .top h1,
    .fourth h1 {
        font-size: 32px;
    }

    .statstics {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
        width: 100%;
    }

    .discover-hero h1 {
        font-size: 48px;
    }

    .btn-start-writing {
        padding: 10px 20px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .dashboard-header h1 {
        font-size: 28px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px 0 40px;
    }

    .stat-card {
        padding: 20px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .dashboard-story-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 20px;
    }

    .story-image {
        width: 100%;
        height: 160px;
    }

    .story-meta,
    .story-stats {
        flex-wrap: wrap;
        gap: 10px;
    }

    .story-actions {
        width: 100%;
        justify-content: flex-start;
        padding-top: 15px;
        border-top: 1px solid #eee;
    }

    .btn-primary {
        padding: 8px 16px;
        font-size: 13px;
        width: 100%;
        justify-content: center;
    }

    .empty-state {
        padding: 40px 20px;
    }

    .empty-state i {
        font-size: 40px;
    }

    .my-poems-section,
    .my-scripts-section {
        margin-top: 30px !important;
    }

    .section-header h2 {
        font-size: 22px;
    }
}

/* ==========================================================================
   PROFILE & AUTHORS STYLES
   ========================================================================== */

.dashboard-profile-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    transition: 0.3s;
}

.dashboard-profile-link:hover {
    opacity: 0.8;
}

/* Profile Pic Utilities */
.profile-pic-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Form Styling Enhancements */
.premium-form .form-group {
    margin-bottom: 20px;
}

.premium-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #302419;
}

.premium-form .form-input,
.premium-form .form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e4dfd5;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fff;
}

.premium-form .form-input:focus,
.premium-form .form-textarea:focus {
    outline: none;
    border-color: #D48C11;
    box-shadow: 0 0 0 4px rgba(212, 140, 17, 0.1);
}

/* Authors Grid Responsive Fixes */
@media (max-width: 600px) {
    .authors-grid {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 20px;
    }

    .authors-grid .author-card {
        width: 100%;
        max-width: 320px;
    }

    .profile-header-premium {
        padding: 40px 0;
    }

    .profile-info-card {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
}

/* Script Card Styles */
.horizontal-script-card {
    display: flex;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    cursor: pointer;
    min-height: 220px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.card-visual {
    flex: 0 0 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 40px;
    position: relative;
    background-size: cover;
    background-position: center;
}

.card-details {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    background: #fafafa;
}


/* Story Editor Specifics */
.Story .editor-content p,
.Story .editor-content div {
    margin-bottom: 24px;
    /* Aligned with .chapter-body-text */
}

/* Script Editor Specifics */
.Script .editor-content {
    font-family: 'Courier New', Courier, monospace;
    /* Fallback since font import (2) skipped */
    font-size: 16px;
    line-height: 1.2;
    color: #000;
}

.Script .editor-content div,
.Script .editor-content p {
    margin-bottom: 0.8em;
}




@media (min-width: 768px) {
    .writeing-section .formcont {
        padding: 0 40px;
    }
}


/* --- Unified Feed (For You / Trending) --- */

.feed-page {
    min-height: 60vh;
}

.feed-hero {
    padding: 58px 20px 34px;
    background:
        radial-gradient(900px 420px at 15% 20%, rgba(212, 140, 17, 0.18), transparent 60%),
        radial-gradient(900px 420px at 85% 10%, rgba(59, 130, 246, 0.12), transparent 55%),
        linear-gradient(180deg, #fff, var(--bg-main));
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.feed-hero-inner {
    max-width: var(--container-max);
    margin: 0 auto;
}

.feed-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 10px 30px rgba(48, 36, 25, 0.06);
    font-weight: 800;
    color: var(--ink-1);
}

.feed-hero-title {
    margin: 16px 0 8px;
    font-family: var(--font-display);
    font-size: 44px;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--ink-1);
}

.feed-hero-subtitle {
    margin: 0;
    max-width: 62ch;
    color: var(--ink-2);
    font-size: 16px;
}

.feed-filters {
    margin-top: 22px;
}

.feed-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 10px 32px rgba(48, 36, 25, 0.05);
}

.feed-filter {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
    flex: 1 1 160px;
}

.feed-filter span {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: rgba(43, 39, 35, 0.85);
    text-transform: uppercase;
}

.feed-filter select {
    appearance: none;
    padding: 12px 12px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    font-weight: 700;
    color: var(--ink-1);
    outline: none;
}

.feed-filter select:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 2px;
}

.feed-apply-btn {
    border: none;
    border-radius: 14px;
    padding: 12px 14px;
    background: #111;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 0 0 auto;
    min-width: 140px;
}

.feed-apply-btn:hover {
    background: #1b1b1b;
}

.feed-section {
    padding: 36px 20px 60px;
}

.feed-container {
    max-width: var(--container-max);
    margin: 0 auto;
}

.feed-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

@media (max-width: 1050px) {
    .feed-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .feed-hero-title {
        font-size: 34px;
    }

    .feed-grid {
        grid-template-columns: 1fr;
    }
}

.c-card {
    background: var(--surface-1);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 30px rgba(48, 36, 25, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.c-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 45px rgba(48, 36, 25, 0.1);
    border-color: rgba(0, 0, 0, 0.1);
}

.c-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.c-media {
    position: relative;
    height: 170px;
    background: var(--surface-2);
    overflow: hidden;
}

.c-media-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
}

.c-media-fallback {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.c-media-grad {
    position: absolute;
    inset: 0;
    opacity: 0.95;
}

.grad-book {
    background: radial-gradient(700px 260px at 20% 10%, rgba(212, 140, 17, 0.6), transparent 55%),
        linear-gradient(135deg, rgba(17, 17, 17, 0.22), rgba(212, 140, 17, 0.25));
}

.grad-script {
    background: radial-gradient(700px 260px at 70% 20%, rgba(239, 68, 68, 0.55), transparent 55%),
        linear-gradient(135deg, rgba(17, 17, 17, 0.18), rgba(239, 68, 68, 0.22));
}

.grad-poem {
    background: radial-gradient(700px 260px at 35% 10%, rgba(99, 102, 241, 0.5), transparent 55%),
        linear-gradient(135deg, rgba(17, 17, 17, 0.18), rgba(99, 102, 241, 0.22));
}

.c-media-icon {
    position: relative;
    z-index: 2;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.1);
    color: rgba(43, 39, 35, 0.9);
    font-size: 22px;
}

.c-badges {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 12px;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.c-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.c-pill-solid {
    background: rgba(17, 17, 17, 0.85);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.c-pill-ghost {
    background: rgba(255, 255, 255, 0.86);
    color: var(--ink-1);
    border: 1px solid rgba(0, 0, 0, 0.07);
    backdrop-filter: blur(10px);
}

.c-body {
    padding: 16px 16px 14px;
}

.c-title {
    margin: 0 0 6px;
    font-family: var(--font-display);
    font-size: 18px;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.c-meta {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--ink-2);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.c-dot {
    opacity: 0.55;
}

.c-snippet {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(43, 39, 35, 0.88);
}

.c-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: var(--ink-2);
}

.c-stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.c-actions {
    padding: 12px;
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(180deg, #fff, #fbfaf8);
}

.c-action {
    flex: 1 1 0;
    border: 1px solid rgba(0, 0, 0, 0.07);
    background: rgba(0, 0, 0, 0.03);
    border-radius: 14px;
    padding: 10px 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 900;
    color: var(--ink-1);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.08s ease;
}

.c-action:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.12);
}

.c-action:active {
    transform: scale(0.98);
}

.c-action:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 2px;
}

.feed-more-wrap {
    display: flex;
    justify-content: center;
    padding: 26px 0 10px;
}

.feed-more-btn {
    border: none;
    border-radius: 999px;
    padding: 12px 22px;
    background: #111;
    color: #fff;
    font-weight: 900;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 14px 40px rgba(17, 17, 17, 0.18);
}

.feed-more-btn:hover {
    background: #1b1b1b;
}

.feed-more-btn:disabled,
.feed-more-btn[aria-disabled="true"] {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.feed-end {
    text-align: center;
    padding: 18px 0 0;
    color: var(--text-muted);
    font-style: italic;
}

.feed-empty {
    margin: 44px auto 0;
    max-width: 520px;
    text-align: center;
    padding: 34px 22px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 18px 50px rgba(48, 36, 25, 0.08);
}

.feed-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: rgba(17, 17, 17, 0.7);
    font-size: 22px;
}

.feed-empty h2 {
    font-family: var(--font-display);
    margin: 0 0 8px;
}

.feed-empty p {
    margin: 0 0 18px;
    color: var(--ink-2);
}

.feed-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 999px;
    text-decoration: none;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 14px 35px rgba(212, 140, 17, 0.25);
}

.feed-empty-cta:hover {
    background: var(--primary-hover);
}

/* --- Mobile Centering for Contact Page --- */
@media (max-width: 768px) {
    .static-container {
        padding: 0 20px;
    }

    .contact-info-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        width: 100%;
    }

    .static-text-box {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 40px 20px;
        width: 100%;
        margin: 0 auto;
    }

    .contact-item {
        width: 100%;
        max-width: 100%;
        justify-content: flex-start;
        /* Better for text alignment if centered within parent */
        text-align: left;
        margin: 20px auto 0;
        display: flex;
        align-items: center;
    }

    .contact-form-premium {
        width: 100%;
        text-align: left;
    }

    .static-header h1 {
        font-size: 42px;
    }
}
/* ==========================================================================
   ATMOSPHERIC WEATHER STYLES
   ========================================================================== */

#atmospheric-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    transition: background 2s ease;
}

.sun-rays {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 20%, rgba(212, 140, 17, 0.1) 0%, transparent 50%);
    opacity: var(--sun-opacity, 0);
    transition: opacity 2s ease;
    animation: atmosphere-rotate 120s linear infinite;
}

@keyframes atmosphere-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.mist-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(251, 249, 246, 0) 0%, rgba(122, 115, 109, 0.08) 100%);
    opacity: var(--mist-opacity, 1);
    transition: opacity 3s ease;
}

.stars-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(1.5px 1.5px at 10% 20%, rgba(212, 140, 17, 0.3), transparent),
                      radial-gradient(1px 1px at 50% 50%, rgba(48, 36, 25, 0.2), transparent),
                      radial-gradient(2px 2px at 80% 30%, rgba(212, 140, 17, 0.2), transparent);
    background-size: 300px 300px;
    opacity: var(--stars-opacity, 0);
    transition: opacity 5s ease;
}

.writeing-section {
    position: relative;
    z-index: 5;
}

.editor-content {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(48, 36, 25, 0.05) !important;
    transition: all 1s ease;
}

.zen-glow-active .editor-content {
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 0 60px rgba(212, 140, 17, 0.1) !important;
}


/* Remove the white box from editor */
.editor-content {
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
}

.zen-glow-active .editor-content {
    background: rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 0 100px rgba(212, 140, 17, 0.05) !important;
}


/* Smart Reveal Header */
.headeded {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease, backdrop-filter 0.3s ease;
}

.headeded.hidden-nav {
    transform: translateY(-100%);
}

.headeded.scrolled {
    background-color: rgba(251, 249, 246, 0.8) !important;
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}


/* Total Smart Reveal (Toolbar) */
.desktop-customize, .mobile-toolbar-toggle {
    position: sticky;
    top: 60px; /* Header height approximation */
    z-index: 999;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.hidden-nav {
    transform: translateY(-100%);
}

/* Ensure the header and toolbar hide together */
.headeded.hidden-nav, .desktop-customize.hidden-nav, .mobile-toolbar-toggle.hidden-nav {
    transform: translateY(-150%); /* Hide them further up */
    opacity: 0;
}


/* Force Smart Reveal visibility */
.headeded, .desktop-customize, .mobile-toolbar-toggle {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
}

.hidden-nav {
    transform: translateY(-120%) !important;
    opacity: 0 !important;
    pointer-events: none;
}

