/* Reels viewer page — full-height dark layout, footer flush at bottom */
html.page-reels {
  min-height: 100%;
  background: #000;
}

html.page-reels body {
  min-height: 100vh;
  background: #000;
  margin: 0;
}

html.page-reels .footer-area {
  width: 100%;
  margin-top: 0 !important;
}

html.page-reels .footer-copyright-area {
  margin: 0;
}

/* Mobile viewer: no footer/header chrome — fill the viewport so swipe doesn't scroll the page */
@media (max-width: 767px) {
  html.page-reels,
  html.page-reels body {
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
  }

  html.page-reels .main-header-area,
  html.page-reels .footer-area,
  html.page-reels .footer-copyright-area {
    display: none !important;
  }

  html.page-reels .reels-page {
    position: fixed;
    inset: 0;
    z-index: 40;
  }
}

.reels-page {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 76px);
  box-sizing: border-box;
  padding-top: 88px;
  background: #000;
  color: #fff;
  margin-top: 0;
}

.reels-sidebar-left {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 20px 12px 32px 16px;
  border-inline-end: 1px solid #242526;
  align-self: stretch;
  background: #000;
  box-sizing: border-box;
  overflow: visible;
}
.reels-sidebar-brand {
  display: block;
  width: 100%;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  padding: 8px 14px 4px;
  color: #fff;
  line-height: 1.4;
  overflow: visible;
}
.reels-side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 0;
}
.reels-side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  color: #e4e6eb;
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  transition: background 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
}
.reels-side-nav a:hover {
  background: #18191a;
  color: #fff;
}
.reels-side-nav a.active {
  background: #3a3b3c;
  color: #fff;
}
.reels-side-nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
  color: #fff;
}
.reels-side-nav a.active .reels-side-nav-icon {
  background: transparent;
}
.reels-side-nav-icon i {
  font-size: 20px;
  line-height: 1;
}
.reels-side-nav-label {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}
.reels-side-nav .reels-badge {
  margin-left: 0;
  margin-inline-start: auto;
}

/* Keep site header text from looking cramped on Reels */
html.page-reels .main-header.header-transparent,
html.page-reels .header-sticky.sticky {
  min-height: 80px !important;
}
html.page-reels .main-header-area .main-nav > ul > li {
  padding-top: 22px;
  padding-bottom: 22px;
}
html.page-reels .main-header-area .main-nav > ul.nav > li > a {
  line-height: 1.35;
  padding-top: 6px;
  padding-bottom: 6px;
}

/* Mobile/tablet bottom nav (sidebar is desktop-only) */
.reels-mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  background: rgba(15, 15, 15, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid #262626;
  padding: 8px 4px calc(12px + env(safe-area-inset-bottom, 0px));
}

.reels-mobile-nav a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  padding: 4px 2px 6px;
  color: #b5b5b5;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.45;
  overflow: visible;
}

.reels-mobile-nav a i {
  font-size: 20px;
  line-height: 1;
}

.reels-mobile-nav a.active,
.reels-mobile-nav a:hover,
.reels-mobile-nav a:focus {
  color: #fff;
}

.reels-mobile-nav a span {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  max-width: 100%;
  line-height: 1.5;
  padding-bottom: 2px;
}

.reels-mobile-nav-badge {
  position: absolute;
  top: 0;
  inset-inline-end: 14%;
}
.reels-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 24px 40px;
  min-height: 360px;
  background: #000;
}

.reels-player-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 980px;
  min-height: min(620px, calc(100vh - 200px));
  max-height: calc(100vh - 180px);
  padding-inline-end: 220px;
  box-sizing: border-box;
}

html[dir="rtl"] .reels-player-wrap {
  padding-inline-end: 220px;
  padding-right: 0;
  padding-left: 0;
}

.reels-player-core {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
}

.reels-video-box {
  position: relative;
  width: min(420px, calc(100vw - 560px));
  flex-shrink: 0;
  aspect-ratio: 9/16;
  max-height: calc(100vh - 180px);
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.65);
  cursor: pointer;
}

.reels-video-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  pointer-events: none;
  background: #000;
}

