/* ==========================================================
   HUTFLOOR STUDIO - CLEAN BUFFER COMPOSER
   Distraction-free, crisp whitespace & real-time previews
   ========================================================== */

.composer-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  flex: 1;
  min-height: 0;
  max-height: calc(85vh - 120px);
  background: #ffffff;
  overflow: hidden;
}

@media (max-width: 860px) {
  .composer-layout {
    grid-template-columns: 1fr;
    max-height: calc(80vh - 120px);
    overflow-y: auto;
  }
}

/* Left Editor */
.composer-main {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-right: 1px solid var(--border-light);
  overflow-y: auto;
}

.composer-channel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.channel-chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  background: var(--bg-app);
  cursor: pointer;
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  user-select: none;
}

.channel-chip-toggle input {
  display: none;
}

.channel-chip-toggle:hover {
  background: #f1f5f9;
}

.channel-chip-toggle.checked {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e40af;
}

.channel-chip-toggle .chip-check {
  font-size: 0.7rem;
  color: var(--primary);
  display: none;
}

.channel-chip-toggle.checked .chip-check {
  display: inline;
}

/* Editor Input */
.composer-input-box {
  width: 100%;
  min-height: 180px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-main);
  resize: none;
  outline: none;
  transition: var(--transition);
}

.composer-input-box:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.composer-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.775rem;
  color: var(--text-muted);
}

.char-counter-pill {
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  background: #f1f5f9;
}

.char-counter-pill.warn {
  background: #fef3c7;
  color: #92400e;
}

.char-counter-pill.danger {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
}

/* AI Quick Prompts */
.composer-ai-strip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ai-strip-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ai-buttons-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.btn-ai-pill {
  font-family: var(--font);
  font-size: 0.725rem;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-ai-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0f7ff;
}

/* Media Attachment Strip */
.composer-media-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.media-pill-thumb {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.media-pill-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-pill-thumb .remove-img-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
}

.btn-add-media-trigger {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-light);
  background: var(--bg-app);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.btn-add-media-trigger:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0f7ff;
}

/* Footer & Schedule dropdown */
.composer-bottom-bar {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.footer-btn-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Right Live Preview */
.composer-preview-side {
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-tabs-bar {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  gap: 0.35rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
}

.preview-tab {
  background: transparent;
  border: none;
  font-family: var(--font);
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

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

.preview-tab.active {
  background: #f1f5f9;
  color: var(--text-main);
  font-weight: 700;
}

.preview-scroll-pane {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Clean Device Mockups */
.preview-card {
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  display: none;
}

.preview-card.active {
  display: block;
}

.card-author-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.card-author-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.card-author-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #111827;
}

.card-author-handle {
  font-size: 0.75rem;
  color: #6b7280;
}

.card-text-body {
  font-size: 0.9rem;
  line-height: 1.45;
  color: #111827;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 0.75rem;
}

.card-image-box {
  width: 100%;
  max-height: 200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 0.75rem;
  border: 1px solid #e5e7eb;
}

.card-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px solid #f3f4f6;
  font-size: 0.75rem;
  color: #6b7280;
}
