/* ==========================================================================
   MIDJOURNEY THEME FOR PROMPT1K
   Inspired by midjourney.com/explore
   ========================================================================== */

:root {
  --mj-bg: #0c0b0e;
  --mj-surface: #131317;
  --mj-surface-hover: #1c1c22;
  --mj-border: rgba(255, 255, 255, 0.08);
  --mj-border-focus: rgba(255, 255, 255, 0.2);
  --mj-accent: #f23f43;
  --mj-accent-glow: rgba(242, 63, 67, 0.35);
  --mj-accent-subtle: rgba(242, 63, 67, 0.12);
  --mj-text-primary: #ffffff;
  --mj-text-secondary: #94949f;
  --mj-text-muted: #5e5e6a;
  --mj-sidebar-width: 220px;
  --mj-radius-sm: 8px;
  --mj-radius-md: 12px;
  --mj-radius-lg: 16px;
  --mj-radius-pill: 9999px;
  --mj-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==========================================================================
   GLOBAL DARK THEME OVERRIDES (Unconditional)
   ========================================================================== */
html,
body,
.king-body,
#lmenu,
#king-body-wrapper,
#container,
.king-main,
.king-main-in,
.king-main.one-page,
.king-main.one-page .king-inner,
.container,
.king-part-q-list,
.king-q-list {
  background-color: var(--mj-bg) !important;
  background: var(--mj-bg) !important;
  color: var(--mj-text-secondary) !important;
  font-family: var(--mj-font) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Clear all Leonardo old offsets */
.king-body {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.king-main,
.king-main.one-page,
.king-main-in {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

#container,
.container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  flex: none !important;
}

/* Remove default Leonardo hero search box */
.king-body-search-up {
  display: none !important;
}

/* ==========================================================================
   1. FIXED LEFT SIDEBAR (Midjourney Navigation)
   ========================================================================== */
.leftmenu {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  width: var(--mj-sidebar-width) !important;
  background: var(--mj-bg) !important;
  border-right: 1px solid var(--mj-border) !important;
  z-index: 100 !important;
  padding: 24px 16px 20px 16px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.leftmenu::-webkit-scrollbar {
  width: 4px;
}
.leftmenu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.leftmenu:hover {
  width: var(--mj-sidebar-width) !important;
}

.mj-sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.mj-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 12px 8px;
  text-decoration: none !important;
  color: var(--mj-text-primary) !important;
}

.mj-logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mj-logo-text .mj-logo-badge {
  font-size: 10px;
  font-weight: 800;
  background: var(--mj-accent);
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.mj-nav-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 10px;
  width: 100%;
}

.mj-nav-heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--mj-text-muted);
  padding: 10px 10px 4px 10px;
  margin: 0;
}

.mj-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  color: var(--mj-text-secondary) !important;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--mj-radius-pill);
  text-decoration: none !important;
  transition: all 0.18s ease;
  position: relative;
  cursor: pointer;
}

.mj-nav-item i {
  font-size: 15px;
  width: 18px;
  text-align: center;
  color: inherit;
  transition: color 0.18s ease;
}

.mj-nav-item:hover {
  color: var(--mj-text-primary) !important;
  background: rgba(255, 255, 255, 0.05);
}

.mj-nav-item.active {
  background: var(--mj-accent-subtle) !important;
  color: var(--mj-accent) !important;
  font-weight: 600;
}

.mj-nav-item.active i {
  color: var(--mj-accent) !important;
}

.mj-sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 14px;
  border-top: 1px solid var(--mj-border);
  margin-top: 16px;
  width: 100%;
}

.mj-account-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--mj-radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--mj-border);
  color: var(--mj-text-primary) !important;
  text-decoration: none !important;
  margin-top: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mj-account-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--mj-border-focus);
}

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

.mj-account-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: #2a2a32;
}

.mj-account-name {
  font-size: 13px;
  font-weight: 600;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ffffff !important;
}

#ltoggle,
.king-left-close,
.king-nightb {
  display: none !important;
}

/* ==========================================================================
   2. TOP BAR & PROMPT SEARCH
   ========================================================================== */
