/**
 * HappyLives PHP 8.5 V2 - Noir Editorial Design System
 * Dark Night Slate-Purple with Warm Paper Reading Room & Champagne Highlights
 */

:root {
    --color-brand: #17151A;             /* Dark Night Slate-Purple */
    --color-surface-dark: #29242B;      /* Deep Muted Purple Surface */
    --color-surface-card: #201C22;      /* Elevated Dark Card Surface */
    --color-surface-subtle: #332C37;    /* Subtle Dark Highlight */
    --color-accent-rose: #B77F88;       /* Muted Rose Accent */
    --color-accent-champagne: #B89570;  /* Champagne Gold Accent */
    --color-reading-paper: #D8CBC3;     /* Warm Paper Reading BG (#D8CBC3) */
    --color-text-dark: #30262B;         /* Deep Charcoal Text for Paper (#30262B) */
    --color-text-title: #241D22;        /* High Contrast Dark Title (#241D22) */
    --color-text-muted-paper: #62545A;  /* Secondary Meta Text (#62545A) */
    --color-link-paper: #80505D;        /* In-Article Link (#80505D) */
    --color-border-paper: #CBBAB0;      /* Reading Room Border & Dividers (#CBBAB0) */
    --color-text-light: #E8E2E6;        /* High Contrast Light Text */
    --color-text-muted: #B8AEB2;        /* Muted Rose-Gray Text */
    --color-border: #3B333E;            /* Dark Slate Border */
    --color-border-subtle: #2D2730;     /* Subtle Dark Border */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    --container-max: 1240px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Padauk", "DaunPenh", "Leelawadee UI", "Nirmala UI", "Jameel Noori Nastaleeq", "Urdu Typesetting", "Arabic Typesetting", "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-serif: Georgia, Cambria, "Times New Roman", Times, "Songti SC", serif;
}

/* Reset & Basic Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    background-color: var(--color-brand) !important;
    font-family: var(--font-sans);
    color: var(--color-text-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Outer Wrapper & Container */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

/* Top Utility Bar */
.top-bar {
    background-color: #110F13;
    color: var(--color-text-muted);
    font-size: 12px;
    border-bottom: 1px solid var(--color-border-subtle);
    padding: 6px 0;
}

.top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-bar-links {
    display: flex;
    gap: 15px;
}

.top-bar-links a {
    color: var(--color-text-muted);
}

.top-bar-links a:hover {
    color: var(--color-accent-champagne);
}