.reels-video-box.is-video-playing .reels-video-poster {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.reels-video-box.is-slide-out-up {
  animation: reelsSlideOutUp 0.26s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.reels-video-box.is-slide-in-up {
  animation: reelsSlideInUp 0.34s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.reels-video-box.is-slide-out-down {
  animation: reelsSlideOutDown 0.26s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.reels-video-box.is-slide-in-down {
  animation: reelsSlideInDown 0.34s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes reelsSlideOutUp {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-100%); opacity: 0.35; }
}

@keyframes reelsSlideInUp {
  from { transform: translateY(100%); opacity: 0.35; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes reelsSlideOutDown {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(100%); opacity: 0.35; }
}

@keyframes reelsSlideInDown {
  from { transform: translateY(-100%); opacity: 0.35; }
  to { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .reels-video-box.is-slide-out-up,
  .reels-video-box.is-slide-in-up,
  .reels-video-box.is-slide-out-down,
  .reels-video-box.is-slide-in-down {
    animation: none;
  }
}

.reels-video-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
  position: relative;
  z-index: 1;
  pointer-events: none;
  opacity: 1;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.reels-video-scrim {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
  pointer-events: none;
  z-index: 3;
}

.reels-mute-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

html[dir="rtl"] .reels-mute-btn {
  left: auto;
  right: 12px;
}

.reels-info {
  position: absolute;
  left: 14px;
  right: 72px;
  bottom: 14px;
  z-index: 5;
  pointer-events: none;
  text-align: start;
}

html[dir="rtl"] .reels-info {
  left: 72px;
  right: 14px;
}

.reels-category-pill {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  margin-bottom: 8px;
}

.reels-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.95;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  margin-bottom: 6px;
}

.reels-author-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.reels-author-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  flex-shrink: 0;
  font-size: 14px;
}

.reels-author-fallback .fa {
  line-height: 1;
}

.reels-desc {
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: break-word;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  pointer-events: auto;
  cursor: pointer;
  max-width: 100%;
}

.reels-desc.is-expanded {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  display: block;
}

.reels-desc.is-empty {
  display: none;
}

/* Facebook-style navigation & engagement */
.reels-fb-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(24, 24, 24, 0.45);
  color: #f5f5f5;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.reels-fb-btn:hover:not(:disabled):not(.is-disabled) {
  background: rgba(58, 58, 58, 0.72);
  border-color: rgba(255, 255, 255, 0.38);
}

.reels-fb-btn:active:not(:disabled):not(.is-disabled) {
  transform: scale(0.96);
}

.reels-fb-btn i {
  font-size: 22px;
  line-height: 1;
  pointer-events: none;
  opacity: 0.92;
}

.reels-dpad {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: grid;
  grid-template-columns: 56px 56px 56px;
  grid-template-rows: 56px 56px 56px;
  gap: 10px;
  align-items: center;
  justify-items: center;
  z-index: 5;
}

html[dir="rtl"] .reels-dpad {
  right: auto;
  left: 0;
}

.reels-dpad #reelsPrevBtn {
  grid-column: 2;
  grid-row: 1;
}

.reels-dpad #reelsCatPrevBtn {
  grid-column: 1;
  grid-row: 2;
}

.reels-dpad-hub {
  grid-column: 2;
  grid-row: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(24, 24, 24, 0.35);
  pointer-events: none;
}

.reels-dpad #reelsCatNextBtn {
  grid-column: 3;
  grid-row: 2;
}

.reels-dpad #reelsNextBtn {
  grid-column: 2;
  grid-row: 3;
}

.reels-dpad-btn {
  margin: 0;
}

.reels-share-open {
  overflow: hidden;
}

.reels-notice-open {
  overflow: hidden;
}

.reels-notice-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.reels-notice-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.reels-notice-card {
  position: relative;
  width: min(380px, 100%);
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e8e8e8;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.22);
  color: #161616;
  padding: 24px 22px 20px;
  text-align: center;
}

.reels-notice-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 1px solid #e5e5e5;
  background: #f7f7f7;
  color: #444;
}

.reels-notice-icon.is-success {
  color: #0d8bd9;
  border-color: #b8e4ff;
  background: #eef8ff;
}

.reels-notice-icon.is-error {
  color: #d32f2f;
  border-color: #ffcdd2;
  background: #ffebee;
}

