/* ═══════════════════════════════════════════
   BUIDLER by Comkuate — Main Stylesheet
   ═══════════════════════════════════════════ */

body {
  font-family: 'Inter', sans-serif;
  background: #fefcf8;
  color: #334155;
}
h1, h2, h3, h4 { font-family: 'Syne', sans-serif; }

/* ── Animated Waves Background ── */
.waves-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 35vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.waves-top {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 30vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  transform: rotate(180deg);
}

.wave-svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 100%;
}

.wave-svg-top {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 100%;
}

.wave-layer-1 { animation: wave-drift 8s ease-in-out infinite; }
.wave-layer-2 { animation: wave-drift 10s ease-in-out infinite reverse; animation-delay: -2s; }
.wave-layer-3 { animation: wave-drift 12s ease-in-out infinite; animation-delay: -4s; }
.wave-layer-4 { animation: wave-drift-top 9s ease-in-out infinite; }
.wave-layer-5 { animation: wave-drift-top 11s ease-in-out infinite reverse; animation-delay: -3s; }

@keyframes wave-drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-25%); }
}

@keyframes wave-drift-top {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-20%); }
}

/* ── Cards ── */
.card {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(249, 115, 22, 0.04);
  transition: all 0.3s ease;
}
.card:hover {
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.08), 0 8px 32px rgba(0,0,0,0.06);
}

.card-solid {
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ── Nav ── */
.nav-bar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

/* ── Calendar ── */
.calendar-day {
  min-height: 110px;
  transition: all 0.2s ease;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(226, 232, 240, 0.4);
}
.calendar-day:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(249, 115, 22, 0.2);
  box-shadow: 0 2px 12px rgba(249, 115, 22, 0.06);
}
.calendar-day.is-today {
  border-color: rgba(249, 115, 22, 0.4);
  background: rgba(255, 247, 237, 0.8);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.1);
}
.calendar-day.is-other-month {
  opacity: 0.35;
}

/* ── Drag-and-drop states ── */
.calendar-day.drag-over {
  border-color: #f97316;
  background: #fff7ed;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
  transform: scale(1.02);
}
.post-chip.dragging {
  opacity: 0.4;
  transform: scale(0.95);
}

/* ── Post Chips ── */
.post-chip {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 1.5;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}
.post-chip:hover {
  transform: scale(1.02);
  filter: brightness(0.95);
}
.post-chip.platform-blog {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
}
.post-chip.platform-linkedin {
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  color: #075985;
}
.post-chip.platform-meta {
  background: #eef4ff;
  border: 1px solid #bcd2ff;
  color: #1e40af;
}
.post-chip.platform-tiktok {
  background: #fce7f3;
  border: 1px solid #fbcfe8;
  color: #9d174d;
}
.post-chip.platform-youtube {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.post-chip.platform-multi {
  background: #ede9fe;
  border: 1px solid #ddd6fe;
  color: #5b21b6;
}

/* ── Thumbnail on calendar ── */
.post-chip-thumb {
  width: 100%;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  margin-bottom: 2px;
  display: block;
}

/* ── Day Detail Panel ── */
.day-detail-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  max-height: 70vh;
  overflow-y: auto;
}
.day-post-preview {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
  background: #fafbfc;
  cursor: pointer;
  transition: all 0.2s ease;
}
.day-post-preview:hover {
  border-color: rgba(249, 115, 22, 0.25);
  background: #fff;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.06);
}
.day-post-thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.day-post-thumb-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  flex-shrink: 0;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
}

/* ── Image upload ── */
.thumb-upload-zone {
  border: 2px dashed #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fafbfc;
}
.thumb-upload-zone:hover {
  border-color: #f97316;
  background: #fff7ed;
}
.thumb-upload-zone.has-image {
  border-style: solid;
  border-color: #e2e8f0;
  padding: 8px;
}
.thumb-upload-zone.uploading {
  pointer-events: none;
  opacity: 0.6;
}
.thumb-preview {
  max-height: 140px;
  border-radius: 8px;
  object-fit: cover;
  width: 100%;
}