/* Top Utility Bar - Single Line Layout */
.site-topbar {
    background-color: #0b090e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6px 0;
    font-size: 12px;
    color: var(--color-text-muted);
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.site-topbar::-webkit-scrollbar {
    display: none;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap !important;
    width: 100%;
    height: 100%;
    gap: 12px;
}

.topbar-left-box {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    height: 32px;
    gap: 14px;
}

.topbar-brand-logo {
    display: flex !important;
    align-items: center !important;
    text-decoration: none;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.topbar-brand-logo .brand-logo-img {
    height: 26px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    display: block;
    flex-shrink: 0 !important;
}

/* Topbar Language Switcher Styles - Single Unified Dropdown */
.topbar-lang-box {
    display: inline-flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    gap: 6px;
    height: 28px;
}

.topbar-lang-box .lang-icon {
    font-size: 13px;
    opacity: 0.85;
}

.topbar-lang-select {
    background: rgba(0, 0, 0, 0.4);
    color: #f39c12;
    border: 1px solid rgba(243, 156, 18, 0.3);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.topbar-lang-select:hover,
.topbar-lang-select:focus {
    border-color: #f39c12;
    background: rgba(0, 0, 0, 0.6);
}

.topbar-lang-select option {
    background: #111;
    color: #fff;
    font-weight: normal;
}

.topbar-auth-box {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: nowrap !important;
    gap: 8px;
    height: 28px;
}

.topbar-input {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--color-text-light);
    border-radius: var(--radius-sm, 4px);
    padding: 0 10px;
    font-size: 12px;
    height: 28px;
    line-height: 26px;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
    box-sizing: border-box;
    margin: 0;
    flex-shrink: 0;
}

.topbar-input[type="email"] {
    width: 220px;
}

.topbar-input[type="password"] {
    width: 200px;
}

.topbar-input:focus {
    border-color: var(--color-accent-champagne);
    background-color: rgba(255, 255, 255, 0.08);
}

.topbar-btn {
    height: 28px;
    padding: 0 12px;
    border-radius: var(--radius-sm, 4px);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    box-sizing: border-box;
    margin: 0;
    line-height: 1;
    width: auto !important;
    min-width: auto;
}

.topbar-btn.login-btn {
    background-color: var(--color-accent-champagne);
    color: #121212;
}

.topbar-btn.login-btn:hover {
    background-color: #cbb28d;
}

.topbar-btn.register-link {
    background-color: transparent;
    border: 1px solid rgba(184, 149, 112, 0.4);
    color: var(--color-accent-champagne);
}

.topbar-btn.register-link:hover {
    background-color: rgba(184, 149, 112, 0.12);
    border-color: var(--color-accent-champagne);
}

/* Main Site Header */
.site-header {
    background-color: var(--color-surface-dark);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.site-header.menu-open {
    z-index: 1400 !important;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 52px;
}

.brand-logo {
    font-size: 22px;
    font-weight: 900;
    color: var(--color-text-light);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 36px;
    height: 36px;
    display: block;
    transition: transform 0.3s ease;
}

.brand-logo:hover .brand-icon {
    transform: rotate(15deg) scale(1.08);
}

.section-title-icon {
    color: var(--color-accent-champagne);
    margin-right: 6px;
    font-size: 16px;
}

/* Desktop Navigation with Dropdowns - Equal Width Distribution & Single Row */
.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    width: 100%;
    flex-wrap: nowrap !important;
}

.nav-item {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
    padding: 6px 8px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
}

.nav-link:hover, .nav-link.active {
    color: var(--color-accent-champagne);
    background-color: var(--color-surface-subtle);
}

.dropdown-caret {
    font-size: 11px;
    color: var(--color-text-muted);
    transition: transform 0.2s ease;
}

/* Hover Megamenu Dropdown */
.nav-item.has-dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-item.has-dropdown:hover .dropdown-caret {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 190px;
    background-color: var(--color-surface-dark);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
}

.dropdown-item {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--color-text-muted);
    font-weight: 500;
}

.dropdown-item:hover, .dropdown-item.active {
    background-color: var(--color-surface-subtle);
    color: var(--color-accent-champagne);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-text-light);
    padding: 4px;
}

/* Top Ad Container */
.ad-banner-top {
    margin-top: 15px;
}

.ad-container {
    background-color: var(--color-surface-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
    overflow: hidden;
}

/* Main Area Layout */
.site-main {
    flex: 1;
    padding: 24px 0 50px 0;
}

/* Hero Section Grid (60:40 Ratio with Flush Equal Height Alignment) */
.hero-section-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    margin-bottom: 35px;
    align-items: stretch;
}

.hero-main-col, .hero-side-col {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.lead-hero-card {
    background-color: var(--color-surface-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.lead-hero-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: var(--color-surface-dark);
    overflow: hidden;
}

.lead-hero-thumb-wrap > a {
    display: block;
    width: 100%;
    height: 100%;
}

.lead-hero-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    transition: transform 0.3s ease;
}

.category-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background-color: var(--color-accent-rose);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.lead-hero-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.lead-hero-title {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 12px;
    color: var(--color-text-light);
}

.lead-hero-summary {
    font-size: 15px;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Right Side Latest Feed Panel */
.widget-card-panel {
    background-color: var(--color-surface-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.hero-side-col .widget-card-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.widget-panel-header {
    border-bottom: 2px solid var(--color-accent-champagne);
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.widget-panel-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--color-accent-champagne);
}

.compact-feed-list {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    gap: 12px;
}

.compact-feed-item {
    border-bottom: 1px dashed var(--color-border-subtle);
    padding-bottom: 12px;
}

.compact-feed-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.feed-cat {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-accent-rose);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 3px;
}

.feed-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--color-text-light);
}

.feed-title a:hover {
    color: var(--color-accent-champagne);
}

.feed-time {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* Main Body Grid: Content + Sidebar */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
}

.full-width {
    grid-template-columns: 1fr;
}

/* Category Section Blocks (ALL Non-Hidden Categories) */
.category-sections-wrapper {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

.category-section-block {
    background-color: var(--color-surface-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

.category-visual-banner {
    width: 100%;
    max-height: 100px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid var(--color-border-subtle);
}

.category-banner-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.category-section-block:hover .category-banner-img {
    transform: scale(1.02);
}

.category-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--color-accent-rose);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.category-section-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--color-text-light);
}