.reels-notice-icon.is-login,
.reels-notice-icon.is-info {
  color: #333;
  background: #f3f3f3;
}

.reels-notice-title {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 700;
  color: #111;
}

.reels-notice-message {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.5;
  color: #555;
}

.reels-notice-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.reels-notice-btn {
  min-width: 110px;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: #111;
  color: #fff;
  transition: background 0.15s ease, transform 0.15s ease;
}

.reels-notice-btn:hover {
  background: #333;
  transform: translateY(-1px);
}

.reels-notice-btn-secondary {
  background: #fff;
  color: #333;
  border: 1px solid #d0d0d0;
}

.reels-notice-btn-secondary:hover {
  background: #f5f5f5;
}

.reels-share-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.reels-share-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
}

.reels-share-card {
  position: relative;
  width: min(420px, calc(100vw - 24px));
  margin: 80px auto 24px;
  border-radius: 14px;
  background: #fff;
  color: #161616;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.38);
  padding: 16px;
}

.reels-share-close {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #333;
  cursor: pointer;
}

html[dir="rtl"] .reels-share-close {
  left: auto;
  right: 10px;
}

.reels-share-title {
  margin: 0 0 14px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
}

.reels-share-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #ececec;
  border-radius: 10px;
  background: #f7f7f7;
  padding: 8px;
  margin-bottom: 14px;
}

.reels-share-preview-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: #d8d8d8;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #777;
  flex-shrink: 0;
}

.reels-share-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reels-share-preview-body {
  min-width: 0;
}

.reels-share-preview-user {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.reels-share-preview-desc {
  font-size: 12px;
  color: #444;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reels-share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.reels-share-option {
  border: 1px solid #e5e5e5;
  background: #fff;
  border-radius: 10px;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  color: #222;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.reels-share-option:hover {
  background: #f2f6ff;
  border-color: #c9dcff;
}

.reels-share-option i {
  font-size: 18px;
}

.reels-share-option span {
  font-size: 13px;
  font-weight: 600;
}

.reels-engage-rail {
  position: absolute;
  right: 10px;
  bottom: 88px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  pointer-events: auto;
}

html[dir="rtl"] .reels-engage-rail {
  right: auto;
  left: 10px;
}

.reels-engage-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  text-align: center;
  padding: 0;
  min-width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: auto;
  transition: transform 0.15s ease;
}

.reels-engage-btn:hover {
  transform: scale(1.06);
}

.reels-engage-btn i {
  font-size: 30px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.65));
}

.reels-engage-btn span {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.reels-engage-btn.liked i {
  color: #4599ff;
}

.reels-engage-btn.liked i.fa::before {
  content: "\f164";
}

.reels-engage-btn.is-busy {
  cursor: pointer;
}

.reels-engage-btn.liked {
  animation: reels-like-pop 0.28s ease;
}

@keyframes reels-like-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.reels-viewer-nav-btn.is-disabled,
.reels-cat-nav.is-disabled {
  opacity: 0.28;
  cursor: not-allowed;
  pointer-events: none;
}

.reels-cat-nav {
  align-self: center;
}

html[dir="rtl"] .reels-cat-nav i.fa-chevron-left::before {
  content: "\f054";
}

html[dir="rtl"] .reels-cat-nav i.fa-chevron-right::before {
  content: "\f053";
}

/* Legacy viewer button aliases */
.reels-viewer-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
}

/* Legacy aliases kept for any cached markup */
.reels-action-btn, .reels-nav-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.reels-video-box .reels-text-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.reels-video-box .reel-text-overlay {
  z-index: 4;
}

