/* =========================================
   GLOBAL VARIABLES (Modern Light Glass UI)
========================================= */
:root {
    --bg: #f0f4ff;
    --card: rgba(255, 255, 255, 0.75);
    --text: #1e293b;
    --text-muted: #64748b;
    --accent: #ff3b3b;
    --border: rgba(0, 0, 0, 0.08);
    --input-bg: #ffffff;
    --success: #22c55e;
    --danger: #ef4444;

    --blur: blur(14px);
    --radius-lg: 18px;
    --radius-md: 14px;
}

/* =========================================
   DARK THEME VARIABLES
========================================= */
html.dark {
    --bg:       #0f1117;
    --card:     rgba(255, 255, 255, 0.05);
    --text:     #e2e8f0;
    --text-muted: #94a3b8;
    --border:   rgba(255, 255, 255, 0.08);
    --input-bg: #1e2130;
    --success:  #22c55e;
    --danger:   #ef4444;
}

/* dark body inherits var(--bg) = #0f1117 from body rule */

/* Theme toggle button */
.theme-toggle {
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: .2s;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
}
.theme-toggle:hover {
    border-color: var(--accent);
    transform: scale(1.1) rotate(15deg);
}

.notif-item{
display:flex;
gap:12px;
padding:14px;
border-radius:12px;
background:var(--card);
border:1px solid var(--border);
margin-bottom:10px;
text-decoration:none;
color:var(--text);
align-items:center;
transition:.2s;
}

.notif-item:hover{
border-color:var(--accent);
transform:translateY(-1px);
}

.notif-unread{
background:rgba(255,59,59,0.05);
border-color:rgba(255,59,59,0.2);
}

.notif-avatar{
width:40px;
height:40px;
border-radius:50%;
object-fit:cover;
flex-shrink:0;
border:2px solid var(--border);
}

.notif-icon{
width:40px;
height:40px;
border-radius:50%;
display:flex;
align-items:center;
justify-content:center;
background:var(--border);
font-size:18px;
}

.notif-body{
flex:1;
min-width:0;
}

/* .notif-avatar duplicate removed — definition kept above */
.notif-text{
font-size:14px;
margin:0;
}

.notif-time{
font-size:11px;
color:var(--text-muted);
}
/* =========================================
   BASE
========================================= */
body {
    margin: 0;
    background-color: #eef2ff;
    background-image: linear-gradient(135deg, #eef2ff, #f8fafc);
    color: #1e293b;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100dvh;
}

html.dark body {
    background-color: #0f1117 !important;
    background-image: none !important;
    color: #e2e8f0 !important;
}

.coin-display{
display:flex;
align-items:center;
gap:6px;
background:rgba(255,215,0,0.12);
padding:4px 10px;
border-radius:20px;
font-weight:bold;
color:#eab308;
font-size:13px;
}
/* =========================================
   CARD SYSTEM
========================================= */
.card,
.auth-box,
.story-card,
.sidebar-box,
.stat-card {
    background: var(--card);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}

/* =========================================
   HEADER / NAV
========================================= */
.header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 999;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px;
}

.nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #333;
    transition: 0.2s;
}

.nav-avatar:hover {
    transform: scale(1.05);
}

.nav a {
    text-decoration: none;
    font-size: 14px;
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: 10px;
    transition: 0.2s;
}

.nav a:hover {
    background: rgba(255, 59, 59, 0.08);
    color: var(--accent);
}

/* =========================================
   INPUTS
========================================= */
input,
textarea,
select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 14px;
    color: var(--text);
    box-sizing: border-box;
    outline: none;
    transition: 0.2s;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 59, 59, 0.15);
}

/* =========================================
   BUTTONS
========================================= */
button {
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent), #ff6b6b);
    box-shadow: 0 6px 18px rgba(255, 59, 59, 0.25);
    transition: 0.2s;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(255, 59, 59, 0.35);
}

/* =========================================
   ALERTS
========================================= */
.alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #15803d;
    padding: 12px;
    border-radius: var(--radius-md);
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #b91c1c;
    padding: 12px;
    border-radius: var(--radius-md);
}

/* =========================================
   LAYOUT
========================================= */
.container {
    padding: 20px;
}

.layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
}

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

/* =========================================
   WELCOME / STATS
========================================= */
.welcome-text {
    color: var(--accent);
    margin-bottom: 20px;
}