.section-more-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-accent-champagne);
}

/* Rich Category Grid (>= 4 articles) */
.rich-category-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
}

.category-lead-card {
    display: flex;
    flex-direction: column;
}

.lead-thumb-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: var(--color-surface-dark);
    margin-bottom: 12px;
}

.lead-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.lead-card-title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--color-text-light);
}

.lead-card-desc {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sub-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.compact-card {
    border-bottom: 1px solid var(--color-border-subtle);
    padding-bottom: 10px;
}

.compact-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.compact-card-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--color-text-light);
}

.compact-card-title a:hover {
    color: var(--color-accent-champagne);
}

/* Medium Category Grid (2--3 articles) */
.medium-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.medium-card {
    background-color: var(--color-surface-dark);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--color-border-subtle);
}

.medium-card-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 6px;
    color: var(--color-text-light);
}

.medium-card-desc {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Single Article Category Card (1 article) */
.single-category-card {
    background-color: var(--color-surface-dark);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-subtle);
}

.single-card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--color-text-light);
}

/* Empty Category Block (0 articles) */
.empty-category-block {
    padding: 15px 0;
    text-align: left;
}

.empty-text {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.empty-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-accent-champagne);
}

/* Card Meta Bar */
.card-meta-bar {
    font-size: 12px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Category Banner & List Feed (A+C Hybrid Layout) */
.category-banner-card {
    background-color: var(--color-surface-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.breadcrumb-bar {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

.breadcrumb-bar a {
    color: var(--color-accent-champagne);
}

/* High Contrast Breadcrumbs for Reader Room Card (#D8CBC3 Paper Background) */
.reader-card .breadcrumb-bar {
    font-size: 13px;
    color: var(--color-text-muted-paper) !important;
    margin-bottom: 16px;
    font-weight: 500;
}

.reader-card .breadcrumb-bar a {
    color: var(--color-link-paper) !important;
    text-decoration: none;
    font-weight: 700;
}

.reader-card .breadcrumb-bar a:hover {
    color: #5A3641 !important;
    text-decoration: underline;
}

.reader-card .breadcrumb-bar span {
    color: var(--color-text-title) !important;
    font-weight: 700;
}

.category-banner-title {
    font-size: 28px;
    font-weight: 900;
    color: var(--color-text-light);
    margin-bottom: 6px;
}

.category-banner-desc {
    font-size: 14px;
    color: var(--color-text-muted);
}

.subcategory-pill-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--color-border);
}

.pill-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-muted);
}

.subcat-pill {
    background-color: var(--color-surface-dark);
    color: var(--color-text-light);
    font-size: 13px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid var(--color-border);
}

.subcat-pill:hover {
    background-color: var(--color-accent-rose);
    color: #ffffff;
    border-color: var(--color-accent-rose);
}

/* Category Hot Section in List Page */
.category-hot-panel {
    background-color: var(--color-surface-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 25px;
}

.category-hot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.category-hot-card {
    background-color: var(--color-surface-dark);
    border-radius: var(--radius-md);
    padding: 14px;
    border: 1px solid var(--color-border-subtle);
}

.hot-card-num {
    font-size: 12px;
    font-weight: 900;
    color: var(--color-accent-champagne);
    margin-bottom: 4px;
}

.hot-card-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--color-text-light);
}

.hot-card-title a:hover {
    color: var(--color-accent-champagne);
}

/* Feed Cards */
.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.feed-card {
    background-color: var(--color-surface-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feed-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.feed-thumb-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: var(--color-surface-dark);
    overflow: hidden;
}

.feed-thumb-wrap > a {
    display: block;
    width: 100%;
    height: 100%;
}

.feed-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.feed-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.feed-card-title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--color-text-light);
}

.feed-card-summary {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Pagination */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.page-info-text {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-right: 10px;
}

.page-btn {
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 600;
    background-color: var(--color-surface-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-light);
}

.page-btn-nav {
    font-weight: 700;
}

.page-btn:hover, .page-btn.active {
    background-color: var(--color-accent-champagne);
    color: #ffffff;
    border-color: var(--color-accent-champagne);
}

.page-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.page-ellipsis {
    padding: 0 4px;
    font-size: 14px;
    color: var(--color-text-muted);
    user-select: none;
}

/* Noir Warm Paper Reading Room (Novel/Article Detail Page - #D8CBC3) */
.reader-card {
    background-color: var(--color-reading-paper);
    color: var(--color-text-dark) !important;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-md);
}

