/**
 * Lioris Reels Publisher Styles
 * Unified Brand Design system matching /dashboard/brand/design
 */

.reels-page-container {
  max-width: 580px;
  margin: 0 auto;
  padding: 16px 16px var(--space-bottom-nav, 48px);
}

/* ── Top Header ── */
.reels-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  min-height: 44px;
}

.reels-back-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: transparent;
  border: none !important;
  box-shadow: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--p-white, #ffffff);
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.2s ease,
    color 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.reels-back-btn:hover {
  background: var(--p-white-a8, rgba(255, 255, 255, 0.08));
  border: none !important;
  box-shadow: none !important;
  color: var(--p-white, #ffffff);
  transform: translateX(-2px);
}

.reels-header-text {
  display: flex;
  flex-direction: column;
}

.reels-page-title {
  font-size: var(--text-xl, 20px);
  font-weight: var(--fw-700, 700);
  color: var(--p-white, #ffffff);
  margin: 0;
  line-height: 1.25;
  letter-spacing: var(--tracking-tight, -0.01em);
}

.reels-page-subtitle {
  font-size: var(--text-13, 13px);
  color: var(--p-white-a60, rgba(255, 255, 255, 0.6));
  margin: 3px 0 0 0;
  line-height: 1.3;
}

/* ── Main Editor Card (Brand Glass) ── */
.reels-editor-card {
  background: linear-gradient(
    145deg,
    var(--p-cosmic-base-a45, rgba(16, 12, 34, 0.75)) 0%,
    var(--p-cosmic-deep-a60, rgba(10, 7, 24, 0.95)) 100%
  );
  border: 1px solid var(--p-white-a10, rgba(255, 255, 255, 0.1));
  border-radius: 24px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    0 12px 36px -4px var(--p-black-a55, rgba(0, 0, 0, 0.55)),
    inset 0 1px 0 0 var(--p-white-a16, rgba(255, 255, 255, 0.16));
}

/* ── 1. Title Input Row ── */
.reels-input-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--p-white-a4, rgba(255, 255, 255, 0.04));
  border: none !important;
  border-radius: 14px;
  padding: 14px 16px;
  transition: all 0.2s ease;
}

.reels-input-box:focus-within {
  background: var(--p-white-a7, rgba(255, 255, 255, 0.07));
  box-shadow: 0 0 16px var(--p-purple-300-a20, rgba(168, 85, 247, 0.2));
}

.reels-input-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.reels-input-field {
  border: none;
  background: transparent;
  color: var(--p-white, #ffffff);
  font-size: var(--text-15, 15px);
  font-weight: var(--fw-500, 500);
  width: 100%;
  outline: none;
  font-family: inherit;
}

.reels-input-field::placeholder {
  color: var(--p-white-a40, rgba(255, 255, 255, 0.4));
}

/* ── 2. Textarea Box with Counter ── */
.reels-textarea-box {
  background: var(--p-white-a4, rgba(255, 255, 255, 0.04));
  border: none !important;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
  transition: all 0.2s ease;
}

.reels-textarea-box:focus-within {
  background: var(--p-white-a7, rgba(255, 255, 255, 0.07));
  box-shadow: 0 0 16px var(--p-purple-300-a20, rgba(168, 85, 247, 0.2));
}

.reels-textarea-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
}

.reels-textarea-field {
  border: none;
  background: transparent;
  color: var(--p-white, #ffffff);
  font-size: var(--text-15, 15px);
  width: 100%;
  resize: none;
  outline: none;
  line-height: 1.45;
  font-family: inherit;
}

.reels-textarea-field::placeholder {
  color: var(--p-white-a40, rgba(255, 255, 255, 0.4));
}

.reels-textarea-bottom {
  display: flex;
  justify-content: flex-end;
  padding-top: 6px;
}

.reels-char-limit {
  font-size: var(--text-12, 12px);
  color: var(--p-white-a45, rgba(255, 255, 255, 0.45));
  font-weight: var(--fw-500, 500);
}

/* ── 3. Video Upload Dropzone ── */
.reels-dropzone {
  border: 1.5px dashed var(--p-purple-300-a40, rgba(168, 85, 247, 0.4));
  border-radius: 20px;
  padding: 26px 16px 20px;
  text-align: center;
  background: var(--p-purple-a05, rgba(168, 85, 247, 0.03));
  position: relative;
  transition: all 0.2s ease;
}

.reels-dropzone:hover {
  border-color: var(--p-purple-300-a70, rgba(192, 132, 252, 0.7));
  background: var(--p-purple-a08, rgba(168, 85, 247, 0.06));
}

.reels-dropzone-icon-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
}

.reels-dropzone-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 28px rgba(236, 72, 153, 0.4);
}

.reels-sparkle {
  position: absolute;
  color: rgba(216, 180, 254, 0.85);
  pointer-events: none;
}

.sp-1 {
  top: 4px;
  left: -14px;
  font-size: 14px;
}
.sp-2 {
  top: -6px;
  right: -10px;
  font-size: 12px;
}
.sp-3 {
  bottom: 8px;
  left: -8px;
  font-size: 14px;
}
.sp-4 {
  top: 18px;
  right: -16px;
  font-size: 10px;
}