.stats-row {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    flex: 1;
    padding: 18px;
    border-radius: var(--radius-lg);
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.stat-number {
    display: block;
    font-size: 26px;
    font-weight: bold;
    color: var(--accent);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* =========================================
   STORIES
========================================= */
.section-title {
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.story-feed {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.story-card {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-radius: var(--radius-lg);
}

.story-thumb {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.story-info h4 {
    margin: 5px 0;
}

.story-info a {
    color: var(--text);
    text-decoration: none;
}

.story-info a:hover {
    color: var(--accent);
}

.story-author {
    font-size: 11px;
    color: var(--text-muted);
}

.story-likes {
    margin-top: 8px;
    font-size: 12px;
    color: var(--accent);
}

/* =========================================
   SIDEBAR
========================================= */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-box {
    padding: 20px;
    border-radius: var(--radius-lg);
}

.sidebar-box h4 {
    margin-top: 0;
    color: var(--accent);
}

.sidebar-box a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 0;
    font-size: 14px;
}

.sidebar-box a:hover {
    color: var(--accent);
}

/* =========================================
   CHAT MESSAGES
========================================= */
.msg.me {
    background: linear-gradient(135deg, var(--accent), #ff6b6b);
    color: white;
}

.msg.other {
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
}

/* =========================================
   FOOTER
========================================= */
.site-footer {
    background: #0a0a0a;
    border-top: 1px solid #222;
    padding: 35px 20px;
    margin-top: 40px;
    text-align: center;
    color: #777;
    font-size: 13px;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.footer-links a {
    color: #aaa;
    text-decoration: none;
    font-weight: bold;
    transition: 0.2s;
}

.footer-links a:hover { color: var(--accent); }
.footer-copy { margin: 5px 0; }
.footer-note { font-size: 12px; color: #555; }

@media (max-width: 500px) {
    .footer-links { gap: 12px; font-size: 12px; }
    .site-footer  { padding: 25px 10px; }
}

.story-page {
    max-width: 850px;
    margin: 0 auto;
}

.story-wrapper {
    padding: 0;
    overflow: hidden;
}

.story-cover {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-bottom: 1px solid var(--border);
}

.story-body {
    padding: 28px;
}

.story-title {
    margin-top: 0;
    font-size: 28px;
    line-height: 1.3;
}

.story-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 18px;
    margin-bottom: 22px;
}

.story-author-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

.meta-label {
    font-size: 12px;
    color: var(--text-muted);
}

.author-name {
    font-weight: 600;
    text-decoration: none;
    color: var(--accent);
}

.story-stats {
    text-align: right;
    font-size: 13px;
    color: var(--text-muted);
}

.story-content {
    font-size: 16px;
    line-height: 1.85;
    color: var(--text);
    font-family: Georgia, serif;
}

.story-actions {
    margin-top: 28px;
    text-align: center;
}

.like-btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 30px;
    border: 1px solid var(--border);
    text-decoration: none;
    font-weight: 600;
    color: var(--text);
    background: white;
    transition: 0.2s;
}

.comments-section {
    margin-top: 50px;
    border-top: 1px solid var(--border);
    padding-top: 30px;
}

.comments-section h3 {
    margin-bottom: 20px;
}

.comment-form {
    padding: 18px;
    border-radius: var(--radius-lg);
    margin-bottom: 25px;
}

.comment-form label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.comment-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.comment-footer small {
    color: var(--text-muted);
}

.comment-login-box {
    padding: 18px;
    text-align: center;
}

.comment-login-box a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.comment {
    padding: 15px;
}

.comment-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 13px;
}

.comment-top b {
    color: var(--accent);
}

.comment-top small {
    color: var(--text-muted);
    margin-left: 6px;
    font-size: 11px;
}

.comment p {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

/* ✅ Mobile polish */
@media (max-width: 480px) {
    .comment-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

.like-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.like-btn.liked {
    background: rgba(255, 59, 59, 0.08);
    border-color: var(--accent);
    color: var(--accent);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h2 {
    margin: 0;
}

.write-btn {
    background: var(--accent);
    color: white;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
}

.write-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 59, 59, 0.25);
}

.story-preview {
    font-size: 14px;
    color: var(--text-muted);
    margin: 6px 0;
    line-height: 1.5;
}

.story-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 25px;
}

.profile-container {
    max-width: 850px;
    margin: auto;
}

.profile-topbar {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 10px;
    color: var(--text-muted);
}

.profile-topbar a {
    text-decoration: none;
    color: var(--text-muted);
}

.profile-card {
    text-align: center;
}

.profile-avatar-img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.profile-role {
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 10px;
}

.status-bubble {
    margin-top: 10px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    display: inline-block;
}

.bio-text {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
}

.user-meta-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
}

.profile-actions {
    margin-top: 15px;
}

.p-stat-box {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    text-align: center;
}

.p-stat b {
    display: block;
    font-size: 18px;
    color: var(--accent);
}

.p-stat small {
    font-size: 11px;
    color: var(--text-muted);
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.p-story-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
}

.p-story-info {
    padding: 8px;
    font-size: 13px;
    color: var(--text);
}

.btn-msg {
    background: var(--accent);
    color: white;
}

.narrow {
    max-width: 820px;
    margin: auto;
}

.friends-grid {
    display: grid;
    gap: 14px;
    margin-bottom: 25px;
}

.friend-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.friend-left {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.friend-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
}

.friend-left strong {
    display: block;
    font-size: 15px;
}

.friend-left small {
    font-size: 12px;
    color: var(--text-muted);
}

.friend-actions {
    display: flex;
    gap: 8px;
}

.btn-accept {
    background: var(--success);
    color: white;
    padding: 7px 14px;
    border-radius: 18px;
    font-size: 12px;
    text-decoration: none;
}

.btn-decline {
    background: #e5e7eb;
    color: #444;
    padding: 7px 14px;
    border-radius: 18px;
    font-size: 12px;
    text-decoration: none;
}

.btn-msg {
    background: var(--accent);
    color: white;
    padding: 7px 14px;
    border-radius: 18px;
    font-size: 12px;
    text-decoration: none;
}

.online-dot {
    color: var(--success);
    font-weight: 600;
}

/* ✅ Mobile */
@media (max-width: 520px) {
    .friend-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .friend-actions {
        width: 100%;
    }
}

.members-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.online-box {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    margin-bottom: 15px;
}

.search-box {
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    margin-bottom: 18px;
}

.members-grid {
    display: grid;
    gap: 12px;
}

.member-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.member-left {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.member-left strong {
    display: block;
    font-size: 15px;
}

.member-left small {
    font-size: 12px;
    color: var(--text-muted);
}

.member-actions {
    display: flex;
    gap: 8px;
}

.btn-add {
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 16px;
    text-decoration: none;
    font-size: 12px;
}

.btn-pending {
    background: #e5e7eb;
    color: #666;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
}

.online-dot {
    color: var(--success);
    font-weight: 600;
}

/* ✅ Mobile */
@media (max-width: 520px) {
    .member-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

.chat-wrapper {
    display: flex;
    justify-content: center;
    height: calc(100dvh - 140px);
}

.chat-container {
    width: 100%;
    max-width: 680px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

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

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 15px 5px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-loading {
    text-align: center;
    color: var(--text-muted);
    padding-top: 20px;
}

.chat-input-area {
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.chat-input-area form {
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    border-radius: 20px;
    padding: 10px 14px;
}

.chat-input-area button {
    border-radius: 20px;
    padding: 10px 18px;
}

.msg {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

.msg.me {
    align-self: flex-end;
}

.msg.other {
    align-self: flex-start;
}

.tick {
    font-size: 11px;
    opacity: 0.7;
}

/* Mobile */
@media (max-width: 520px) {
    .chat-wrapper {
        height: calc(100dvh - 120px);
    }
}

/* =========================
   ADMIN PANEL
========================= */

.admin-container {
    max-width: 950px;
    margin: auto;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 13px;
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* 📊 Stats */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.admin-stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    text-align: center;
}

.admin-stat-card .stat-number {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: var(--accent);
}

.admin-stat-card .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.admin-stat-card.online .stat-number {
    color: var(--success);
}

.admin-stat-card.stories .stat-number {
    color: #6366f1;
}

/* ⚡ Grid */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
}

.admin-card {
    display: flex;
    gap: 15px;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    text-decoration: none;
    color: var(--text);
    transition: 0.2s;
}

.admin-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.admin-icon {
    font-size: 26px;
}

.admin-card small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.admin-card.danger {
    border-color: rgba(239,68,68,0.35);
}

.admin-card.danger:hover {
    border-color: var(--danger);
}

/* =========================
   ADMIN USER TABLE
========================= */

.admin-search input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.admin-table-wrap {
    overflow-x: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th {
    text-align: left;
    padding: 14px;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
}

.admin-user {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.admin-user:hover {
    color: var(--accent);
}

/* Badges */
.badge-admin {
    background: rgba(239,68,68,0.12);
    color: var(--danger);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: bold;
}

.badge-member {
    color: var(--text-muted);
    font-size: 12px;
}

/* Status */
.status {
    font-size: 12px;
}

.status.online { color: var(--success); }
.status.offline { color: var(--text-muted); }
.status.banned { color: var(--danger); }

/* Buttons */
.admin-actions form {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: #facc15;
    color: black;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.protected {
    font-size: 12px;
    color: var(--text-muted);
}

/* =========================
   ADMIN CHAT LOGS
========================= */

.room-tabs {
    display: flex;
    gap: 8px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.room-tabs a {
    padding: 6px 12px;
    border-radius: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    font-size: 12px;
    text-decoration: none;
    color: var(--text-muted);
}

.room-tabs a.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.admin-log-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
}

.admin-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
}

.btn-danger-text {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 12px;
    cursor: pointer;
}

.log-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.log-msg b {
    color: var(--accent);
}

.timestamp {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    font-size: 13px;
}

.pagination a {
    text-decoration: none;
    color: var(--accent);
}

/* =========================
   ADMIN SPY
========================= */

.spy-chat-window {
    background: #050505;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 15px;
    max-height: 650px;
    overflow-y: auto;
}

.spy-msg {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 14px;
    margin-bottom: 12px;
    font-size: 13px;
}

.spy-msg.left {
    background: #1a1a1a;
    border-left: 3px solid #3498db;
}

.spy-msg.right {
    background: #222;
    border-right: 3px solid var(--danger);
    margin-left: auto;
    text-align: right;
}

.spy-meta {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.btn-danger-text {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 11px;
    cursor: pointer;
}

.conv-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* =========================
   ADMIN SETTINGS
========================= */

.admin-settings {
    max-width: 620px;
    margin: auto;
}

.setting-card {
    margin-bottom: 18px;
    padding: 18px;
    border-radius: 18px;
}

.setting-card h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--accent);
}

.setting-card label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.setting-card input[type="text"],
.setting-card textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--text);
}

.setting-card textarea {
    min-height: 90px;
    resize: vertical;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 5px;
    cursor: pointer;
}

.toggle input {
    width: 18px;
    height: 18px;
}

.btn-primary.big {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    border-radius: 14px;
}
/* ── BittuBook Coin symbol — replaces 🪙 emoji ── */
.vc {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15em;
    height: 1.15em;
    background: #d97706;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 50%;
    font-size: 0.72em;
    font-weight: 900;
    color: #fff;
    vertical-align: middle;
    line-height: 1;
    flex-shrink: 0;
    font-style: normal;
    letter-spacing: 0;
    text-indent: 0;
    font-family: 'Nunito', Helvetica, Arial, sans-serif;
}
.vc::before { content: 'C'; }

/* =========================================
   AUTO DARK MODE DETECTION
========================================= */
@media (prefers-color-scheme: dark) {
    html:not(.light) {
        --bg: #0f1117;
        --card: rgba(255, 255, 255, 0.05);
        --text: #e2e8f0;
        --text-muted: #94a3b8;
        --border: rgba(255, 255, 255, 0.08);
        --input-bg: #1e2130;
    }
}

/* =========================================
   FOOTER — USE CSS VARS (fix hardcoded)
========================================= */
.site-footer {
    background: var(--card, #0a0a0a);
    border-top: 1px solid var(--border, #222);
    color: var(--text-muted, #777);
}
.footer-links a {
    color: var(--text-muted, #aaa);
}
.footer-note {
    color: var(--text-muted, #555);
}

/* =========================================
   ACCESSIBILITY — FOCUS VISIBLE
========================================= */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
    outline: none;
}

/* =========================================
   TOAST NOTIFICATIONS
========================================= */
.vipta-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    padding: 12px 22px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,.3);
    z-index: 99999;
    animation: ntIn .35s cubic-bezier(.34,1.56,.64,1);
    cursor: pointer;
    max-width: 360px;
}
.vipta-toast-success { background: #22c55e; }
.vipta-toast-error   { background: #ef4444; }
.vipta-toast-info    { background: #3b5998; }
.vipta-toast-warning { background: #eab308; }

/* =========================================
   SKELETON LOADING
========================================= */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.08) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-md);
    will-change: background-position;
}
@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-card {
    height: 120px;
    margin-bottom: 12px;
}
.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.skeleton-line {
    height: 14px;
    margin-bottom: 8px;
    width: 80%;
}
.skeleton-line-short {
    height: 14px;
    margin-bottom: 8px;
    width: 40%;
}

/* =========================================
   RESPONSIVE — SMALL PHONES
========================================= */
@media (max-width: 375px) {
    .stats-row { flex-direction: column; gap: 8px; }
    .stat-number { font-size: 20px; }
    .story-title { font-size: 16px; }
    .story-body { padding: 16px; }
    .container { padding: 10px; }
}

/* =========================================
   TOUCH TARGETS — 44px MIN
========================================= */
@media (pointer: coarse) {
    .fb-nav-tab,
    .mob-bar-btn,
    .fb-btn-pill,
    .fb-acc-btn,
    .mob-dw-link,
    .filter-chip,
    .pg-btn {
        min-height: 44px;
        min-width: 44px;
    }
}


/* =========================================
   MOBILE BOTTOM CLEARANCE — GLOBAL FIX
   Ensures content on ALL pages is never
   hidden behind the fixed bottom nav bar.
   The 56px matches .mob-bar min-height.
========================================= */
@media (max-width: 768px) {
    /* Every page's main wrapper gets clearance */
    .fb-page,
    .fb-layout,
    .container,
    .page-wrap,
    .pf,
    .story-page,
    .stories-wrap,
    .members-wrap,
    .lb-wrap,
    .ach-wrap,
    .notif-wrap,
    .bk-wrap,
    .ms-wrap,
    .cs-wrap,
    .ec-wrap,
    .dt-wrap,
    .ep-wrap,
    .ref-wrap,
    .rh-wrap,
    .fr-wrap,
    main, article {
        padding-bottom: max(70px, calc(56px + env(safe-area-inset-bottom, 14px))) !important;
    }

    /* Fixed elements on pages must sit above mob-bar (z-index 850) */
    /* Any page-level sticky/fixed bar should use bottom: calc(56px + safe-area) */
    .sticky-action-bar,
    .pf-sticky,
    .story-actions-bar,
    .chat-input-bar {
        bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Prevent horizontal overflow on mobile */
    body {
        overflow-x: hidden;
    }

    /* Cards and content shouldn't overflow viewport width */
    .fb-post, .story-card, .card, .pf-card, .cs-card {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Tables scroll horizontally instead of overflowing */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* iPhone notch / Dynamic Island safe area for nav */
@supports (padding-top: env(safe-area-inset-top)) {
    @media (max-width: 768px) {
        .fb-nav {
            padding-top: env(safe-area-inset-top, 0px);
            height: calc(44px + env(safe-area-inset-top, 0px));
        }
        body {
            padding-top: calc(44px + env(safe-area-inset-top, 0px));
        }
    }
}

/* =========================================
   FOOTER — MOBILE OPTIMISATION
   On mobile, the bottom nav handles main
   navigation, so hide the full footer links
   and keep only the copyright line.
========================================= */
@media (max-width: 768px) {
    .site-footer {
        padding: 16px 12px !important;
        margin-top: 8px !important;
    }
    .footer-links {
        display: none !important;
    }
    .footer-note {
        display: none !important;
    }
    .footer-copy {
        font-size: 11px;
        color: var(--text-muted, #777);
    }
}

/* =========================================
   AD SLOTS — MOBILE SAFETY
   Prevent empty ad wrappers creating
   blank space on mobile.
========================================= */
.site-ad-wrap {
    min-height: 0;
}
.site-ad-wrap:empty {
    display: none !important;
}
.site-ad-content:empty {
    display: none !important;
}
@media (max-width: 768px) {
    .site-ad-wrap {
        max-width: 100%;
        overflow: hidden;
    }
}

/* =========================================
   AD SLOTS — MOBILE HEIGHT LIMIT
   Prevent broken/large ads from creating
   huge empty black spaces on mobile.
========================================= */
@media (max-width: 768px) {
    .site-ad-wrap {
        max-height: 250px;
        overflow: hidden;
    }
    .site-ad-content {
        max-height: 220px;
        overflow: hidden;
    }
    .site-ad-content iframe,
    .site-ad-content img {
        max-width: 100% !important;
        height: auto !important;
    }
}