/* ── Status ── */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-brouillon { background: #94a3b8; }
.status-en-creation { background: #8b5cf6; }
.status-a-valider { background: #f59e0b; }
.status-planifie { background: #22c55e; }
.status-publie { background: #22c55e; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.12), 0 0 1px rgba(0,0,0,0.08);
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.3s ease;
}
.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}
.modal-content::-webkit-scrollbar { width: 5px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ── Form Inputs ── */
.form-input {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}
.form-input:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
  background: #fff;
}

/* ── Multi-platform checkboxes ── */
.platform-checkbox-group {
  display: none;
  animation: slideDown 0.2s ease;
}
.platform-checkbox-group.visible {
  display: block;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.platform-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}
.platform-check:hover {
  border-color: #f97316;
  background: #fff7ed;
}
.platform-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #f97316;
  cursor: pointer;
  flex-shrink: 0;
}
.platform-check span {
  font-size: 13px;
  font-weight: 500;
  color: #475569;
}
.platform-check iconify-icon {
  font-size: 16px;
  flex-shrink: 0;
}
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}
select.form-input option {
  background: #fff;
  color: #334155;
}

/* ── Stat bars ── */
.stat-bar {
  height: 6px;
  border-radius: 3px;
  background: #f1f5f9;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Filter chips ── */
.filter-chip {
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #e2e8f0;
  background: rgba(255,255,255,0.7);
  color: #64748b;
}
.filter-chip:hover {
  background: #fff;
  border-color: #cbd5e1;
  color: #334155;
}
.filter-chip.active {
  border-color: #f97316;
  background: #fff7ed;
  color: #c2410c;
}

/* ── View toggle ── */
.view-btn {
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  color: #94a3b8;
  border: none;
}
.view-btn:hover { color: #64748b; }
.view-btn.active {
  background: #fff7ed;
  color: #f97316;
}

/* ── List items ── */
.list-item {
  transition: all 0.2s ease;
  cursor: pointer;
  background: rgba(255,255,255,0.7);
  border: 1px solid #e2e8f0;
}
.list-item:hover {
  background: #fff;
  border-color: rgba(249, 115, 22, 0.2);
  box-shadow: 0 2px 12px rgba(249, 115, 22, 0.06);
}

/* ── Button styles ── */
.btn-primary {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  border: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #ea580c, #c2410c);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.35);
}

.btn-secondary {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}
.btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-danger {
  background: #fff;
  color: #dc2626;
  border: 1px solid #fecaca;
  transition: all 0.2s ease;
}
.btn-danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #c2410c;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ── Loading spinner ── */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #e2e8f0;
  border-top-color: #f97316;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Login page ── */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.08);
  padding: 48px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 24px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 15px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
}
.google-btn:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.google-btn img {
  width: 20px;
  height: 20px;
}
.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  margin-top: 16px;
  display: none;
}

/* ── User avatar in nav ── */
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  object-fit: cover;
}

/* ── Workflow Pipeline (Icon Track) ── */
.wf-bar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 20px;
}
.wf-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  gap: 0;
}
/* Background line spanning full track */
.wf-line {
  position: absolute;
  top: 50%;
  left: 18px;
  right: 18px;
  height: 3px;
  background: #e2e8f0;
  border-radius: 2px;
  transform: translateY(-50%);
  z-index: 0;
  overflow: hidden;
}
/* Animated fill (progress) */
.wf-line-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  border-radius: 2px;
  transition: width 0.4s ease;
}
/* Each dot */
.wf-dot {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2.5px solid #e2e8f0;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.wf-dot:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
  transform: scale(1.1);
}
/* Completed step */
.wf-dot.completed {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}
.wf-dot.completed:hover {
  background: #16a34a;
  border-color: #16a34a;
}
/* Active (current) step */
.wf-dot.active {
  background: linear-gradient(135deg, #f97316, #ea580c);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.2), 0 2px 8px rgba(249, 115, 22, 0.35);
}
.wf-dot.active:hover {
  box-shadow: 0 0 0 5px rgba(249, 115, 22, 0.25), 0 3px 12px rgba(249, 115, 22, 0.4);
}
/* Tooltip on hover */
.wf-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #1e293b;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 10;
}
.wf-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1e293b;
}
.wf-dot:hover .wf-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Comments Section ── */
.comments-section {
  animation: slideDown 0.2s ease;
}
.comment-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  transition: all 0.15s ease;
}
.comment-item:hover {
  background: #fff;
  border-color: #e2e8f0;
}
#comments-list::-webkit-scrollbar { width: 4px; }
#comments-list::-webkit-scrollbar-track { background: transparent; }
#comments-list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

/* ── Mobile ── */
@media (max-width: 767px) {
  .calendar-day { min-height: 70px; }
  .calendar-day .day-number { font-size: 11px; }
  .post-chip { font-size: 8px; padding: 1px 4px; }
  .calendar-grid { gap: 2px; }
  .login-card { margin: 16px; padding: 32px 24px; }
  .workflow-step-icon { width: 26px; height: 26px; font-size: 12px; }
  .workflow-step-label { font-size: 8px; max-width: 50px; }
  .workflow-connector { width: 16px; }
  .workflow-pipeline { padding: 12px 8px; }
}