.reels-dropzone-title {
  font-size: var(--text-15, 15px);
  font-weight: var(--fw-700, 700);
  color: var(--p-white, #ffffff);
  margin-bottom: 4px;
}

.reels-dropzone-sub {
  font-size: var(--text-12, 12px);
  color: var(--p-white-a60, rgba(255, 255, 255, 0.6));
  margin-bottom: 16px;
}

.reels-choose-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: none !important;
  box-shadow: none !important;
  color: var(--p-white, #ffffff);
  font-size: var(--text-14, 14px);
  font-weight: var(--fw-600, 600);
  cursor: pointer;
  transition: all 0.2s ease;
}

.reels-choose-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.reels-dropzone-preview {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  max-width: 240px;
  margin: 0 auto;
}

.reels-dropzone-preview video {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

.reels-remove-video-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
}

/* ── 4. Account Selector Card ── */
.reels-account-picker-wrap {
  position: relative;
  width: 100%;
}

.reels-account-card {
  background: var(--p-white-a4, rgba(255, 255, 255, 0.04));
  border: none !important;
  box-shadow: none !important;
  border-radius: 16px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.reels-account-card:hover {
  background: var(--p-white-a7, rgba(255, 255, 255, 0.07));
}

.reels-account-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reels-avatar-gradient {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: var(--fw-700, 700);
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.4);
}

.reels-avatar-badge {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid #090715;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #ffffff;
}

.reels-account-info {
  display: flex;
  flex-direction: column;
}

.reels-account-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.reels-account-name {
  font-size: var(--text-15, 15px);
  font-weight: var(--fw-700, 700);
  color: var(--p-white, #ffffff);
}

.reels-account-arrow {
  color: var(--p-white-a60, rgba(255, 255, 255, 0.6));
  transition: transform 0.25s ease;
}

.reels-account-picker-wrap.open .reels-account-arrow {
  transform: rotate(180deg);
}

.reels-account-desc {
  font-size: var(--text-12, 12px);
  color: var(--p-white-a45, rgba(255, 255, 255, 0.45));
  margin-top: 2px;
}

.reels-account-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.reels-reach-val {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-14, 14px);
  font-weight: var(--fw-600, 600);
  color: var(--p-white-a85, rgba(255, 255, 255, 0.85));
}

.reels-reach-label {
  font-size: 11px;
  color: var(--p-white-a45, rgba(255, 255, 255, 0.45));
  margin-top: 2px;
}

/* ── Account Multi-Select Dropdown ── */
.reels-account-dropdown {
  margin-top: 8px;
  border-radius: 18px;
  background: rgba(16, 12, 34, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: reelsFadeSlideDown 0.2s ease;
}

.reels-account-dropdown.hidden {
  display: none !important;
}

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

.reels-account-dropdown-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reels-account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.reels-account-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.reels-account-item.selected {
  background: rgba(168, 85, 247, 0.12);
}

/* LIO-91: непригодные для видео подключения — disabled + причина */
.reels-account-item.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.reels-account-item.disabled:hover {
  background: transparent;
}

.reels-account-item.disabled .reels-avatar-badge-sm {
  background: #52525b;
}

.reels-account-item.disabled .reels-account-item-name {
  color: rgba(255, 255, 255, 0.7);
}

.reels-account-item.disabled .reels-checkbox-custom {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
}

.reels-account-item-reach.reels-account-issue {
  color: #f87171;
}

.reels-account-empty-warn {
  color: #f87171;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.08);
}

.reels-account-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reels-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  position: relative;
  flex-shrink: 0;
}

.avatar-grad-1 {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

.avatar-grad-2 {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.avatar-grad-3 {
  background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.3);
}

.reels-avatar-badge-sm {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3b82f6;
  border: 1.5px solid #090715;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 800;
  color: #ffffff;
}

.reels-account-item-details {
  display: flex;
  flex-direction: column;
}

.reels-account-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.reels-account-item-reach {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 1px;
}

.reels-checkbox-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.reels-account-chk {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.reels-checkbox-custom {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: transparent;
  transition: all 0.2s ease;
}

.reels-account-chk:checked + .reels-checkbox-custom {
  border-color: #ec4899;
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.5);
}

/* ── 5. Schedule Later Card ── */
.reels-schedule-trigger-card {
  background: var(--p-white-a4, rgba(255, 255, 255, 0.04));
  border: none !important;
  box-shadow: none !important;
  border-radius: 16px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.reels-schedule-trigger-card:hover {
  background: var(--p-white-a7, rgba(255, 255, 255, 0.07));
}

.reels-schedule-trigger-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.reels-schedule-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--p-purple-a12, rgba(168, 85, 247, 0.12));
  border: 1px solid var(--p-purple-300-a25, rgba(168, 85, 247, 0.25));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.reels-schedule-trigger-info {
  display: flex;
  flex-direction: column;
}

.reels-schedule-trigger-title {
  font-size: var(--text-15, 15px);
  font-weight: var(--fw-700, 700);
  color: var(--p-white, #ffffff);
}

.reels-schedule-trigger-subtitle {
  font-size: var(--text-12, 12px);
  color: var(--p-white-a50, rgba(255, 255, 255, 0.5));
  margin-top: 2px;
}

.reels-schedule-chevron {
  flex-shrink: 0;
}

/* ── 6. Main Action Button: Опубликовать сейчас ── */
.reels-main-publish-btn {
  width: 100%;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(90deg, #7c3aed 0%, #c026d3 50%, #ec4899 100%);
  border: none;
  color: #ffffff;
  font-size: var(--text-16, 16px);
  font-weight: var(--fw-700, 700);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 28px rgba(192, 38, 211, 0.35);
  transition: all 0.2s ease;
}

.reels-main-publish-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 34px rgba(192, 38, 211, 0.5);
  filter: brightness(1.05);
}

.reels-main-publish-btn:active {
  transform: translateY(1px);
}
