/* ==========================================================================
   NP E-Book — Admin Panel Styles (Full Width & AnyFlip-Style Experience)
   โรงเรียนหนองไผ่ (nongphai.ac.th)
   ========================================================================== */

.admin-body {
  background: #0d121c;
  color: #f8fafc;
  font-family: var(--font-body);
  min-height: 100vh;
}

/* 1. Top Navigation Bar (Full-Width, No Left Sidebar) */
.admin-header-top {
  position: sticky;
  top: 0;
  z-index: 500;
  background: #141a24;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.admin-header-container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.admin-header-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* User Badge */
.admin-user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Top Navigation Tabs */
.admin-top-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.top-nav-btn {
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.top-nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.top-nav-btn.active {
  background: linear-gradient(135deg, var(--np-green-primary), var(--np-green-dark));
  color: #fff;
  border-color: var(--np-green-light);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.35);
}

/* 2. Main Full-Width Content Container */
.admin-content-full {
  max-width: 1560px;
  margin: 0 auto;
  padding: 2rem 2rem 5rem;
}

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

.admin-tab-pane.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stats Cards Grid */
.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.2rem;
}

.stat-card {
  background: #151c28;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

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

.stat-card-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: rgba(255, 255, 255, 0.06);
}

.stat-card-val {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-top: 0.8rem;
}

/* Table Card Container */
.admin-table-card {
  background: #151c28;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.table-card-header {
  padding: 1.4rem 1.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Bookcase Filter Toolbar (ชี้ตามลูกศรสีชมพู รูปที่ 1) */
.bookcase-filter-toolbar {
  padding: 1rem 1.8rem;
  background: #111722;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-shelf-btn {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: #1a2232;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-shelf-btn:hover {
  color: #fff;
  background: #222d42;
}

.filter-shelf-btn.active {
  background: var(--np-gold);
  color: #000;
  border-color: var(--np-gold);
  box-shadow: 0 2px 10px rgba(230, 161, 0, 0.3);
}

.admin-search-input {
  background: #0f141f;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  color: #fff;
  font-size: 0.88rem;
  width: 280px;
  outline: none;
}

.admin-search-input:focus {
  border-color: var(--np-gold);
}

/* Data Table & Sortable Headers */
.admin-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.admin-data-table th {
  background: #1a2232;
  color: var(--text-muted);
  padding: 0.95rem 1.5rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  user-select: none;
}

.admin-data-table th.sortable-th {
  cursor: pointer;
  transition: color var(--transition-fast);
}

.admin-data-table th.sortable-th:hover {
  color: #fff;
  background: #202b3e;
}

.sort-indicator {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

.sortable-th.sorted-asc .sort-indicator {
  color: var(--np-gold);
}

.sortable-th.sorted-desc .sort-indicator {
  color: var(--np-gold);
}

.admin-data-table td {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.admin-data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Publish Status Toggle Button (เผยแพร่ / งดเผยแพร่) */
.btn-publish-toggle,
.status-toggle-btn {
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
}

.btn-publish-toggle.published,
.status-toggle-btn.published {
  background: rgba(34, 197, 94, 0.18) !important;
  color: #4ade80 !important;
  border: 1px solid rgba(74, 222, 128, 0.5) !important;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.18);
}

.btn-publish-toggle.published:hover,
.status-toggle-btn.published:hover {
  background: rgba(34, 197, 94, 0.32) !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(74, 222, 128, 0.35);
}

.btn-publish-toggle.unpublished,
.status-toggle-btn.unpublished {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

.btn-publish-toggle.unpublished:hover,
.status-toggle-btn.unpublished:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
}

/* Order Move Buttons (รูปที่ 2) */
.btn-order-move {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-order-move:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-order-move:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.action-btn-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.btn-table-action {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-table-action:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.btn-table-edit {
  background: rgba(230, 161, 0, 0.15);
  color: var(--np-gold-light);
  border-color: rgba(230, 161, 0, 0.35);
}

.btn-table-edit:hover {
  background: var(--np-gold);
  color: #000;
}

.btn-table-delete {
  color: #ef5350;
  border-color: rgba(239, 83, 80, 0.3);
}

.btn-table-delete:hover {
  background: #ef5350;
  color: #fff;
}

/* ==========================================================================
   ANYFLIP-STYLE EDIT BOOK MODAL
   ========================================================================== */
.anyflip-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.anyflip-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.anyflip-modal-container {
  background: #ffffff;
  color: #333333;
  width: 960px;
  max-width: 95vw;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  transition: all 0.25s ease;
}

.anyflip-modal-container.modal-fullscreen {
  max-width: 98vw !important;
  width: 98vw !important;
  height: 96vh !important;
  max-height: 96vh !important;
}

.anyflip-modal-topbar {
  background: #f5f5f5;
  padding: 0.85rem 1.4rem;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.anyflip-modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #777;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
}

.anyflip-modal-close:hover {
  color: #000;
}

/* Two Column Split: Left Form, Right Preview */
.anyflip-modal-content-split {
  display: grid;
  grid-template-columns: 1fr 380px;
  overflow-y: auto;
  flex: 1;
}

.anyflip-form-pane {
  padding: 1.5rem 1.8rem;
  border-right: 1px solid #e8e8e8;
  overflow-y: auto;
}

.anyflip-subtabs {
  display: flex;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 1.2rem;
}

.subtab-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #666;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.subtab-btn.active {
  color: #ff9800;
  border-color: #ff9800;
}

.anyflip-field-group {
  margin-bottom: 1.1rem;
}

.anyflip-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 0.35rem;
}

.anyflip-input, .anyflip-textarea, .anyflip-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
  color: #333;
  outline: none;
  box-sizing: border-box;
}

.anyflip-input:focus, .anyflip-textarea:focus, .anyflip-select:focus {
  border-color: #ff9800;
  box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.2);
}

