:root {
    --primary: #6a017f;
    /* Purple - Community */
    --secondary: #f19908;
    /* Orange - Action */
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 15px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Layout Grid */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    /* Sidebar - Content */
    gap: 30px;
    padding-top: 30px;
    padding-bottom: 50px;
}

/* Critical: Prevent grid item from expanding beyond its column width */
.content-area {
    min-width: 0;
    /* Allows grid item to shrink properly and prevents overflow */
    overflow-x: hidden;
    /* Prevents horizontal scroll if content tries to expand */
}

/* Nav */
.main-nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 70px;
    display: flex;
    align-items: center;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 40px;
    flex: 1;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 24px;
    color: var(--primary);
    letter-spacing: -1px;
}

.logo .highlight {
    color: var(--secondary);
}

.search-bar {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: #f1f5f9;
    font-family: var(--font-body);
    transition: all 0.2s;
}

.search-bar input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(106, 1, 127, 0.1);
    outline: none;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-item {
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: color 0.2s;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary);
}

.user-profile {
    cursor: pointer;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.xp-badge {
    background: linear-gradient(135deg, var(--primary), #8e24aa);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: var(--shadow-sm);
}

.cart-btn {
    position: relative;
    color: var(--text-main);
    font-size: 18px;
}

.cart-btn .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--secondary);
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Sidebar */
.sidebar .sidebar-section {
    margin-bottom: 30px;
}

.sidebar h3 {
    font-family: var(--font-heading);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.sidebar ul li {
    margin-bottom: 12px;
}

.sidebar ul li a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background: #ede9fe;
    /* Light purple tint */
    color: var(--primary);
}

.sidebar i {
    width: 20px;
    text-align: center;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.c-purple {
    background: var(--primary);
}

.c-orange {
    background: var(--secondary);
}

.add-community {
    color: var(--secondary) !important;
    font-size: 13px;
}

.gamification-card {
    background: linear-gradient(145deg, #2a0b36, #4a145e);
    color: white;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
}

.gamification-card h4 {
    margin-bottom: 10px;
    font-size: 14px;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.2);
    height: 6px;
    border-radius: 3px;
    margin-bottom: 8px;
    overflow: hidden;
}

.progress-bar .fill {
    background: var(--secondary);
    height: 100%;
}

.rank {
    font-weight: 700;
    font-family: var(--font-heading);
    margin-bottom: 4px;
}

.next-rank {
    font-size: 11px;
    opacity: 0.8;
}

/* Components */
.book-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.book-cover {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    background: #f1f5f9;
}

.book-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.book-meta {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.book-price {
    font-weight: 700;
    color: var(--text-main);
    font-size: 18px;
}

.community-tag {
    font-size: 11px;
    color: var(--primary);
    background: #f3e8f4;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.btn-buy {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-buy:hover {
    opacity: 0.9;
}

.btn-group-add {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-group-add:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Home Grid */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-main);
}

.view-all {
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    /* Hide sidebar for mobile demo for now */
    .nav-left .logo,
    .nav-left .search-bar {
        display: block;
    }

    /* Simplify */
}

.book-card-link {
    display: block;
    height: 100%;
}


/* Toast Notification Styles */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: white;
    border-left: 4px solid var(--primary);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    min-width: 300px;
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    font-size: 20px;
    color: var(--primary);
}

.toast-content h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.toast-content p {
    font-size: 12px;
    color: #64748b;
}

.toast-xp {
    margin-left: auto;
    background: #fdf4ff;
    color: var(--primary);
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
}


/* Modal Overlay */
.flys-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flys-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Content */
.flys-modal {
    background: white;
    width: 400px;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    text-align: center;
}

.flys-modal-overlay.active .flys-modal {
    transform: translateY(0);
}

.modal-icon-success {
    width: 60px;
    height: 60px;
    background: #dcfce7;
    color: #15803d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin: 0 auto 20px auto;
}

.modal-title {
    font-family: 'Outfit';
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #1e293b;
}

.modal-desc {
    color: #64748b;
    margin-bottom: 25px;
}

.modal-book-preview {
    display: flex;
    gap: 15px;
    text-align: left;
    background: #f8fafc;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 25px;
    align-items: center;
}

.modal-book-preview img {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
}

.modal-book-preview h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
}