.reels-cat-tabs{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin-top:16px;max-width:640px}
.reels-cat-tab{border:1px solid #444;background:#1a1a1a;color:#ddd;border-radius:999px;padding:6px 14px;font-size:13px;cursor:pointer}
.reels-cat-tab.active{background:#fff;color:#111;border-color:#fff}
.reels-empty{text-align:center;padding:40px 20px}
.reels-badge{background:#e53935;color:#fff;border-radius:999px;padding:2px 8px;font-size:11px;margin-left:6px}
.reels-manage-card{background:#fff;color:#222;border-radius:12px;padding:14px;margin-bottom:12px;display:flex;gap:12px;align-items:flex-start;box-shadow:0 2px 8px rgba(0,0,0,.08)}
.reels-manage-thumb{width:88px;height:88px;border-radius:8px;object-fit:cover;background:#e8e8e8;flex-shrink:0}
.reels-manage-thumb.reels-yt-thumb-pending{background:linear-gradient(135deg,#d8d8d8 25%,#ececec 50%,#d8d8d8 75%);background-size:200% 100%;animation:reels-thumb-shimmer 1.2s ease-in-out infinite}
.reels-thumb-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;background:linear-gradient(135deg,#2a2a2a,#1a1a1a);color:#aaa;font-size:11px;gap:4px;overflow:hidden}
.reels-thumb-placeholder i{font-size:28px;color:#666;line-height:1}
.reels-approval-thumb.reels-thumb-placeholder{height:200px;width:100%;border-radius:0}
.reels-manage-thumb.reels-thumb-placeholder{width:88px;height:88px;border-radius:8px}
.reels-manage-body{flex:1;min-width:0}
.reels-manage-actions{display:flex;flex-direction:column;gap:8px}
@media(max-width:991px){
  .reels-page{padding-top:84px;min-height:calc(100vh - 68px)}
  .reels-player-wrap{padding-right:180px;min-height:0}
  html[dir="rtl"] .reels-player-wrap{padding-left:180px;padding-right:0}
  .reels-dpad{
    grid-template-columns:50px 50px 50px;
    grid-template-rows:50px 50px 50px;
    gap:8px;
  }
  .reels-video-box{width:min(360px,calc(100vw - 220px));max-height:calc(100vh - 260px)}
  .reels-fb-btn{width:50px;height:50px}
  .reels-fb-btn i{font-size:20px}
}
@media(max-width:767px){
  .reels-page{
    padding-top: 0;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  .reels-stage{
    padding: 0;
    flex: 1;
    min-height: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
  }
  .reels-player-wrap{
    padding-right: 0;
    padding-bottom: 0;
    min-height: 100%;
    max-height: none;
    width: 100%;
    max-width: none;
    height: 100%;
  }
  html[dir="rtl"] .reels-player-wrap{
    padding-left: 0;
    padding-bottom: 0;
  }
  /* Swipe replaces on-screen arrows on phones */
  .reels-dpad{
    display: none !important;
  }
  .reels-player-core{
    width: 100%;
    height: 100%;
  }
  .reels-video-box{
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
    aspect-ratio: auto;
  }
  .reels-fb-btn{width:46px;height:46px}
  .reels-fb-btn i{font-size:18px}
  .reels-engage-btn i{font-size:26px}
  .reels-share-card{margin-top:24px}
  /* Keep reel info/actions clear of the fixed bottom nav */
  .reels-info{bottom:calc(76px + env(safe-area-inset-bottom, 0px))}
  .reels-engage-rail{bottom:calc(150px + env(safe-area-inset-bottom, 0px))}
}

/* ========== Reels inner pages (add, manage, approvals, settings) ========== */
html.page-reels-inner {
  background: #ececec;
}

html.page-reels-inner body {
  background: #ececec;
  margin: 0;
}

.reels-inner-shell {
  min-height: calc(100vh - 60px);
  box-sizing: border-box;
  background: #ececec;
}

html.page-reels-inner .breadcrumbs-area.reels-inner-breadcrumb {
  padding-top: calc(72px + 44px);
  padding-bottom: 44px;
  margin-top: 0;
}

html.page-reels-inner .footer-area {
  width: 100%;
  margin-top: 0 !important;
}

.reels-subnav {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.reels-subnav .reels-inner-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.reels-subnav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  color: #333;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid #e0e0e0;
  background: #fafafa;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.reels-subnav-link:hover {
  background: #f0f0f0;
  color: #000;
  text-decoration: none;
}

.reels-subnav-link.active {
  background: #000;
  color: #fff;
  border-color: #000;
}

.reels-inner-body {
  padding: 32px 0 56px;
}

.reels-inner-container {
  max-width: 1100px;
}

.reels-panel {
  background: #fff;
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
}

.reels-panel-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 20px;
  color: #111;
}

.reels-editor-layout {
  max-width: 100%;
  margin: 0;
}

.reels-editor-step2 {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 28px;
  align-items: start;
}

.reels-editor-preview {
  position: relative;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  max-width: 100%;
  margin: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.reels-editor-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.reels-editor-tools {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-top: 0;
  border: 1px solid #eee;
}

.reels-cat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 8px;
}

.reels-cat-card {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 22px 12px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
  font-weight: 600;
  font-size: 15px;
  background: #fafafa;
}

.reels-cat-card:hover {
  border-color: #999;
  background: #f0f0f0;
}

.reels-cat-card.selected {
  border-color: #000;
  background: #000;
  color: #fff;
}

.reels-upload-zone {
  border: 2px dashed #ccc;
  border-radius: 12px;
  padding: 24px;
  background: #fafafa;
  margin-top: 8px;
}

.reels-upload-zone input[type="file"] {
  width: 100%;
}

.reels-manage-card {
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}

.reels-approval-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  height: 100%;
  border: 1px solid #eee;
}

.reels-approval-card .card-img-top {
  height: 200px;
  object-fit: cover;
  width: 100%;
}

.reels-approval-card .reels-approval-thumb:not(img) {
  height: 200px;
  width: 100%;
}

.reels-approval-media {
  position: relative;
  cursor: pointer;
  background: #1a1a1a;
  min-height: 200px;
  display: block;
  border: 0;
  padding: 0;
  width: 100%;
  text-align: inherit;
  overflow: hidden;
}

.reels-approval-media .reels-yt-thumb-img,
.reels-approval-media .reels-approval-thumb-inner,
.reels-approval-media img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: #e8e8e8;
}

.reels-yt-thumb-img.reels-yt-thumb-pending {
  background: linear-gradient(135deg, #d8d8d8 25%, #ececec 50%, #d8d8d8 75%);
  background-size: 200% 100%;
  animation: reels-thumb-shimmer 1.2s ease-in-out infinite;
}

@keyframes reels-thumb-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.reels-muted-badge {
  display: inline-block;
  background: #333;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.reels-approval-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
  pointer-events: none;
}

.reels-approval-media:hover .reels-approval-play-overlay {
  background: rgba(0, 0, 0, 0.42);
}

.reels-approval-play-overlay i {
  font-size: 52px;
  line-height: 1;
  opacity: 0.95;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

#reelsApproveModal .reels-approve-editor-wrap {
  background: #f8f8f8;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid #eee;
}

#reelsApproveModal .reels-wa-preview {
  max-width: 280px;
}

#reelsApproveModal .reels-wa-toolbar {
  margin-top: 4px;
}

.reels-num-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f4f4f4;
  border: 1px solid #e3e3e3;
  border-radius: 999px;
  padding: 6px 8px;
}

.reels-num-stepper-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border: none !important;
  border-radius: 50%;
  color: #fff !important;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.reels-num-stepper-btn span {
  display: block;
  transform: translateY(-1px);
}

.reels-num-stepper-btn--minus {
  background: #e53935 !important;
}

.reels-num-stepper-btn--minus:hover {
  background: #c62828 !important;
}

.reels-num-stepper-btn--plus {
  background: #2e7d32 !important;
}

.reels-num-stepper-btn--plus:hover {
  background: #1b5e20 !important;
}

.reels-num-stepper-input {
  text-align: center;
  font-weight: 800;
  font-size: 20px;
  height: 42px;
  border-radius: 12px !important;
  border: none !important;
  background: #fff !important;
  box-shadow: inset 0 0 0 1px #ddd;
}

.reels-approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

/* Theme resets all .btn to transparent — restore visible buttons on Reels pages */
.reels-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  line-height: 1.35;
  cursor: pointer;
  text-decoration: none;
  min-width: 100px;
}

.reels-btn-approve {
  background: #111;
  color: #fff !important;
  border-color: #111;
}

.reels-btn-approve:hover {
  background: #333;
  color: #fff !important;
}

.reels-btn-reject {
  background: #fff;
  color: #c62828 !important;
  border-color: #e53935;
}

.reels-btn-reject:hover {
  background: #ffebee;
  color: #b71c1c !important;
}

.reels-btn-success {
  background: #25d366;
  color: #fff !important;
  border-color: #25d366;
}

.reels-btn-success:hover {
  background: #1ebe57;
  color: #fff !important;
}

.reels-btn-muted {
  background: #f5f5f5;
  color: #333 !important;
  border-color: #ddd;
}

.reels-panel-title-active {
  margin-top: 28px;
}

.reels-active-hint {
  margin: -8px 0 16px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
}

.reels-active-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e8f5e9;
  color: #1b5e20;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.reels-approval-actions .btn-delete {
  min-height: 44px;
}

.reels-btn-danger-solid {
  background: #c62828;
  color: #fff !important;
  border-color: #c62828;
}

.reels-btn-danger-solid:hover {
  background: #b71c1c;
  color: #fff !important;
}

.reels-action-btn.is-loading,
.reels-action-btn:disabled {
  opacity: 0.75;
  cursor: wait;
  pointer-events: none;
}

.reels-approvals-panel {
  position: relative;
}

.reels-approvals-loading {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 16px;
}

.reels-approvals-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 32px;
  color: #333;
  font-weight: 600;
  font-size: 15px;
}

.reels-approvals-loading-inner .fa-spinner {
  font-size: 28px;
  color: #111;
}

.reels-modal-busy {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  border-radius: inherit;
}

.reels-modal-busy.is-visible {
  display: flex;
}

.reels-modal-busy-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 28px;
  font-weight: 600;
  color: #333;
}