/* Faint, Muted Placeholder (ไม่ให้เข้าใจผิดว่าเป็นข้อความที่พิมพ์แล้ว) */
.anyflip-input::placeholder,
.anyflip-textarea::placeholder,
input::placeholder,
textarea::placeholder {
  color: #94a3b8 !important;
  opacity: 0.55 !important;
  font-style: italic !important;
  font-weight: 300 !important;
}

/* Right Side: Live Book Previewer */
.anyflip-preview-pane {
  background: #f0f0f0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.anyflip-preview-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.preview-tool-btn {
  background: #fff;
  border: 1px solid #ccc;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #555;
}

.preview-tool-btn:hover {
  border-color: #999;
  color: #000;
}

.preview-book-holder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1rem 0;
}

.preview-book-box {
  width: 220px;
  aspect-ratio: 1 / 1.414;
  border-radius: 4px;
  box-shadow: -6px 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.2rem;
  position: relative;
  overflow: hidden;
}

.preview-book-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 12px;
  background: linear-gradient(90deg, rgba(0,0,0,0.4), rgba(255,255,255,0.2) 50%, rgba(0,0,0,0.3));
}

.preview-page-ctrl {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #555;
  font-weight: 600;
}

/* Bottom Footer */
.anyflip-modal-footer {
  background: #fafafa;
  border-top: 1px solid #e0e0e0;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-anyflip-reupload {
  background: #ffffff;
  color: #d32f2f;
  border: 1px solid #d32f2f;
  padding: 0.55rem 1.15rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-anyflip-reupload:hover {
  background: #ffebee;
}

.btn-anyflip-cancel {
  background: #ffffff;
  color: #555;
  border: 1px solid #ccc;
  padding: 0.55rem 1.2rem;
  border-radius: 4px;
  font-size: 0.88rem;
  font-weight: 600;
}

.btn-anyflip-cancel:hover {
  background: #eee;
}

.btn-anyflip-save {
  background: #1976d2;
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.4rem;
  border-radius: 4px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-anyflip-save:hover {
  background: #1565c0;
}

/* AnyFlip-Style Skin Color Swatches & Embed */
.skin-choice-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
}

.skin-choice-item input[type="radio"] {
  cursor: pointer;
  accent-color: #0284c7;
}

.skin-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border: 2px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s, box-shadow 0.2s;
}