.modal-book-preview p {
    margin: 0;
    font-size: 13px;
    color: #f19908;
    font-weight: 700;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-modal-checkout {
    background: #f19908;
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s;
    display: block;
}

.btn-modal-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(241, 153, 8, 0.4);
}

.btn-modal-continue {
    background: white;
    color: #64748b;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    cursor: pointer;
}

.btn-modal-continue:hover {
    background: #f8fafc;
    color: #333;
}

.com-grid-profile {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.com-card-mini {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}

.com-card-mini:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.com-card-mini::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.com-card-mini.type-book::before {
    background: #f19908;
}

.com-card-mini.type-genre::before {
    background: #6a017f;
}

.com-card-mini.type-author::before {
    background: #e11d48;
}

.ccm-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 11px;
    color: #64748b;
}

.badge-role {
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    color: #334155;
}

.com-card-mini h4 {
    margin: 0 0 20px 0;
    font-family: 'Outfit';
    font-size: 1.1rem;
    line-height: 1.3;
}

.btn-goto {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px;
    background: #f8fafc;
    color: #64748b;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-goto:hover {
    background: #6a017f;
    color: white;
}

/* --- Mobile Optimization & Bottom Nav --- */
.mobile-bottom-nav {
    position: fixed !important;
    /* CRITICAL: Never let this change */
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 70px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 9999 !important;
    /* Ensure it's always on top */
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.08);
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateZ(0);
    /* Hardware acceleration */
    -webkit-transform: translateZ(0);
}

/* Show only on mobile */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex !important;
    }
}

@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

.mb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    padding: 8px;
    border-radius: 8px;
    transition: color 0.2s;
    text-decoration: none;
}

.mb-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.mb-item.active,
.mb-item:active {
    color: var(--primary);
}

/* Floating Action Button (FAB) for Cart */
.mb-fab-container {
    position: relative;
    top: -25px;
}

.mb-fab {
    width: 55px;
    height: 55px;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    box-shadow: 0 8px 20px rgba(241, 153, 8, 0.4);
    border: 4px solid var(--bg-body);
    /* Creates 'hole' effect */
    position: relative;
}

.mb-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--primary);
    color: white;
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid white;
}

/* Mobile Media Queries */
@media (min-width: 769px) {}

@media (max-width: 768px) {

    /* Layout Adjustments */
    .container {
        padding: 0 15px;
    }

    /* Hide Desktop Nav Elements */

    /* Header Adjustments */
    .main-nav {
        height: 60px;
    }

    .nav-left {
        width: 100%;
        justify-content: space-between;
        gap: 15px;
    }

    .search-bar {
        max-width: none;
        flex: 1;
    }

    .search-bar input {
        padding-top: 8px;
        padding-bottom: 8px;
        font-size: 14px;
    }

    /* Layout Stacking */
    .main-layout {
        display: block;
        /* Stack sidebar/content */
        padding-top: 15px;
    }

    .profile-layout-adv,
    .checkout-grid,
    .product-layout,
    .ad-layout,
    .cart-layout {}

    /* Profile Tweaks */
    .profile-container {
        grid-template-columns: 1fr;
    }

    .xp-bar-lg {
        width: 100%;
    }

    /* Product Page Tweaks */
    .product-layout {
        display: flex;
        flex-direction: column;
    }

    .main-cover {
        max-width: 200px;
        margin: 0 auto 20px auto;
        display: block;
    }

    .p-title {
        font-size: 2rem;
    }

    /* Admin Table Scroll */
    .ad-panel {
        overflow-x: auto;
    }

    .ad-table {
        min-width: 600px;
    }

    /* Font Sizes */
}


/* --- Mobile Header & Page Specific Adjustments --- */