.reels-modal-busy-inner .fa-spinner {
  font-size: 26px;
  color: #111;
}

.reels-approval-video-wrap {
  position: relative;
  aspect-ratio: 9/16;
  max-height: 70vh;
  margin: 0 auto 16px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.reels-approval-video-wrap video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

#reelsApproveModal .reels-approval-video-wrap {
  max-width: 320px;
}

.reels-settings-card {
  max-width: 640px;
  margin: 0 auto;
}

@media (max-width: 991px) {
  html.page-reels-inner .breadcrumbs-area.reels-inner-breadcrumb {
    padding-top: calc(68px + 32px);
    padding-bottom: 32px;
  }

  .reels-cat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reels-editor-step2 {
    grid-template-columns: 1fr;
  }

  .reels-panel {
    padding: 20px 18px;
  }
}

@media (max-width: 767px) {
  html.page-reels-inner .breadcrumbs-area.reels-inner-breadcrumb {
    padding-top: 48px;
  }

  .reels-cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reels-subnav-link {
    padding: 8px 14px;
    font-size: 13px;
  }
}

/* ========== WhatsApp-style video editor ========== */
.reels-panel.reels-panel-editor-mode {
  padding: 20px 24px 32px;
  max-width: 920px;
  margin: 0 auto;
}