.king-headerf {
  position: sticky !important;
  top: 0 !important;
  z-index: 50 !important;
  background: var(--mj-bg) !important;
  border-bottom: 1px solid var(--mj-border) !important;
  margin-left: var(--mj-sidebar-width) !important;
  width: calc(100% - var(--mj-sidebar-width)) !important;
  padding: 12px 28px !important;
  box-sizing: border-box !important;
}

.king-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 20px !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

.header-left {
  display: none !important;
}

.header-middle {
  display: flex !important;
  flex: 1 !important;
  max-width: 780px !important;
}

.mj-topbar-search-form {
  flex: 1;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 !important;
}

.mj-prompt-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.mj-prompt-input-wrapper .mj-input-icon-left {
  position: absolute;
  left: 16px;
  color: var(--mj-text-muted);
  font-size: 14px;
  pointer-events: none;
}

.mj-prompt-input {
  width: 100%;
  height: 42px;
  background: var(--mj-surface) !important;
  border: 1px solid var(--mj-border) !important;
  border-radius: var(--mj-radius-pill) !important;
  padding: 0 74px 0 44px !important;
  color: var(--mj-text-primary) !important;
  font-size: 14px !important;
  outline: none !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.mj-prompt-input::placeholder {
  color: var(--mj-text-muted) !important;
  font-size: 13.5px !important;
}

.mj-prompt-input:focus {
  background: #17171d !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05) !important;
}

.mj-input-actions-right {
  position: absolute;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mj-filter-icon-btn,
.mj-search-submit-btn {
  background: transparent;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mj-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mj-filter-icon-btn:hover,
.mj-search-submit-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.header-right ul {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

/* ==========================================================================
   3. SUBNAV FILTER BAR
   ========================================================================== */
#king-body-wrapper {
  margin-left: var(--mj-sidebar-width) !important;
  width: calc(100% - var(--mj-sidebar-width)) !important;
  padding: 0 28px 40px 28px !important;
  min-height: 100vh;
  box-sizing: border-box !important;
}

.leo-nav {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 16px 0 20px 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  width: 100% !important;
}

.mj-subnav-left {
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
}

.mj-dropdown-btn {
  background: transparent !important;
  border: none !important;
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  padding: 6px 0 !important;
  outline: none !important;
}

.mj-dropdown-btn i {
  font-size: 11px;
  color: var(--mj-text-muted);
  transition: transform 0.2s ease;
}

.mj-sort-dropdown {
  position: absolute;
  top: 38px;
  left: 0;
  background: #18181c;
  border: 1px solid var(--mj-border);
  border-radius: var(--mj-radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  padding: 6px;
  min-width: 170px;
  z-index: 100;
  display: none;
}

.mj-sort-dropdown.show {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mj-sort-dropdown a {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--mj-text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.mj-sort-dropdown a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.mj-subnav-likes-link {
  color: #8a8997 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 12px !important;
  border-radius: var(--mj-radius-pill) !important;
  transition: all 0.18s ease !important;
}

.mj-subnav-likes-link:hover,
.mj-subnav-likes-link.active {
  color: var(--mj-text-primary) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.mj-subnav-right {
  display: flex;
  align-items: center;
  background: var(--mj-surface);
  border: 1px solid var(--mj-border);
  border-radius: var(--mj-radius-pill);
  padding: 3px;
  gap: 2px;
}

.mj-pill-tab {
  padding: 6px 16px;
  border-radius: var(--mj-radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--mj-text-secondary) !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
}

.mj-pill-tab i {
  font-size: 12px;
}

.mj-pill-tab:hover {
  color: var(--mj-text-primary) !important;
}

.mj-pill-tab.active {
  background: var(--mj-accent) !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 2px 10px var(--mj-accent-glow);
}

.leo-range,
.leo-nav .king-nav-sub-list {
  display: none !important;
}

/* ==========================================================================
   4. MASONRY GALLERY GRID & 5/6 COLUMNS
   ========================================================================== */
.king-part-q-list,
.king-q-list {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Force Midjourney Responsive Columns on ALL Box Classes and .grid-sizer */
.grid-sizer,
.box,
.box.king-q-list-item,
.column-1 .box,
.column-2 .box,
.column-3 .box,
.column-4 .box,
.column-5 .box,
.column-6 .box,
.column-7 .box,
.column-8 .box {
  width: 20% !important; /* 5 columns by default on standard desktop */
  max-width: 20% !important;
  box-sizing: border-box !important;
  padding: 6px 8px !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.grid-sizer {
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  visibility: hidden !important;
  border: none !important;
  pointer-events: none !important;
}

.rightsidebar {
  display: none !important;
}

@media (min-width: 1800px) {
  .grid-sizer,
  .box,
  .box.king-q-list-item,
  .column-1 .box, .column-2 .box, .column-3 .box, .column-4 .box, .column-5 .box, .column-6 .box {
    width: 16.666% !important; /* 6 columns on wide screen (1920px) */
    max-width: 16.666% !important;
  }
}

@media (max-width: 1499px) and (min-width: 1100px) {
  .grid-sizer,
  .box,
  .box.king-q-list-item,
  .column-1 .box, .column-2 .box, .column-3 .box, .column-4 .box, .column-5 .box, .column-6 .box {
    width: 25% !important; /* 4 columns on medium screen */
    max-width: 25% !important;
  }
}

@media (max-width: 1099px) and (min-width: 768px) {
  .grid-sizer,
  .box,
  .box.king-q-list-item,
  .column-1 .box, .column-2 .box, .column-3 .box, .column-4 .box, .column-5 .box, .column-6 .box {
    width: 33.333% !important; /* 3 columns on tablet */
    max-width: 33.333% !important;
  }
}

@media (max-width: 767px) {
  .grid-sizer,
  .box,
  .box.king-q-list-item,
  .column-1 .box, .column-2 .box, .column-3 .box, .column-4 .box, .column-5 .box, .column-6 .box {
    width: 50% !important; /* 2 columns on mobile */
    max-width: 50% !important;
    padding: 4px !important;
  }
}

.post-featured-img {
  display: block !important;
  position: relative !important;
  border-radius: var(--mj-radius-md) !important;
  overflow: hidden !important;
  background: #18171f !important;
  width: 100% !important;
}

.post-featured-img img.item-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: var(--mj-radius-md) !important;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.2s ease, opacity 0.3s ease !important;
}

.box.king-q-list-item:hover .post-featured-img img.item-img {
  transform: scale(1.03);
  filter: brightness(0.92);
}

.king-post-upbtn {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  z-index: 10 !important;
  opacity: 0 !important;
  transform: translateY(-4px) !important;
  transition: all 0.2s ease !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

.box.king-q-list-item:hover .king-post-upbtn {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.king-post-upbtn a,
.king-post-upbtn span,
.king-post-upbtn button {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  background: rgba(12, 11, 14, 0.75) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
  font-size: 13px !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4) !important;
}

.king-post-upbtn a:hover,
.king-post-upbtn button:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  transform: scale(1.08) !important;
}

/* ==========================================================================
   5. MIDJOURNEY LIGHTBOX MODAL
   ========================================================================== */
.mfp-bg {
  background: rgba(8, 8, 10, 0.94) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  opacity: 1 !important;
  z-index: 99990 !important;
}

.mfp-wrap {
  z-index: 99995 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.mfp-container {
  padding: 16px 20px !important;
  height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.mfp-content {
  width: 96vw !important;
  max-width: 1600px !important;
  height: 92vh !important;
  max-height: 950px !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  gap: 16px !important;
}

.mj-modal-media-col,
.mfp-content .king-video,
.mfp-content .king-video-in {
  flex: 1 !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  border-radius: var(--mj-radius-lg) !important;
  overflow: hidden !important;
  background: rgba(0, 0, 0, 0.3) !important;
  padding: 0 !important;
  margin: 0 !important;
}

.mfp-content .king-gallery,
.mfp-content .owl-carousel,
.mfp-content .owl-stage-outer,
.mfp-content .owl-stage,
.mfp-content .owl-item,
.mfp-content .king-gallery-img,
.mfp-content .king-gallery-imgs {
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
}

.mfp-content .gallery-img {
  max-width: 100% !important;
  max-height: 88vh !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border-radius: var(--mj-radius-md) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6) !important;
  margin: auto !important;
}

.mfp-content .rightview {
  width: 380px !important;
  min-width: 360px !important;
  max-width: 400px !important;
  height: 100% !important;
  background: var(--mj-surface) !important;
  border: 1px solid var(--mj-border) !important;
  border-radius: var(--mj-radius-lg) !important;
  padding: 24px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

.mfp-content .rightview::-webkit-scrollbar {
  width: 4px;
}
.mfp-content .rightview::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.mj-detail-author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--mj-border);
}

.mj-detail-author-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mj-detail-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #2a2a32;
}

.mj-detail-author-meta {
  display: flex;
  flex-direction: column;
}

.mj-detail-author-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--mj-text-primary);
  text-decoration: none !important;
}

.mj-detail-author-time {
  font-size: 12px;
  color: var(--mj-text-muted);
}

.mj-detail-author-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mj-detail-action-icon {
  color: var(--mj-text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: transparent;
  border: none;
  outline: none;
}

.mj-detail-action-icon:hover {
  color: var(--mj-accent);
}

.mfp-content .pheader h1 {
  font-size: 16px !important;
  color: #fff !important;
  font-weight: 600 !important;
  margin: 0 0 10px 0 !important;
  line-height: 1.4 !important;
}

.mfp-content .post-content {
  font-size: 14px !important;
  line-height: 1.6 !important;
  color: #e5e5eb !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid var(--mj-border) !important;
  border-radius: var(--mj-radius-md) !important;
  padding: 16px !important;
  max-height: 280px !important;
  overflow-y: auto !important;
  word-break: break-word !important;
}

.prompt-buttons-container {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  margin-top: 14px !important;
}

#copyp,
.mj-btn-copy-prompt {
  width: 100% !important;
  height: 44px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: var(--mj-radius-md) !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#copyp:hover,
.mj-btn-copy-prompt:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-1px) !important;
}

.btn-tutorial-video {
  width: 100% !important;
  height: 38px !important;
  border-radius: var(--mj-radius-md) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--mj-border) !important;
  color: var(--mj-text-secondary) !important;
  font-size: 13px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
}

.btn-tutorial-video:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

.mj-modal-thumbnail-rail {
  width: 68px;
  min-width: 68px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 2px;
}

.mj-modal-thumbnail-rail::-webkit-scrollbar {
  width: 0;
}

.mj-rail-thumb {
  width: 62px;
  height: 62px;
  border-radius: var(--mj-radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.mj-rail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mj-rail-thumb:hover {
  transform: scale(1.06);
  border-color: rgba(255, 255, 255, 0.4);
}

.mj-rail-thumb.active {
  border-color: var(--mj-accent) !important;
}

.mfp-close {
  top: 20px !important;
  right: 24px !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  font-size: 20px !important;
  line-height: 34px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  z-index: 99999 !important;
}

.mfp-close:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  transform: rotate(90deg) !important;
}

.mfp-close:after {
  content: "✕" !important;
  font-family: inherit !important;
  font-size: 16px !important;
}

.king-close-detail-btn {
  display: none !important;
}

/* ==========================================================================
   6. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1200px) {
  .mfp-content {
    max-width: 98vw !important;
    gap: 12px !important;
  }
  .mj-modal-thumbnail-rail {
    display: none !important;
  }
}

@media (max-width: 1024px) {
  :root {
    --mj-sidebar-width: 0px;
  }

  .leftmenu {
    transform: translateX(-100%) !important;
    width: 260px !important;
  }

  .leftmenu.open,
  .king-body.active .leftmenu {
    transform: translateX(0) !important;
  }

  .king-headerf {
    margin-left: 0 !important;
    width: 100% !important;
  }

  #king-body-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 0 16px 30px 16px !important;
  }

  #ltoggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--mj-surface);
    border: 1px solid var(--mj-border);
    color: #fff;
    cursor: pointer;
  }
  #ltoggle:before {
    content: "\f0c9";
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 16px;
  }
  .header-left {
    display: flex !important;
  }
}

@media (max-width: 768px) {
  .leo-nav {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .mj-subnav-right {
    width: 100%;
    justify-content: space-around;
  }

  .mfp-content {
    flex-direction: column !important;
    height: auto !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
  }

  .mfp-content .rightview {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    height: auto !important;
  }

  .mfp-content .gallery-img {
    max-height: 50vh !important;
  }
}

/* ==========================================================================
   7. MIDJOURNEY EXPLORE DETAIL PAGE (body.king-template-question)
   100vh Fullscreen Viewport, No Global Chrome, Centered Stage & Right Rail
   ========================================================================== */

body.king-template-question {
  height: 100vh !important;
  width: 100vw !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #08080a !important;
}

/* Hide global layout chrome on detail page */
body.king-template-question .king-headerf,
body.king-template-question #king-header,
body.king-template-question .leftmenu,
body.king-template-question .king-footer,
body.king-template-question #footer,
body.king-template-question .leo-nav,
body.king-template-question .king-body-search-up,
body.king-template-question .viewtop,
body.king-template-question .pboxes,
body.king-template-question .socialshare,
body.king-template-question .ad-below,
body.king-template-question .prev-next,
body.king-template-question .king-part-q-list,
body.king-template-question .sidepanel,
body.king-template-question .share-link,
body.king-template-question #ltoggle {
  display: none !important;
}

/* Root wrappers full viewport */
body.king-template-question .king-body,
body.king-template-question #lmenu,
body.king-template-question #king-body-wrapper,
body.king-template-question #container,
body.king-template-question .container {
  margin: 0 !important;
  padding: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  background: #08080a !important;
}

/* 3-Column Midjourney Flex Layout */
body.king-template-question .king-main {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #08080a !important;
}

/* COLUMN 1: Center Artwork Stage */
body.king-template-question .king-video-in#mjArtworkStage {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  height: 100vh !important;
  max-height: 100vh !important;
  background: #08080a !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  padding: 24px 36px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

html.king-lnight body.king-template-question .king-video,
body.king-template-question .king-video,
body.king-template-question .king-video-in {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  position: relative !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

body.king-template-question .a-count,
body.king-template-question .king-voting,
body.king-template-question .voting,
body.king-template-question .king-vote-buttons-netup,
body.king-template-question .king-vote-buttons-netdown,
body.king-template-question .vote-container {
  display: none !important;
}

body.king-template-question .king-gallery,
body.king-template-question .king-gallery-img,
body.king-template-question .king-gallery-imgs {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.king-template-question .gallery-img {
  max-height: calc(100vh - 48px) !important;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border-radius: 14px !important;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.07) !important;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease !important;
  display: block !important;
  margin: auto !important;
}

/* Close Button (top-right of stage) */
body.king-template-question .king-close-detail-btn {
  display: flex !important;
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  font-size: 16px !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 50 !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
}

body.king-template-question .king-close-detail-btn:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  transform: scale(1.08) !important;
  color: #fff !important;
}

/* Download button if present */
body.king-template-question .aidown {
  position: absolute !important;
  bottom: 24px !important;
  left: 24px !important;
  z-index: 40 !important;
}
body.king-template-question .aidown button {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  background: rgba(20, 20, 25, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(8px) !important;
  color: #fff !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}
body.king-template-question .aidown button:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  transform: scale(1.06) !important;
}

/* COLUMN 2: Right Info Panel */
body.king-template-question .king-main-leo {
  flex: 0 0 380px !important;
  width: 380px !important;
  min-width: 380px !important;
  max-width: 380px !important;
  height: 100vh !important;
  max-height: 100vh !important;
  background: #111115 !important;
  border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 24px 20px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  z-index: 20 !important;
}

body.king-template-question .king-main-in,
body.king-template-question .king-q-view,
body.king-template-question .rightview {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Midjourney Author Row */
.mj-detail-author-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 16px !important;
  padding-bottom: 14px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.mj-detail-author-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.mj-detail-author-avatar img {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.mj-detail-author-meta {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.mj-detail-author-name {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #fff !important;
  text-decoration: none !important;
  letter-spacing: -0.2px !important;
}

.mj-detail-author-name:hover {
  color: #ff79c6 !important;
}

.mj-detail-author-time {
  font-size: 11.5px !important;
  color: #888894 !important;
}

.mj-detail-author-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.mj-detail-action-icon {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #94949f !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.mj-detail-action-icon:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
}

/* Post Title */
body.king-template-question .pheader h1,
body.king-template-question .entry-title {
  font-size: 18px !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  margin: 0 0 14px 0 !important;
  line-height: 1.4 !important;
  letter-spacing: -0.2px !important;
}

/* Category badge */
body.king-template-question .king-category {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #c9c9d4 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 3px 9px !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  margin-bottom: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

/* Prompt Box */
.mj-detail-content-box {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}

.mj-prompt-section {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  position: relative !important;
}

.mj-prompt-label {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #7e7e8c !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
  margin-bottom: 8px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.mj-prompt-text {
  font-size: 13.5px !important;
  line-height: 1.55 !important;
  color: #ececee !important;
  max-height: 220px !important;
  overflow-y: auto !important;
  word-break: break-word !important;
}

/* Parameter pills (ar 3:4, etc.) */
.mj-prompt-params {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin-top: 12px !important;
  padding-top: 10px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.mj-param-badge {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 6px !important;
  padding: 3px 8px !important;
  font-size: 11px !important;
  color: #9c9ca8 !important;
  font-family: monospace, sans-serif !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

/* 3 Action Buttons */
.mj-action-buttons-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  margin-top: 8px !important;
}

.mj-btn-action {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;
  width: 100% !important;
  padding: 12px 18px !important;
  border-radius: 10px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
  outline: none !important;
}

/* 1. Chỉnh Sửa Ảnh */
.mj-btn-edit-artwork {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35) !important;
}
.mj-btn-edit-artwork:hover {
  filter: brightness(1.1) !important;
  transform: translateY(-1.5px) !important;
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.45) !important;
  color: #ffffff !important;
}

/* 2. Tăng Nét Ảnh */
.mj-btn-upscale-artwork {
  background: rgba(255, 255, 255, 0.07) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}
.mj-btn-upscale-artwork:hover {
  background: rgba(255, 255, 255, 0.13) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  transform: translateY(-1.5px) !important;
}

/* 3. Sao chép Prompt */
.mj-btn-copy-prompt {
  background: rgba(255, 255, 255, 0.03) !important;
  color: #c9c9d4 !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  font-weight: 500 !important;
}
.mj-btn-copy-prompt:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}
.mj-btn-copy-prompt.copied {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

/* Locked Notice & Button */
.mj-locked-notice {
  margin-top: 12px !important;
  padding-top: 12px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.07) !important;
}
.mj-locked-notice p {
  font-size: 12.5px !important;
  color: #fbbf24 !important;
  margin-bottom: 12px !important;
  line-height: 1.4 !important;
}
.mj-btn-unlock {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35) !important;
}
.mj-btn-unlock:hover {
  filter: brightness(1.1) !important;
  transform: translateY(-1.5px) !important;
  color: #ffffff !important;
}

/* Tags */
body.king-template-question .king-q-view-tags,
body.king-template-question .king-tag-list {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin-top: 14px !important;
  padding: 0 !important;
  list-style: none !important;
}
body.king-template-question .king-tag-link {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 6px !important;
  color: #888894 !important;
  font-size: 11.5px !important;
  padding: 3px 8px !important;
  text-decoration: none !important;
  transition: all 0.15s ease !important;
}
body.king-template-question .king-tag-link:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

/* COLUMN 3: Far Right Thumbnail Rail */
body.king-template-question .mj-modal-thumbnail-rail {
  flex: 0 0 76px !important;
  width: 76px !important;
  min-width: 76px !important;
  max-width: 76px !important;
  height: 100vh !important;
  max-height: 100vh !important;
  background: #0c0b0e !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 16px 8px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  box-sizing: border-box !important;
  z-index: 20 !important;
}

/* Custom Scrollbar for Rail & Right Panel */
body.king-template-question .mj-modal-thumbnail-rail::-webkit-scrollbar,
body.king-template-question .king-main-leo::-webkit-scrollbar,
body.king-template-question .mj-prompt-text::-webkit-scrollbar {
  width: 4px !important;
}
body.king-template-question .mj-modal-thumbnail-rail::-webkit-scrollbar-thumb,
body.king-template-question .king-main-leo::-webkit-scrollbar-thumb,
body.king-template-question .mj-prompt-text::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12) !important;
  border-radius: 4px !important;
}

.mj-rail-thumb {
  display: block !important;
  width: 60px !important;
  height: 60px !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  position: relative !important;
  border: 2px solid transparent !important;
  transition: all 0.2s ease !important;
  opacity: 0.65 !important;
}
.mj-rail-thumb:hover {
  opacity: 1 !important;
  transform: scale(1.05) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}
.mj-rail-thumb.active {
  opacity: 1 !important;
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.5) !important;
}
.mj-rail-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