.reader-header {
    border-bottom: 2px solid var(--color-border-paper);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.reader-title {
    font-size: 32px;
    font-weight: 900;
    line-height: 1.3;
    color: var(--color-text-title);
    margin-bottom: 16px;
    font-family: var(--font-serif);
    letter-spacing: -0.5px;
}

.reader-meta-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: var(--color-text-muted-paper);
}

.meta-item {
    color: var(--color-text-muted-paper);
}

.meta-tag {
    background-color: var(--color-border-paper);
    color: var(--color-text-title);
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
}

/* Reader Article Body (780px Optimal Width, 18px Font Size, 1.8 Line Height) */
.reader-body-content {
    max-width: 960px;
    margin: 0 auto;
    font-size: 18px;
    line-height: 1.8;
    color: var(--color-text-dark);
    font-family: var(--font-serif);
}

/* Neutralize legacy inline white background & light text styles inside raw article HTML */
.reader-body-content div,
.reader-body-content p,
.reader-body-content span,
.reader-body-content table,
.reader-body-content td,
.reader-body-content tr,
.reader-body-content li {
    background-color: transparent !important;
    background: transparent !important;
    color: var(--color-text-dark) !important;
}

/* In-Article Links (#80505D) & Child Elements inside Links */
.reader-body-content a,
.reader-body-content a span,
.reader-body-content a div,
.reader-body-content a strong,
.reader-body-content a em {
    color: var(--color-link-paper) !important;
    text-decoration: underline;
    font-weight: 600;
}

.reader-body-content a:hover,
.reader-body-content a:hover span,
.reader-body-content a:hover div,
.reader-body-content a:hover strong,
.reader-body-content a:hover em {
    color: #5A3641 !important;
}

/* Blockquotes & Dividers (#CBBAB0) */
.reader-body-content blockquote {
    border-left: 4px solid var(--color-link-paper);
    background-color: rgba(203, 186, 176, 0.35) !important;
    color: var(--color-text-muted-paper) !important;
    padding: 14px 20px;
    margin: 20px 0;
    border-radius: var(--radius-sm);
}

.reader-body-content hr {
    border: none;
    border-top: 1px solid var(--color-border-paper);
    margin: 30px 0;
}

.reader-body-content p {
    margin-bottom: 1.6rem;
}

.reader-body-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 24px 0;
    box-shadow: 0 4px 12px rgba(48, 38, 43, 0.15);
}

.reader-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border-paper);
}

.btn-secondary {
    display: inline-block;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 700;
    background-color: var(--color-border-paper);
    color: var(--color-text-title);
    border-radius: var(--radius-md);
}

.btn-secondary:hover {
    background-color: var(--color-surface-dark);
    color: var(--color-accent-champagne);
}

/* Empty State Card */
.empty-state-card {
    background-color: var(--color-surface-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 50px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-text-light);
    margin-bottom: 6px;
}

.empty-desc {
    font-size: 14px;
    color: var(--color-text-muted);
}

/* Footer Layout - Unified 234px x 60px Card Grid Refinement */
.site-footer {
    background-color: var(--color-surface-dark);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    padding: 35px 0 25px 0;
    margin-top: auto;
}

/* Row 1: Recommended Links (Prominent Card Grid Container) */
.footer-row-links {
    margin-bottom: 28px;
    padding: 22px 26px;
    background-color: var(--color-surface-card, #1c1822);
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.12));
    border-radius: var(--border-radius-md, 8px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.footer-links-header {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
}

.footer-links-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--color-accent-champagne, #d4af37) !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.2;
}

