/* ============================================================
   Page-Specific Overrides — Minimal, only when components.css
   doesn't cover a unique layout need
   ============================================================ */

/* ─── Chat Page ─── */
.chat-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-height) - var(--jobbar-height) - var(--space-12));
  max-height: 700px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.chat-bubble {
  max-width: 80%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: 1.6;
  word-wrap: break-word;
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--primary);
  color: var(--text-inverse);
  border-bottom-right-radius: var(--radius-sm);
}

.chat-bubble.assistant {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: var(--radius-sm);
}

.chat-input-row {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-top: 1px solid var(--border);
}

.chat-input-row .form-input {
  flex: 1;
}

.chat-chips {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  flex-wrap: wrap;
}

.chat-chip {
  padding: var(--space-1) var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chat-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: var(--space-3) var(--space-4);
  align-self: flex-start;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing-bounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* ─── Calendar Page ─── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.calendar-header-cell {
  padding: var(--space-3);
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  background: var(--bg-surface);
}

.calendar-cell {
  min-height: 100px;
  padding: var(--space-2);
  background: var(--bg-card);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.calendar-cell:hover {
  background: var(--bg-card-hover);
}

.calendar-cell.today {
  background: var(--primary-dim);
}

.calendar-cell .day-number {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.calendar-cell.today .day-number {
  color: var(--primary);
}

.calendar-event {
  padding: 2px 6px;
  font-size: 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-event.video { background: var(--secondary-dim); color: var(--secondary); }
.calendar-event.image { background: var(--accent-dim); color: var(--accent); }
.calendar-event.post { background: var(--primary-dim); color: var(--primary); }

/* ─── Editor Page ─── */
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-4);
}

.editor-preview {
  background: var(--bg-base);
  border-radius: var(--radius-lg);
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.editor-timeline {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  min-height: 80px;
}

@media (max-width: 768px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .chat-layout {
    height: calc(100vh - var(--topbar-height) - var(--jobbar-height) - var(--space-8));
  }
}

/* ─── Gamification ─── */
.xp-bar {
  height: 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-3);
}

.achievement {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--transition-fast);
}

.achievement.unlocked {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow-accent);
}

.achievement .icon {
  font-size: 28px;
  filter: grayscale(100%) opacity(0.3);
}

.achievement.unlocked .icon {
  filter: none;
}

.achievement .name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
}

.achievement.unlocked .name {
  color: var(--text);
}

/* ─── OAuth Connection Cards ─── */
.connection-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.connection-card .platform-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 20px;
  flex-shrink: 0;
}

.connection-card .platform-info {
  flex: 1;
}

.connection-card .platform-name {
  font-weight: 600;
  font-size: var(--text-sm);
}

.connection-card .platform-status {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