.skin-choice-item:hover .skin-swatch {
  transform: scale(1.12);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.embed-preview-wrapper iframe {
  width: 100%;
  height: 360px;
  border: none;
  display: block;
}

.anyflip-upload-dropzone {
  border: 2px dashed #90caf9;
  background: #f0f7ff;
  border-radius: 8px;
  padding: 2.2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  margin-bottom: 1.2rem;
  transition: all 0.2s ease;
}

.anyflip-upload-dropzone:hover {
  background: #e3f2fd;
  border-color: #1976d2;
}

@media (max-width: 900px) {
  .anyflip-modal-content-split {
    grid-template-columns: 1fr;
  }
  .anyflip-preview-pane {
    display: none;
  }
  .admin-header-container {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Admin Authentication Login Overlay
   ========================================================================== */
.admin-login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.96);
  backdrop-filter: blur(12px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.admin-login-card {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  text-align: center;
  animation: modalFadeIn 0.3s ease;
}

.admin-login-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 2.2rem 1.5rem 1.8rem;
  color: #ffffff;
}

.login-logo-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-weight: 800;
  font-size: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.admin-login-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
}

.admin-login-header p {
  font-size: 0.82rem;
  color: #94a3b8;
}

.admin-login-body {
  padding: 2rem 1.8rem;
  color: #1e293b;
}

.btn-google-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.btn-google-login:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: #94a3b8;
  font-size: 0.78rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.login-divider span {
  padding: 0 0.8rem;
}

.btn-submit-login {
  width: 100%;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-submit-login:hover {
  background: #1d4ed8;
}

.login-alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 0.65rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
  text-align: left;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: #ef4444;
  color: #ffffff;
}

/* ==========================================================================
   Professional Toast Notification System
   ========================================================================== */
.admin-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.admin-toast {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  padding: 0.9rem 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  max-width: 440px;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: auto;
  font-size: 0.92rem;
  font-weight: 500;
}

.admin-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.admin-toast.success {
  border-left: 5px solid #10b981;
}

.admin-toast.error {
  border-left: 5px solid #ef4444;
}

.admin-toast.info {
  border-left: 5px solid #3b82f6;
}

/* ==========================================================================
   ANYFLIP-ACCURATE BOOK CARD ROW LIST (ตรงตามรูป 3, 4, 5)
   ========================================================================== */
.anyflip-books-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.75rem 0.25rem;
}

.anyflip-book-card-item {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  gap: 1.15rem;
  align-items: flex-start;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.anyflip-book-card-item:hover {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* Left Reorder Column */
.book-card-left-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.btn-card-order {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.15s;
}

.btn-card-order:hover:not(:disabled) {
  background: #2563eb;
  color: #fff;
  border-color: #3b82f6;
}

.btn-card-order:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* Cover Wrapper (Compact, Standalone, No Wasted Space) */
.book-card-cover-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.book-card-cover-img {
  width: 78px;
  height: 106px;
  object-fit: cover;
  border-radius: 0 6px 6px 0; /* มุมซ้ายฉากสันปก มุมขวามน */
  box-shadow: 
    1.5px 0 0 #f8fafc,
    3px 0 0 #e2e8f0,
    -2px 4px 14px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  background: #1e293b;
}

.book-card-cover-img:hover {
  transform: scale(1.05);
  box-shadow: 
    2px 0 0 #f8fafc,
    4px 0 0 #e2e8f0,
    -3px 6px 18px rgba(0, 0, 0, 0.75);
}

/* Main Content Info */
.book-card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* Top Row: Title on Left, Action Group on Right */
.book-card-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.book-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.4;
  word-break: break-word;
  cursor: pointer;
  transition: color 0.15s;
  flex: 1;
  min-width: 260px;
}

.book-card-title:hover {
  color: #38bdf8;
}

/* Action Group: Timestamps ("แก้ไขเมื่อ..." ตามด้วย "เผยแพร่เมื่อ...") แล้วตามด้วยปุ่มต่าง ๆ */
.book-card-action-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

.book-card-date-chips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.74rem;
}

.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 0.74rem;
}

.date-chip.updated {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
}

.date-chip.created {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Action Toolbar */
.book-card-actions-toolbar {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-shrink: 0;
}

.anyflip-btn-tool {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.15s;
  text-decoration: none;
}

.anyflip-btn-tool:hover {
  background: #ffffff;
  color: #0f172a;
  border-color: #94a3b8;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.anyflip-btn-tool.active-pub {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

.anyflip-btn-tool.danger:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #dc2626;
}

/* Author Row */
.book-card-author-row {
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.35;
}

/* Description */
.book-card-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Bottom Row: Meta Pills Only (คลีน กว้างขวาง) */
.book-card-bottom-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.book-card-meta-pills {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.76rem;
}

.meta-pill {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  padding: 2px 7px;
  border-radius: 4px;
}