.title-accent-bar {
    display: inline-block;
    width: 4px;
    height: 18px;
    background-color: var(--color-accent-champagne, #d4af37);
    border-radius: 2px;
}

.site-footer ul.footer-recommended-list {
    list-style: none !important;
    list-style-type: none !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 14px !important;
    align-items: center !important;
    padding-left: 0 !important;
    margin: 0 !important;
}

.site-footer ul.footer-recommended-list li.footer-card-item {
    list-style: none !important;
    list-style-type: none !important;
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Unified 234px x 60px Outer Card Spec (Applies to both Text & Image Links) */
.footer-card-link {
    width: 234px !important;
    height: 60px !important;
    min-width: 234px !important;
    max-width: 234px !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
    background-color: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(212, 175, 55, 0.25) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    overflow: hidden !important;
    transition: all 0.2s ease !important;
}

.footer-card-link:hover {
    border-color: var(--color-accent-champagne, #d4af37) !important;
    background-color: rgba(212, 175, 55, 0.1) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.15) !important;
}

/* Text Card Inner Layout & 2-Line Truncation */
.footer-card-text {
    padding: 8px 14px !important;
    gap: 8px !important;
}

.footer-card-text .link-icon {
    font-size: 13px !important;
    color: var(--color-accent-champagne, #d4af37) !important;
    flex-shrink: 0 !important;
}

.footer-card-text .link-text-content {
    color: #e2e8f0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: break-word !important;
}

.footer-card-text:hover .link-text-content {
    color: var(--color-accent-champagne, #d4af37) !important;
}

/* Image Card Inner Image Fitting (No Crop, No Stretch) */
.footer-card-image {
    padding: 4px 8px !important;
}

.footer-card-img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border: none !important;
    background-color: transparent !important;
}

/* Mobile Responsiveness (< 520px) */
@media (max-width: 520px) {
    .footer-row-links {
        padding: 16px;
    }
    .footer-card-link {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }
}

/* Row 2: Site Intro (Secondary Lower Hierarchy) */
.footer-row-brand {
    margin-bottom: 18px;
    text-align: left;
    opacity: 0.85;
}

.footer-brand {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.02em;
}

.footer-desc {
    font-size: 12px;
    line-height: 1.5;
    color: var(--color-text-muted);
    margin: 0;
    max-width: 600px;
    opacity: 0.75;
}

/* Row 3: Copyright (Tertiary Low Contrast) */
.footer-row-copyright {
    border-top: 1px solid var(--color-border-subtle);
    padding-top: 16px;
    font-size: 12px;
    text-align: center;
    color: var(--color-text-muted);
    opacity: 0.6;
}

/* Mobile Drawer Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 15, 19, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1200;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.open {
    display: block;
    opacity: 1;
}

.mobile-nav-header {
    display: none;
}

/* -------------------------------------------------------------
   Phase 3: Auth UI Styles & Flash Messages
   ------------------------------------------------------------- */
.flash-messages {
    width: 100%;
    margin-bottom: 20px;
}

.flash-message {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    border-left: 4px solid;
}

.flash-error {
    background-color: rgba(220, 53, 69, 0.1);
    color: #ff6b6b;
    border-left-color: #dc3545;
}

.flash-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: #4ade80;
    border-left-color: #28a745;
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 250px);
    padding: 40px 20px;
}

.auth-card {
    background-color: var(--color-surface-card, #1c1822);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 440px;
    padding: 36px 28px;
}

.input-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.btn-toggle-pwd {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 6px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.btn-toggle-pwd:hover {
    opacity: 1;
    color: var(--color-accent-champagne);
}

.form-hint-text {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 6px;
    opacity: 0.75;
}

.field-error-msg {
    font-size: 12px;
    color: #ff6b6b;
    margin-top: 4px;
    display: block;
}

.auth-login-notice {
    background-color: rgba(46, 204, 113, 0.06);
    border: 1px solid rgba(46, 204, 113, 0.25);
    border-radius: var(--radius-md, 8px);
    padding: 12px 14px;
    margin-bottom: 20px;
    text-align: left;
}

.auth-login-notice .notice-text {
    font-size: 13px;
    color: var(--color-text-light, #f0eaf1);
    line-height: 1.55;
    margin: 0;
    word-break: break-word;
}

.auth-card-register {
    max-width: 540px;
}

.auth-info-blocks {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-info-item {
    padding: 12px 14px;
    border-radius: var(--radius-md, 8px);
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    background-color: rgba(255, 255, 255, 0.025);
}

.auth-info-item-free {
    border-color: rgba(46, 204, 113, 0.32);
    background-color: rgba(46, 204, 113, 0.07);
}

.auth-info-item-account {
    border-color: rgba(56, 189, 248, 0.32);
    background-color: rgba(56, 189, 248, 0.07);
}

.auth-info-item-vip {
    border-color: rgba(212, 175, 55, 0.32);
    background-color: rgba(212, 175, 55, 0.07);
}

.auth-info-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 4px 0;
    line-height: 1.4;
    color: var(--color-text-light, #f0eaf1);
}

.auth-info-item-free .auth-info-title {
    color: #4ade80;
}

.auth-info-item-account .auth-info-title {
    color: #38bdf8;
}

.auth-info-item-vip .auth-info-title {
    color: var(--color-accent-champagne, #d4af37);
}

.auth-info-desc {
    font-size: 13px;
    line-height: 1.55;
    color: var(--color-text-muted, #9a8d9a);
    margin: 0;
    word-break: break-word;
}

/* Historical Article Restricted Gate (Noir Dark Card inside Reader Room) */
.vip-archive-gate {
    max-width: 820px;
    margin: 10px auto 20px auto;
    padding: 32px 28px;
    background-color: var(--color-surface-card, #1c1822);
    color: var(--color-text-light, #f0eaf1);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 10px 30px rgba(17, 15, 19, 0.28);
    font-family: var(--font-sans, system-ui, -apple-system, sans-serif);
}

.vip-gate-header {
    text-align: center;
    margin-bottom: 24px;
}

.vip-gate-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--color-accent-champagne, #d4af37);
    background-color: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    margin-bottom: 12px;
}

.vip-gate-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--color-text-light, #f0eaf1);
    margin: 0 0 8px 0;
    line-height: 1.35;
}

.vip-gate-desc {
    font-size: 14px;
    color: var(--color-text-muted, #9a8d9a);
    margin: 0;
    line-height: 1.6;
}

.vip-gate-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}

.vip-gate-block {
    padding: 20px;
    border-radius: var(--radius-md, 8px);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vip-gate-block-primary {
    background-color: rgba(212, 175, 55, 0.07);
    border: 1px solid rgba(212, 175, 55, 0.32);
}

.vip-gate-block-free {
    background-color: rgba(46, 204, 113, 0.08);
    border: 1px solid rgba(46, 204, 113, 0.35);
}

.vip-gate-block-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
}

.vip-gate-block-primary .vip-gate-block-title {
    color: var(--color-accent-champagne, #d4af37);
}

.vip-gate-block-free .vip-gate-block-title {
    color: #4ade80;
}

.vip-gate-block-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-light, #f0eaf1);
    margin: 0;
    word-break: break-word;
}

.vip-gate-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 14px;
}

.vip-gate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 6px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.4;
    box-sizing: border-box;
    min-width: 210px;
}

.vip-gate-btn-primary {
    background-color: var(--color-accent-champagne, #d4af37) !important;
    color: #121212 !important;
    border: 1px solid var(--color-accent-champagne, #d4af37);
}

.vip-gate-btn-primary:hover {
    background-color: #e5c357 !important;
    color: #121212 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
}

.vip-gate-btn-secondary {
    background-color: rgba(46, 204, 113, 0.14) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(46, 204, 113, 0.45);
}

.vip-gate-btn-secondary:hover {
    background-color: rgba(46, 204, 113, 0.24) !important;
    color: #ffffff !important;
    border-color: #4ade80;
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .vip-archive-gate {
        padding: 22px 16px;
    }

    .vip-gate-title {
        font-size: 20px;
    }

    .vip-gate-sections {
        grid-template-columns: 1fr;
    }

    .vip-gate-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .vip-gate-btn {
        width: 100%;
        min-width: 0;
    }
}

.flex-center {
    justify-content: center !important;
}

.auth-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--color-text-light);
    margin: 0 0 8px 0;
    text-align: center;
    letter-spacing: 0.02em;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
    text-align: center;
    margin: 0 0 32px 0;
    opacity: 0.8;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 8px;
    opacity: 0.9;
}

.auth-form .required-star {
    color: var(--color-accent-champagne);
    margin-left: 2px;
}

.auth-form .form-control {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-light);
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.auth-form .form-control:focus {
    outline: none;
    border-color: var(--color-accent-champagne);
    background-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}

.auth-actions {
    margin-top: 32px;
    margin-bottom: 20px;
}

.auth-btn-submit {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 6px;
    background-color: var(--color-accent-champagne);
    color: #121212;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-btn-submit:hover {
    background-color: #e5c357;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.auth-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-top: 16px;
}

.auth-link {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: var(--color-accent-champagne);
}

/* Responsive Media Queries */
@media (max-width: 992px) {
    .hero-section-grid {
        grid-template-columns: 1fr;
    }

    .main-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }

    .site-header.menu-open {
        z-index: 1400 !important;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .site-nav {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background-color: var(--color-surface-dark);
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch;
        gap: 0;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        z-index: 1500 !important;
        transition: right 0.3s ease;
        overflow-y: auto;
    }

    .site-nav.open {
        right: 0;
    }

    .mobile-nav-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 15px;
        margin-bottom: 15px;
        border-bottom: 1px solid var(--color-border);
    }

    .mobile-nav-title {
        font-size: 16px;
        font-weight: 800;
        color: var(--color-text-light);
    }

    .mobile-nav-close {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: var(--color-text-muted);
    }

    .nav-link {
        padding: 12px 10px;
        border-bottom: 1px solid var(--color-border-subtle);
        border-radius: 0;
        justify-content: space-between;
    }

    .dropdown-menu {
        position: static;
        display: block;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background-color: var(--color-surface-card);
        margin: 4px 0 8px 10px;
        border-radius: var(--radius-sm);
    }

    .main-grid.full-width {
        min-width: 0;
        grid-template-columns: minmax(0, 1fr);
    }

    .category-sections-wrapper,
    .category-section-block {
        min-width: 0;
    }

    .rich-category-grid {
        min-width: 0;
        grid-template-columns: minmax(0, 1fr);
    }

    .compact-card-title a {
        overflow-wrap: anywhere;
    }

    .reader-card {
        padding: 20px;
    }

    .reader-title {
        font-size: 22px;
    }

    .reader-body-content {
        font-size: 16px;
    }

    /* Topbar Mobile Responsive Layout - Revision 05 (Clean Horizontal Rows) */
    .site-topbar {
        height: auto !important;
        padding: 6px 0;
        white-space: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
    }
    .topbar-inner {
        flex-wrap: wrap !important;
        height: auto !important;
        gap: 8px;
        justify-content: space-between;
    }
    .topbar-left-box {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        height: 28px;
        gap: 10px;
    }
    .topbar-brand-logo .brand-logo-img {
        max-width: 120px;
        height: 24px;
        flex-shrink: 0 !important;
    }
    .topbar-lang-box {
        display: inline-flex !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        gap: 3px;
    }
    .topbar-auth-box {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        height: auto !important;
        flex-shrink: 0 !important;
        gap: 6px;
    }
    .topbar-input[type="text"],
    .topbar-input[type="email"],
    .topbar-input[type="password"] {
        width: 130px; /* Mobile/Tablet input width */
    }
    .topbar-btn {
        padding: 0 8px;
        width: auto !important;
    }
    .nav-item {
        flex: none !important;
        width: 100% !important;
        min-width: auto !important;
    }
}

@media (max-width: 480px) {
    .topbar-left-box {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        gap: 6px;
    }
    .topbar-brand-logo .brand-logo-img {
        max-width: 90px;
        height: 20px;
        flex-shrink: 0 !important;
    }
    .topbar-lang-box {
        display: inline-flex !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
    .topbar-auth-box {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        gap: 4px;
    }
    .topbar-input[type="text"],
    .topbar-input[type="email"],
    .topbar-input[type="password"] {
        width: 100px; /* Narrow mobile width */
    }
    .topbar-inner {
        gap: 6px;
    }
    .topbar-auth-box {
        gap: 4px;
    }
}

/* Ensure Topbar stays single line even on very narrow screens */
@media (max-width: 375px) {
    .site-topbar {
        overflow-x: auto;
        white-space: nowrap;
    }
    .topbar-inner {
        min-width: 460px;
    }
}

/* Member Center & User Dashboard Dark Noir Styles */
.topbar-welcome {
    color: var(--color-text-light, #e0d8df);
    font-size: 12px;
    margin-right: 6px;
}
.topbar-logout-link {
    color: #e74c3c !important;
    border-color: rgba(231, 76, 60, 0.3) !important;
}
.topbar-logout-link:hover {
    background-color: rgba(231, 76, 60, 0.15) !important;
}

.member-container {
    max-width: 1100px;
    margin: 30px auto 50px;
    padding: 0 15px;
}

.member-header {
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 16px;
}

.member-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-light, #f0eaf1);
    margin: 0 0 6px;
}

.member-subtitle {
    font-size: 13px;
    color: var(--color-text-muted, #9a8d9a);
    margin: 0;
}

.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.member-card {
    background-color: #141118;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.member-card .card-header {
    padding: 16px 20px;
    background-color: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.member-card .card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-light, #f0eaf1);
    margin: 0;
}

.card-action-link {
    color: var(--color-accent-champagne, #d4af37);
    font-size: 13px;
    text-decoration: none;
    transition: opacity 0.2s;
}
.card-action-link:hover {
    opacity: 0.8;
}

.member-card .card-body {
    padding: 20px;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 13px;
    color: var(--color-text-muted, #9a8d9a);
}

.info-value {
    font-size: 13px;
    color: var(--color-text-light, #f0eaf1);
    font-weight: 500;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}
.badge-success {
    background-color: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}
.badge-warning {
    background-color: rgba(241, 196, 15, 0.15);
    color: #f1c40f;
    border: 1px solid rgba(241, 196, 15, 0.3);
}
.badge-danger {
    background-color: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}
.badge-info {
    background-color: rgba(52, 152, 219, 0.15);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.3);
}
.badge-secondary {
    background-color: rgba(149, 165, 166, 0.15);
    color: #95a5a6;
    border: 1px solid rgba(149, 165, 166, 0.3);
}

.text-danger { color: #e74c3c !important; }
.text-warning { color: #f1c40f !important; }
.text-muted { color: #9a8d9a !important; }

/* Quick Actions Grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.quick-action-item {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 16px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: all 0.2s ease;
}
.quick-action-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: var(--color-accent-champagne, #d4af37);
    transform: translateY(-2px);
}

.action-icon {
    font-size: 20px;
    margin-bottom: 8px;
}

.action-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-light, #f0eaf1);
    margin-bottom: 4px;
}

.action-desc {
    font-size: 12px;
    color: var(--color-text-muted, #9a8d9a);
}

.quick-action-logout:hover {
    border-color: #e74c3c;
}

/* Member Table */
.table-responsive {
    overflow-x: auto;
}

.member-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.member-table th {
    padding: 12px 14px;
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--color-text-muted, #9a8d9a);
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.member-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--color-text-light, #f0eaf1);
    vertical-align: middle;
}

.member-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

.btn-sm {
    display: inline-block;
    padding: 4px 10px;
    background-color: rgba(212, 175, 55, 0.15);
    color: var(--color-accent-champagne, #d4af37);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.2s;
}
.btn-sm:hover {
    background-color: var(--color-accent-champagne, #d4af37);
    color: #121212;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 30px 20px;
}
.empty-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
    opacity: 0.6;
}
.empty-text {
    font-size: 13px;
    color: var(--color-text-muted, #9a8d9a);
    margin: 0;
}

.back-link {
    color: var(--color-accent-champagne, #d4af37);
    text-decoration: none;
}
.back-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   RTL (Right-To-Left) Layout Support (e.g. Urdu - ur)
   ========================================================================== */
html[dir="rtl"], body[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .topbar-inner {
    flex-direction: row-reverse;
}

[dir="rtl"] .topbar-left-box {
    flex-direction: row-reverse;
}

[dir="rtl"] .topbar-auth-box {
    margin-left: 0;
    margin-right: auto;
    flex-direction: row-reverse;
}

[dir="rtl"] .topbar-lang-select {
    padding-left: 10px;
    padding-right: 28px;
    background-position: left 8px center;
}

[dir="rtl"] .dropdown-caret {
    margin-left: 0;
    margin-right: 4px;
}

[dir="rtl"] .dropdown-menu {
    left: auto;
    right: 0;
    text-align: right;
}

[dir="rtl"] .dropdown-item {
    text-align: right;
}

[dir="rtl"] .mobile-nav-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .title-accent-bar {
    left: auto;
    right: 0;
}

[dir="rtl"] .footer-links-title {
    border-left: none;
    border-right: 3px solid var(--color-accent-champagne, #B89570);
    padding-left: 0;
    padding-right: 10px;
}

[dir="rtl"] .link-icon {
    display: inline-block;
    transform: scaleX(-1);
}

[dir="rtl"] .footer-card-link {
    flex-direction: row-reverse;
}

[dir="rtl"] .pagination-box {
    direction: ltr; /* Keeps page numbers ordered 1 2 3 left to right */
}

[dir="rtl"] .form-group input,
[dir="rtl"] .form-group select,
[dir="rtl"] .form-group textarea {
    text-align: right;
}

[dir="rtl"] .member-menu-item {
    text-align: right;
}

[dir="rtl"] .table th,
[dir="rtl"] .table td {
    text-align: right;
}

