/* ==========================================================================
   AURA BLOG - Modern Minimalist Design System
   Light Theme, Adaptive Single Page Application & Mobile UX Optimization
   ========================================================================== */

/* --- CSS Variables / Design Tokens --- */
:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  
  --success: #10b981;
  --success-light: #ecfdf5;
  
  --warning: #f59e0b;
  --warning-light: #fffbebfb;
  
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: #fef2f2;
  
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px -4px rgba(15, 23, 42, 0.12);
  --shadow-modal: 0 24px 48px -8px rgba(15, 23, 42, 0.18);

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Plus Jakarta Sans', 'Inter', sans-serif;
  
  --header-height: auto;
}

/* --- Base & Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Base Utility Helpers */
.hidden {
  display: none !important;
}

.shadow-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.shadow-card:hover {
  box-shadow: var(--shadow-lg);
}

/* --- 1. HEADER NAVBAR --- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  width: 100%;
  max-width: 100vw;
  padding: 10px 0;
}

.header-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-badge {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.15rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.logo-dot {
  color: var(--primary);
}

.header-actions-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* User profile header widget */
.nav-user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.user-avatar-badge {
  width: 30px;
  height: 30px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.user-info-text {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
}

.user-role-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-logout-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  transition: all 0.2s ease;
}

.btn-logout-danger:hover, .btn-logout-danger:active {
  background: var(--danger);
  color: #fff;
}

.badge-pending-count {
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-left: 4px;
}

/* Header Right - Stories Dropdown */
.dropdown-wrapper {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.dropdown-arrow {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.dropdown-wrapper.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px 0;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropdown-wrapper.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 8px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.dropdown-items-list {
  max-height: 320px;
  overflow-y: auto;
}

.dropdown-item {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
  min-height: 48px;
}

.dropdown-item:hover, .dropdown-item:active {
  background: var(--bg-subtle);
}

.dropdown-item.active {
  background: var(--primary-light);
  border-left-color: var(--primary);
}

.dropdown-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.dropdown-item.active .dropdown-item-title {
  color: var(--primary);
}

.dropdown-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  gap: 12px;
}

/* --- BUTTONS & INPUTS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-height: 42px;
  touch-action: manipulation;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  min-height: 36px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover, .btn-primary:active {
  background: var(--primary-hover);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-subtle {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border);
}

.btn-subtle:hover, .btn-subtle:active {
  background: var(--bg-hover);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-admin {
  background: #1e1b4b;
  color: #e0e7ff;
}

.btn-admin:hover {
  background: #312e81;
}

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-icon-only {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-only:hover {
  background: var(--danger);
  color: #fff;
}

.btn-icon-sm {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  border: none;
  cursor: pointer;
}

.btn-text-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
}

.btn-text-link:hover {
  color: var(--primary);
}

/* --- MAIN LAYOUT & HERO --- */
.main-layout {
  flex: 1;
  padding: 32px 24px 64px 24px;
}

.content-container {
  max-width: 900px;
  margin: 0 auto;
}

.page-intro {
  margin-bottom: 24px;
}

.sub-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

/* --- 2. STORY SECTION (FIXED HEIGHT + INTERNAL VERTICAL SCROLL) --- */
.story-section-card {
  padding: 32px;
  margin-bottom: 40px;
  background: var(--bg-card);
}

.story-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.story-meta-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.story-category-tag {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.story-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.story-main-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.story-admin-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* CRITICAL REQUIREMENT: Fixed Height & Own Vertical Scroll for Story Text Viewport */
.story-content-viewport {
  height: 440px;
  overflow-y: auto;
  padding-right: 16px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbar for Story Viewport */
.story-content-viewport::-webkit-scrollbar {
  width: 6px;
}

.story-content-viewport::-webkit-scrollbar-track {
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
}

.story-content-viewport::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-full);
}

.story-content-viewport::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.story-body-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #334155;
  white-space: pre-line;
}

.story-body-text p {
  margin-bottom: 1.25rem;
}