@media (max-width: 768px) {

    /* 1. Header Transformation */
    .nav-container {
        flex-direction: column;
        gap: 10px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .nav-left {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .logo {
        margin: 0;
        font-size: 28px;
    }

    .search-bar {
        width: 100%;
        max-width: 100%;
    }

    .search-bar input {
        height: 40px;
        padding-top: 0;
        padding-bottom: 0;
    }

    /* 2. Profile Page Mobile */
    .profile-container {
        grid-template-columns: 1fr;
        padding-bottom: 90px;
    }

    .p-sidebar {
        margin-bottom: 20px;
    }

    .p-menu {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        padding: 10px;
        gap: 10px;
        white-space: nowrap;
        background: white;
        border-bottom: 1px solid #e2e8f0;
    }

    .menu-item {
        flex: 0 0 auto;
        padding: 8px 15px;
        background: #f1f5f9;
        border-radius: 20px;
    }

    .menu-item.active {
        background: var(--primary);
        color: white;
    }

    /* 3. Community View Mobile */
    .com-layout {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column-reverse;
        /* Sidebar (Info) below Feed, usually better or put sidebar content in header/modal */
    }

    /* Move sidebar below content for mobile flow, but 'Widget' like rules should be visible. 
       Actually, let's keep normal flow but 1 column. */
    .com-layout {
        flex-direction: column;
    }

    .com-sidebar {
        order: -1;
        /* Show Rules/Info FIRST on mobile? Or User prefers Feed first? 
                      Let's put Sidebar last or collapsible.
                      Order 2 puts it at bottom. */
        order: 2;
    }

    .com-view-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .com-view-content {
        margin-bottom: 20px;
    }

    .linked-book-card {
        width: 100%;
    }

    .com-meta {
        justify-content: center;
        flex-wrap: wrap;
    }

    /* 4. Checkout Mobile */
    .checkout-grid {
        grid-template-columns: 1fr;
    }

    .order-summary-card {
        order: -1;
        /* Show total first */
        margin-bottom: 20px;
    }
}


/* --- Avatar Size Control (Universal Fix) --- */
.avatar,
.avatar-sm,
.mh-avatar,
.podium-avatar img,
.avatar-list,
.avatar-mini {
    border-radius: 50%;
    flex-shrink: 0;
    /* Prevent shrinking in flex containers */
}

/* Specific Sizes Enforced */
.avatar-sm {
    min-width: 40px;
}

.mh-avatar {}

.avatar-mini {}

/* Feed specific protection */
.post-header img {}


/* --- SKOOL FEED STYLE --- */

.skool-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: border-color 0.2s;
    text-align: left;
}

.skool-card:hover {
    break: border-color #cbd5e1;
}

/* Header Area */
.sk-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.sk-avatar-container {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.sk-avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e2e8f0;
}

.sk-level-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #3b82f6;
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.sk-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.sk-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1.2;
}

.sk-username {
    font-weight: 700;
    color: #1e293b;
    font-size: 15px;
}

.sk-sub-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.sk-dot {
    font-size: 8px;
    color: #cbd5e1;
}

.sk-pinned {
    font-size: 11px;
    color: #64748b;
    opacity: 0.8;
}

.sk-category {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #64748b;
}

/* Content Area */
.sk-content {
    margin-bottom: 15px;
}

.sk-title {
    font-weight: 700;
    font-size: 16px;
    color: #0f172a;
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.sk-body {
    font-size: 15px;
    color: #334155;
    margin: 0;
    line-height: 1.5;
    /* Optional: Clamp lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer Actions */
.sk-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 15px;
}

.sk-actions-left {
    display: flex;
    gap: 15px;
}

.sk-act-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 0;
}

.sk-act-btn:hover {
    color: #6a017f;
}

.sk-new-comment {
    font-size: 12px;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.sk-new-comment:hover {
    text-decoration: underline;
}



/* --- Composer Multi-Type Styles --- */
.post-type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
}

.pt-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s;
}

.pt-btn.active {
    border-color: #6a017f;
    background: #fdf4ff;
    color: #6a017f;
}

.pt-btn:hover {
    border-color: #cbd5e1;
}

.post-form {
    display: none;
}

.post-form.active {
    display: block;
}

