/* ==========================================================
   HUTFLOOR STUDIO - BUFFER PUBLISH CLEAN DESIGN SYSTEM
   Inspired directly by https://publish.buffer.com/home
   Clean, intuitive, high-contrast, distraction-free
   ========================================================== */

:root {
  --bg-app: #f9fafb;
  --bg-surface: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f3f4f6;
  --bg-subtle: #f8fafc;

  --border-light: #e5e7eb;
  --border-subtle: #f1f5f9;
  --border-focus: #2563eb;

  --text-main: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-link: #2563eb;

  --primary: #2c4bff;
  --primary-hover: #1e3cd8;
  --primary-subtle: #eef2ff;
  --accent-emerald: #10b981;
  --accent-rose: #ef4444;
  --accent-amber: #f59e0b;
  --accent-cyan: #06b6d4;

  /* Social Colors */
  --color-twitter: #1d9bf0;
  --color-linkedin: #0a66c2;
  --color-instagram: #e1306c;
  --color-threads: #000000;
  --color-facebook: #1877f2;
  --color-tiktok: #000000;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --sidebar-width: 250px;
  --transition: all 0.15s ease-in-out;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Base App Layout: Sidebar + Main Content */
.app-wrapper {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* ==========================================================
   1. LEFT SIDEBAR (Buffer signature navigation)
   ========================================================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  user-select: none;
}

.sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1rem;
}

.brand-logo-img {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding: 0 0.5rem 0.4rem;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.nav-item-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.nav-item-btn.active {
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 700;
}

.nav-item-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Channels List in Sidebar */
.channel-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.channel-list-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.825rem;
  font-weight: 500;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.channel-list-item:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.channel-list-item.active {
  background: #f1f5f9;
  color: var(--text-main);
  font-weight: 700;
}

.channel-avatar-wrapper {
  position: relative;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.channel-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.channel-network-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  color: #fff;
  font-weight: 800;
}

.channel-name-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.btn-sidebar-add-channel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  margin-top: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-light);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.775rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: var(--transition);
}

.btn-sidebar-add-channel:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-focus);
}

.sidebar-footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.user-profile-name {
  font-size: 0.825rem;
  font-weight: 600;
  line-height: 1.2;
}

.user-profile-plan {
  font-size: 0.7rem;
  color: var(--accent-emerald);
  font-weight: 700;
  text-transform: uppercase;
}

/* ==========================================================
   2. MAIN CONTENT AREA (Clean Buffer layout)
   ========================================================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-app);
}

/* Top Action Header */
.top-action-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.active-channel-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.active-channel-icon-stack {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.active-channel-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Publishing Sub-Tabs (Queue, Calendar, Drafts, Sent) */
.publish-subtabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-app);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.subtab-btn {
  background: transparent;
  border: none;
  font-family: var(--font);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.subtab-btn:hover {
  color: var(--text-main);
}

.subtab-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
  font-weight: 700;
}

.subtab-badge {
  font-size: 0.7rem;
  background: var(--bg-hover);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  margin-left: 0.35rem;
  color: var(--text-muted);
}

.subtab-btn.active .subtab-badge {
  background: var(--primary-subtle);
  color: var(--primary);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Upgrade / Pricing Button in Top Bar */
.btn-upgrade-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.15) 100%);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.48rem 0.95rem;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-upgrade-pill:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Primary CTA Button (Buffer Blue) */
.btn-create-post {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(44, 75, 255, 0.25);
  transition: var(--transition);
}

.btn-create-post:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 10px rgba(44, 75, 255, 0.35);
}

/* Cloudflare Subdomain indicator */
.subdomain-pill {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: monospace;
}

.cf-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

/* Content Body Scroll Area */
.content-scroll-pane {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.content-inner-width {
  width: 100%;
  max-width: 860px;
}

/* ==========================================================
   3. BUFFER SIGNATURE "WHAT WOULD YOU LIKE TO SHARE?" BOX
   ========================================================== */
.quick-composer-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
  cursor: pointer;
  transition: var(--transition);
}

.quick-composer-bar:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.quick-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.quick-placeholder {
  flex: 1;
  color: var(--text-muted);
  font-size: 0.95rem;
  user-select: none;
}

.quick-action-icons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

.quick-icon-btn {
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

/* ==========================================================
   4. BUFFER QUEUE LIST (Day Sections & Time Slots)
   ========================================================== */
.queue-day-section {
  margin-bottom: 2.25rem;
}

.queue-day-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.queue-day-heading .badge-today {
  background: #dbeafe;
  color: #1e40af;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
}

.queue-slots-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Individual Post Slot */
.queue-post-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  display: flex;
  gap: 1.25rem;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  position: relative;
}

.queue-post-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.post-card-time-col {
  width: 72px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.post-time-text {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-main);
}

.post-status-pill {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

.status-pill-queued { background: #e0e7ff; color: #3730a3; }
.status-pill-scheduled { background: #cffafe; color: #155e75; }
.status-pill-published { background: #d1fae5; color: #065f46; }
.status-pill-draft { background: #fef3c7; color: #92400e; }

.post-card-main-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.post-card-channels {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.channel-tag-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}

.tag-twitter { background-color: var(--color-twitter); }
.tag-linkedin { background-color: var(--color-linkedin); }
.tag-instagram { background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); }
.tag-threads { background-color: #000; }

.post-card-body-text {
  font-size: 0.925rem;
  color: var(--text-main);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-media-thumb-preview {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border-light);
  margin-top: 0.25rem;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 0.35rem;
}

.card-action-links {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.action-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.action-link:hover {
  color: var(--primary);
}

.action-link.danger:hover {
  color: var(--accent-rose);
}

/* Buffer's signature EMPTY SLOT PLACEHOLDER */
.empty-slot-card {
  border: 1px dashed var(--border-light);
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
}

.empty-slot-card:hover {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.empty-slot-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.empty-slot-time {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 72px;
}

.empty-slot-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.empty-slot-plus {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

/* Empty State */
.clean-empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}

.clean-empty-state h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.clean-empty-state p {
  color: var(--text-muted);
  font-size: 0.875rem;
  max-width: 440px;
  margin: 0 auto 1.5rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-in-out;
}

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

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 880px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.98);
  transition: transform 0.15s ease-out;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-top {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-close-icon {
  background: transparent;
  border: none;
  font-size: 1.35rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
}

.modal-close-icon:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.clean-toast {
  background: #111827;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideToast 0.2s ease-out;
}

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

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: -250px;
    z-index: 500;
    transition: left 0.2s ease;
  }
  .sidebar.mobile-open {
    left: 0;
  }
  .top-action-bar {
    padding: 0.75rem 1rem;
  }
  .content-scroll-pane {
    padding: 1rem;
  }
}