/* Story Footer & Audio Player */
.story-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.audio-player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.btn-audio {
  background: #0f172a;
  color: #fff;
  border-radius: var(--radius-full);
  padding: 10px 20px;
}

.btn-audio:hover {
  background: #334155;
}

.audio-status-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}

.audio-pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 1.4s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.6; }
}

.audio-feature-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --- 3. COMMENTS SECTION --- */
.comments-section {
  padding: 32px;
}

.comments-section-header {
  margin-bottom: 24px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.comments-count-pill {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

/* Guest Warning Banner */
.comment-guest-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--primary-light);
  border: 1px dashed var(--primary);
  padding: 20px 24px;
  border-radius: var(--radius-md);
  margin-bottom: 28px;
}

.guest-notice-icon {
  width: 44px;
  height: 44px;
  background: #fff;
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.guest-notice-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.guest-notice-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.guest-notice-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Comment Form */
.comment-form {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 32px;
}

.comment-user-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.user-avatar-sm {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comment-user-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.comment-user-status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: #e2e8f0;
  color: var(--text-muted);
}

.comment-user-status-badge.trusted {
  background: var(--success-light);
  color: var(--success);
}

.comment-user-notice {
  font-size: 0.75rem;
  color: var(--warning);
  margin-left: auto;
}

.form-textarea {
  width: 100%;
  font-family: var(--font-main);
  font-size: 0.95rem;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #fff;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-footer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

/* Comments List */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: border-color 0.2s ease;
}

.comment-item.pending-moderation {
  background: var(--warning-light);
  border-color: rgba(245, 158, 11, 0.3);
}

.comment-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.comment-author-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-author-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.comment-date {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.comment-status-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.comment-status-pill.approved {
  background: var(--success-light);
  color: var(--success);
}

.comment-status-pill.pending {
  background: #fef3c7;
  color: #b45309;
}

.comment-text {
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.6;
}

.no-comments-placeholder {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* --- FOOTER --- */
.app-footer {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 24px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
}

/* --- MODALS & ADMIN PANEL --- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 28px;
  position: relative;
  box-shadow: var(--shadow-modal);
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-large {
  max-width: 840px;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background 0.2s ease;
  z-index: 10;
}

.modal-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.modal-tab {
  background: none;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 8px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.modal-tab:hover {
  color: var(--text-main);
}

.modal-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-input {
  width: 100%;
  font-family: var(--font-main);
  font-size: 0.95rem;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  outline: none;
  transition: border-color 0.2s ease;
  min-height: 44px;
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-row {
  display: flex;
  gap: 16px;
}

.flex-1 { flex: 1; }

.form-error-msg {
  background: var(--danger-light);
  color: var(--danger);
  font-size: 0.85rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.modal-helper-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

/* Admin Modal Tab Content */
.admin-modal-header {
  margin-bottom: 20px;
  padding-right: 40px;
}

.admin-modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

.admin-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.admin-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.admin-table th, .admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  background: var(--bg-subtle);
  font-weight: 700;
  color: var(--text-muted);
}

.admin-table tbody tr:hover {
  background: #f8fafc;
}

.badge-tab-count {
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  margin-left: 4px;
}

.admin-moderation-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-moderation-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.moderation-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 10px;
}

.moderation-user {
  font-weight: 700;
  font-size: 0.9rem;
}

.moderation-story-title {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
}

.moderation-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ==========================================================================
   ADVANCED MOBILE RESPONSIVE DESIGN (< 768px)
   CLEAR 2-ROW HEADER & FULL TOUCH VISIBILITY
   ========================================================================== */
@media (max-width: 768px) {
  .app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 8px 12px;
  }

  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 0;
  }

  /* Row 1: Logo + User Profile / Login with Bold Red Logout Button */
  .header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .brand-logo {
    gap: 6px;
  }

  .logo-badge {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }

  .logo-text {
    font-size: 1.1rem;
  }

  .nav-user-profile {
    padding: 4px 8px;
    gap: 8px;
  }

  .user-info-text {
    max-width: 75px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-name {
    font-size: 0.8rem;
  }

  .btn-logout-danger {
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    min-height: 34px;
    white-space: nowrap;
  }

  /* Row 2: Action Bar (Stories, Admin, Comments) */
  .header-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 6px;
  }

  /* Stories Dropdown Button on Mobile Header */
  .dropdown-wrapper {
    flex: 1;
  }

  .dropdown-toggle {
    width: 100%;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.85rem;
    min-height: 38px;
  }

  .dropdown-menu {
    position: fixed;
    top: 96px;
    left: 8px;
    right: 8px;
    width: calc(100vw - 16px);
    max-height: 70vh;
    box-shadow: var(--shadow-modal);
  }

  #btnNavAdmin {
    padding: 8px 10px;
    font-size: 0.85rem;
    min-height: 38px;
  }

  #btnNavComment {
    padding: 8px 10px;
    font-size: 0.85rem;
    min-height: 38px;
  }

  .nav-btn-group {
    display: flex;
    gap: 4px;
  }

  #btnNavLogin, #btnNavRegister {
    padding: 8px 10px;
    font-size: 0.82rem;
    min-height: 38px;
  }

  #btnNavRegister {
    display: none;
  }

  /* Mobile Story Card & Admin Actions (Edit/Delete Buttons) */
  .story-title-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .story-admin-actions {
    width: 100%;
    display: flex;
    gap: 8px;
    justify-content: flex-start;
  }

  .story-admin-actions .btn {
    flex: 1;
    justify-content: center;
    white-space: nowrap;
    font-size: 0.82rem;
    padding: 8px 12px;
  }

  .main-layout {
    padding: 16px 10px 40px 10px;
  }

  .page-title {
    font-size: 1.35rem;
  }

  .story-section-card {
    padding: 16px 12px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
  }

  .story-main-title {
    font-size: 1.25rem;
  }

  .story-meta-top {
    gap: 8px;
    font-size: 0.78rem;
  }

  /* Mobile Story Content Viewport */
  .story-content-viewport {
    height: 360px;
    max-height: 50vh;
    padding-right: 6px;
  }

  .story-body-text {
    font-size: 0.98rem;
    line-height: 1.7;
  }

  .audio-player-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .audio-feature-tag {
    justify-content: center;
  }

  /* Comments section on mobile */
  .comments-section {
    padding: 16px 12px;
    border-radius: var(--radius-md);
  }

  .comment-guest-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px;
    gap: 12px;
  }

  .guest-notice-actions {
    margin-left: 0;
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .guest-notice-actions .btn {
    flex: 1;
  }

  .comment-user-notice {
    margin-left: 0;
    display: block;
    width: 100%;
    margin-top: 4px;
  }

  .comment-user-bar {
    flex-wrap: wrap;
  }

  .form-row {
    flex-direction: column;
    gap: 12px;
  }

  .footer-container {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  /* Mobile Admin Modal */
  .modal-backdrop {
    padding: 8px;
  }

  .modal-card {
    padding: 18px 14px;
    border-radius: var(--radius-md);
    max-height: 94vh;
  }

  .admin-modal-header h2 {
    font-size: 1.2rem;
  }

  .admin-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 16px;
  }

  .admin-tabs .modal-tab {
    font-size: 0.82rem;
    padding: 8px 12px;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    border-bottom: none;
  }

  .admin-tabs .modal-tab.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
  }

  .admin-action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .admin-action-bar h3 {
    font-size: 1rem;
  }

  .admin-action-bar .btn {
    width: 100%;
  }

  .admin-table {
    min-width: 100%;
  }

  .admin-table th {
    font-size: 0.75rem;
    padding: 8px 10px;
  }

  .admin-table td {
    padding: 10px;
    font-size: 0.8rem;
  }

  .moderation-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

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

  .moderation-actions .btn {
    flex: 1;
  }
}