.post-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.upload-btn {
    width: 100%;
    padding: 12px;
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    color: #64748b;
    font-weight: 600;
}

.upload-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.rating-selector,
.emotion-selector {
    margin: 15px 0;
}

.rating-selector label,
.emotion-selector label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.stars {
    display: flex;
    gap: 5px;
}

.stars i {
    font-size: 24px;
    cursor: pointer;
    color: #cbd5e1;
    transition: color 0.2s;
}

.stars i:hover,
.stars i.active {
    color: #f19908;
}

.book-results {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin: 10px 0;
}

.book-result-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.book-result-item:hover {
    background: #f8fafc;
}

.book-result-item img {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.book-result-item .info {
    flex: 1;
}

.book-result-item .title {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.book-result-item .author {
    font-size: 11px;
    color: #94a3b8;
}

/* Image Preview */
#imagePreview img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 10px;
}

/* Repost Card */
.repost-indicator {
    background: #f8fafc;
    border-left: 3px solid #6a017f;
    padding: 8px 12px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #64748b;
}

.repost-indicator i {
    margin-right: 5px;
    color: #6a017f;
}

.original-post {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    margin-top: 10px;
    background: #fafbfc;
}

/* Review Card Styles */
.review-card {
    background: linear-gradient(135deg, #fdf4ff 0%, #fae8ff 100%);
    padding: 15px;
    border-radius: 12px;
    margin-top: 10px;
}

.review-rating {
    display: flex;
    gap: 3px;
    margin-bottom: 8px;
}

.review-rating i {
    color: #f19908;
    font-size: 16px;
}

.review-emotion {
    display: inline-block;
    background: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    margin-bottom: 10px;
}

.review-book {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: white;
    border-radius: 8px;
}

.review-book img {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
}


/* Reviews Grid Styles */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.review-card-grid {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s;
    display: flex;
    gap: 15px;
    padding: 15px;
}

.review-card-grid:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.review-book-cover {
    width: 80px;
    min-width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
}

.review-content-grid {
    flex: 1;
}

.review-book-title {
    font-weight: 700;
    color: #050505;
    text-decoration: none;
    display: block;
    margin: 8px 0;
    font-size: 14px;
}

.review-book-title:hover {
    color: #6a017f;
}

.review-emotion-small {
    background: #fdf4ff;
    color: #6a017f;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    display: inline-block;
    margin: 5px 0;
}

.review-excerpt {
    margin: 10px 0;
    font-size: 13px;
    color: #333;
    line-height: 1.5;
}

.review-date {
    color: #94a3b8;
    font-size: 11px;
}


/* COMPOSER AND MODALS - CRITICAL STYLES */
.composer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.composer-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    padding: 0;
    max-height: 90vh;
    overflow-y: auto;
}

.c-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.c-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.c-header button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
}

.c-header button:hover {
    color: #64748b;
}

.c-body {
    padding: 20px;
}

.c-footer {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
}

.c-tools {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.tool-btn {
    background: #f1f5f9;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #64748b;
    font-size: 14px;
}

.tool-btn:hover {
    background: #e2e8f0;
    color: #6a017f;
}

.btn-post {
    width: 100%;
    background: #6a017f;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 15px;
}

.btn-post:hover {
    background: #5a0169;
}

.post-area {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
}

.post-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
}

.post-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-bottom: 10px;
}

.upload-btn {
    width: 100%;
    padding: 12px;
    background: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    color: #64748b;
    font-weight: 600;
}

.upload-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.rating-selector,
.emotion-selector {
    margin: 15px 0;
}

.rating-selector label,
.emotion-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.book-results {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin: 10px 0;
}

.book-result-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
}

.book-result-item:hover {
    background: #f8fafc;
}

.book-result-item .info {
    flex: 1;
}

.book-result-item .title {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 3px;
}

.book-result-item .author {
    font-size: 11px;
    color: #94a3b8;
}

/* Desktop Search Results Dropdown */
.desktop-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 10000;
    margin-top: 5px;
}

.search-result-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: inherit;
    align-items: center;
    transition: background 0.1s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f8fafc;
}