.reels-wa-editor-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.reels-wa-editor-title {
  font-weight: 700;
  font-size: 16px;
}

.reels-wa-preview-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  width: 100%;
}

.reels-wa-preview {
  margin: 0 auto;
}

.reels-wa-editor-tools .reels-editor-preview,
.reels-wa-preview.reels-editor-preview {
  position: relative;
  width: auto;
  height: auto;
  min-width: 180px;
  min-height: 280px;
  max-width: min(100%, 720px);
  max-height: min(75vh, 640px);
  aspect-ratio: var(--reels-ar, 9 / 16);
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  margin: 0 auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  transition: width 0.25s ease, aspect-ratio 0.25s ease;
  flex-shrink: 0;
}

.reels-wa-editor-tools .reels-editor-preview video,
.reels-wa-preview.reels-editor-preview video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
  transition: object-fit 0.2s ease;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.reels-video-codec-warn {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  text-align: center;
  pointer-events: none;
}

.reels-video-codec-warn i {
  font-size: 28px;
  color: #ffc107;
}

.reels-video-codec-warn p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  max-width: 240px;
}

.reels-wa-editor-tools .reels-editor-preview.reels-crop-active video,
.reels-wa-preview.reels-editor-preview.reels-crop-active video {
  object-fit: cover;
  max-width: none;
}

.reels-crop-overlay {
  position: absolute;
  z-index: 5;
  pointer-events: auto;
  touch-action: none;
}

.reels-crop-overlay[hidden] {
  display: none !important;
}

