/* ===========================================================================
   PAGES — Otlo Design System
   ========================================================================= */

/* ===========================
   AUTH PAGES
   =========================== */
.auth-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-8);
  background: var(--bg-canvas);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.auth-header h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: var(--fw-black);
  background: var(--gradient-silk);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-header p {
  color: var(--text-tertiary);
  margin-top: var(--space-2);
}

.auth-form {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-tertiary);
  font-size: var(--fs-small);
  margin: var(--space-6) 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-default);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-6);
  color: var(--text-secondary);
  font-size: var(--fs-small);
}

.auth-footer a {
  color: var(--text-brand);
  font-weight: var(--fw-semibold);
}

/* ===========================
   POST DETAIL
   =========================== */
.post-detail-page {
  background: var(--surface);
  min-height: 100vh;
}

/* ===========================
   CREATE POST
   =========================== */
.create-post-page {
  background: var(--surface);
  min-height: 100vh;
}

/* ===========================
   PROFILE
   =========================== */
.profile-header {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  background: var(--gradient-silk);
  color: var(--on-brand-silk);
  position: relative;
}

.profile-header .avatar-xl {
  border-color: white;
  margin: 0 auto var(--space-3);
}

.profile-name {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  color: var(--on-brand-silk);
}

.profile-bio {
  font-size: var(--fs-small);
  opacity: 0.85;
  max-width: 300px;
  margin: var(--space-2) auto 0;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-8);
  margin-top: var(--space-4);
}

.profile-stat { text-align: center; }

.profile-stat-value {
  font-family: var(--font-mono);
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  color: var(--on-brand-silk);
}

.profile-stat-label {
  font-size: var(--fs-micro);
  opacity: 0.75;
}

/* ===========================
   AI CHAT
   =========================== */
.ai-chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height) - var(--nav-height) - var(--safe-bottom));
  background: var(--bg-canvas);
}

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

.ai-message {
  max-width: 85%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--fs-small);
  line-height: var(--lh-relaxed);
  animation: slideUp var(--dur-base) var(--ease-out);
}

.ai-message.user {
  align-self: flex-end;
  background: var(--gradient-brand);
  color: var(--on-brand);
  border-bottom-right-radius: var(--radius-xs);
}

.ai-message.assistant {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-bottom-left-radius: var(--radius-xs);
}

.ai-input-container {
  padding: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: var(--space-2);
  background: var(--surface);
}

/* ===========================
   SEARCH
   =========================== */
.search-page { padding: var(--space-4); }
.search-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

/* ===========================
   CREATE POST PAGE
   =========================== */
.create-media-zone {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface-sunken);
}

.create-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 4px;
  padding: 4px;
}

.create-media-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}

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

.create-media-video-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
  color: white;
  pointer-events: none;
}

.create-media-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.create-media-order {
  position: absolute;
  bottom: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.create-media-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-8) var(--space-4);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out);
}

.create-media-add:hover {
  color: var(--brand-action);
}

.create-media-add span:last-of-type {
  font-size: var(--fs-caption);
  opacity: 0.6;
}

.create-category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.create-category-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  font-family: inherit;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.create-category-chip:hover {
  border-color: var(--cat-color);
  color: var(--text-primary);
}

.create-category-chip.selected {
  border-color: var(--cat-color);
  background: var(--cat-color);
  color: white;
}

.create-category-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.create-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.create-option-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  font-family: inherit;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.create-option-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.create-option-btn.is-active {
  border-color: var(--brand-action);
  background: var(--brand-wash);
  color: var(--text-brand);
}

.toggle-pill {
  margin-left: auto;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--border-default);
  position: relative;
  transition: background var(--dur-fast) var(--ease-out);
}

.toggle-pill::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-out);
}

.is-active .toggle-pill {
  background: var(--brand-action);
}

.is-active .toggle-pill::after {
  transform: translateX(18px);
}

/* ===========================
   POST CARD — Instagram Style
   =========================== */
.post-card--full .post-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--gutter);
}

.post-card__stats {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-2) var(--gutter);
  font-size: var(--fs-small);
  color: var(--text-tertiary);
  font-weight: var(--fw-medium);
}

.post-card__action-bar {
  display: flex;
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-1);
}

.post-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  font-family: inherit;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out);
}

.post-action-btn:hover {
  color: var(--text-primary);
}

.post-action-btn.is-active {
  color: var(--brand-action);
}

.report-reason-btn {
  text-align: left;
  justify-content: flex-start;
}