.reels-crop-box {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  cursor: move;
  touch-action: none;
}

.reels-crop-handle {
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border: 2px solid #25d366;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.reels-crop-handle[data-handle="nw"] { left: -9px; top: -9px; cursor: nwse-resize; }
.reels-crop-handle[data-handle="ne"] { right: -9px; top: -9px; cursor: nesw-resize; }
.reels-crop-handle[data-handle="sw"] { left: -9px; bottom: -9px; cursor: nesw-resize; }
.reels-crop-handle[data-handle="se"] { right: -9px; bottom: -9px; cursor: nwse-resize; }
.reels-crop-handle[data-handle="n"] {
  left: 50%;
  top: -9px;
  transform: translateX(-50%);
  cursor: ns-resize;
  width: 22px;
  height: 14px;
}
.reels-crop-handle[data-handle="s"] {
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  cursor: ns-resize;
  width: 22px;
  height: 14px;
}
.reels-crop-handle[data-handle="w"] {
  left: -9px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
  width: 14px;
  height: 22px;
}
.reels-crop-handle[data-handle="e"] {
  right: -9px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
  width: 14px;
  height: 22px;
}

.reels-wa-preview.reels-crop-editing {
  touch-action: none;
}

.reels-text-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.reels-text-layer .reels-text-item {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: move;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  white-space: pre-wrap;
  text-align: center;
  max-width: 90%;
  user-select: none;
  padding: 4px 8px;
  border: 2px dashed transparent;
  border-radius: 4px;
}

/* Font picker: preview each option in its own typeface */
select[id$="OverlayFont"] option {
  font-size: 15px;
}

.reels-text-layer .reels-text-item.dragging,
.reels-text-layer .reels-text-item:hover,
.reels-text-layer .reels-text-item.selected {
  border-color: rgba(255, 255, 255, 0.65);
}

.reels-wa-preview.reels-crop-pannable {
  cursor: grab;
  touch-action: none;
}

.reels-wa-preview.reels-crop-pannable.is-panning {
  cursor: grabbing;
}

.reels-wa-preview.reels-crop-pannable video {
  pointer-events: none;
}

.reels-crop-actions {
  display: flex;
  justify-content: center;
}

.reels-crop-actions .btn {
  min-width: 180px;
}

.reels-wa-float-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  cursor: pointer;
}

.reels-wa-float-btn.muted {
  background: rgba(220, 53, 69, 0.85);
}

.reels-wa-toolbar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.reels-wa-tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  background: #fafafa;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #333;
  min-width: 72px;
  transition: background 0.2s, border-color 0.2s;
}

.reels-wa-tool-btn i {
  font-size: 18px;
}

.reels-wa-tool-btn.active {
  background: #000;
  color: #fff;
  border-color: #000;
}

.reels-wa-tool-panel {
  background: #f8f8f8;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.reels-wa-hint {
  font-size: 13px;
  color: #666;
  margin: 0 0 12px;
}

.reels-trim-times {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
  /* Timeline is always LTR (start left → end right), even on Arabic pages */
  direction: ltr;
  unicode-bidi: isolate;
}

.reels-trim-track {
  position: relative;
  height: 40px;
  background: #ddd;
  border-radius: 8px;
  margin: 8px 0;
  direction: ltr;
  unicode-bidi: isolate;
}

.reels-trim-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: #25d366;
  border-radius: 6px;
  opacity: 0.45;
  pointer-events: none;
}

.reels-trim-range {
  position: absolute;
  left: 0;
  width: 100%;
  height: 40px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
}

.reels-trim-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 36px;
  border-radius: 4px;
  background: #fff;
  border: 2px solid #25d366;
  cursor: ew-resize;
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.reels-trim-range::-moz-range-thumb {
  width: 18px;
  height: 36px;
  border-radius: 4px;
  background: #fff;
  border: 2px solid #25d366;
  cursor: ew-resize;
  pointer-events: auto;
}

.reels-trim-end {
  z-index: 2;
}

.reels-wa-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 16px;
  padding: 14px 24px;
  border: none;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.reels-wa-send-btn:hover:not(:disabled) {
  background: #1fb855;
}

.reels-wa-send-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.reels-file-name {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}
