/* ArtConnect — Dashboard, Cart, Orders, Admin styles */

/* ───── Dashboard layout ───── */
.dash-layout {
  display: grid;
  grid-template-columns: 240px minmax(0,1fr);
  min-height: calc(100vh - 60px);
  align-items: start;
}
@media (max-width: 900px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }
}

.dash-sidebar {
  position: sticky; top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  border-right: 1px solid var(--hairline);
  padding: 32px 20px;
  display: flex; flex-direction: column; gap: 28px;
  background: var(--surface);
}
.dash-user { display: flex; align-items: center; gap: 12px; }
.dash-nav { display: flex; flex-direction: column; gap: 2px; }
.dash-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 6px;
  font-size: 13px; color: var(--ink-soft);
  text-decoration: none; transition: background .15s, color .15s;
}
.dash-nav-item:hover { background: var(--surface-2); color: var(--ink); }
.dash-nav-item.active { background: rgba(11,28,63,.07); color: var(--navy); font-weight: 600; }
[data-theme="dark"] .dash-nav-item.active { background: rgba(201,168,76,.1); color: var(--gold-soft); }
.dash-nav-divider { height: 1px; background: var(--hairline); margin: 8px 0; }

.dash-main { padding: 40px 48px 80px; }
@media (max-width: 1100px) { .dash-main { padding: 32px 24px 60px; } }

.dash-top {
  display: flex; justify-content: space-between;
  align-items: flex-start; flex-wrap: wrap;
  gap: 16px; margin-bottom: 36px;
}
.dash-section { margin-top: 48px; }
.dash-section-head {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 20px;
}
.dash-section-title { font-family: var(--serif); font-size: 20px; font-weight: 400; margin: 0; }
.dash-section-link { font-size: 13px; color: var(--navy); text-decoration: none; }
[data-theme="dark"] .dash-section-link { color: var(--gold-soft); }
.dash-section-link:hover { text-decoration: underline; }
.dash-empty { text-align: center; padding: 40px; color: var(--muted); font-size: 14px; }
.dash-empty p { margin: 12px 0 0; }

/* ───── Stat cards ───── */
.stat-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
@media (max-width: 1100px) { .stat-cards { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px) { .stat-cards { grid-template-columns: 1fr 1fr; } }
.stat-card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 10px; padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.stat-icon {
  width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.stat-label { font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.stat-value { font-family: var(--serif); font-size: 32px; line-height: 1; color: var(--ink); }

/* ───── Order timeline ───── */
.timeline { display: flex; flex-direction: column; }
.timeline-step {
  display: flex; gap: 16px; align-items: flex-start;
  position: relative; padding-bottom: 28px;
}
.timeline-step:last-child { padding-bottom: 0; }
.timeline-step::before {
  content: '';
  position: absolute; left: 15px; top: 28px; bottom: 0;
  width: 1px; background: var(--hairline);
}
.timeline-step:last-child::before { display: none; }
.timeline-dot {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--hairline);
  background: var(--surface); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); z-index: 1;
}
.timeline-step.done .timeline-dot { background: var(--navy); border-color: var(--navy); color: #fff; }
.timeline-step.current .timeline-dot { border-color: var(--navy); color: var(--navy); }
.timeline-body { padding-top: 4px; }
.timeline-label { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.timeline-step:not(.done):not(.current) .timeline-label { color: var(--muted); }
.timeline-desc { font-size: 13px; color: var(--muted); }

.order-artwork-card, .order-summary-card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 10px; padding: 24px;
}
.order-dl {
  display: grid; grid-template-columns: 1fr auto;
  gap: 10px 24px; font-size: 14px; margin: 0;
}
.order-dl dt { color: var(--ink-soft); }
.order-dl dd { font-weight: 500; margin: 0; text-align: right; }

/* ───── Cart ───── */
.cart-item {
  display: flex; gap: 20px; align-items: flex-start;
  padding: 24px 0; border-bottom: 1px solid var(--hairline);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.cart-item-body { flex: 1; }
.cart-item-cat { font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.cart-item-title {
  font-family: var(--serif); font-size: 17px; color: var(--ink);
  text-decoration: none; display: block; margin-bottom: 4px;
}
.cart-item-title:hover { text-decoration: underline; }
.cart-item-artist { font-size: 13px; color: var(--muted); }
.cart-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; flex-shrink: 0; }
.cart-item-price { font-weight: 700; font-size: 16px; }
.cart-remove-btn {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--muted);
  background: none; border: none; cursor: pointer; padding: 4px 0;
}
.cart-remove-btn:hover { color: #DC2626; }
.cart-summary {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 12px; padding: 28px; position: sticky; top: 80px;
}

/* ───── Status badges ───── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
}
.badge-pending        { background: rgba(245,158,11,.12); color: #92400E; }
.badge-paid           { background: rgba(16,185,129,.12); color: #065F46; }
.badge-shipped        { background: rgba(59,130,246,.12); color: #1E40AF; }
.badge-delivered      { background: rgba(16,185,129,.12); color: #065F46; }
.badge-cancelled      { background: rgba(239,68,68,.12);  color: #991B1B; }
.badge-active         { background: rgba(16,185,129,.12); color: #065F46; }
.badge-pending_review { background: rgba(245,158,11,.12); color: #92400E; }
.badge-rejected       { background: rgba(239,68,68,.12);  color: #991B1B; }
[data-theme="dark"] .badge-pending        { background: rgba(245,158,11,.2);  color: #FCD34D; }
[data-theme="dark"] .badge-paid           { background: rgba(16,185,129,.2);  color: #6EE7B7; }
[data-theme="dark"] .badge-shipped        { background: rgba(59,130,246,.2);  color: #93C5FD; }
[data-theme="dark"] .badge-delivered      { background: rgba(16,185,129,.2);  color: #6EE7B7; }
[data-theme="dark"] .badge-cancelled      { background: rgba(239,68,68,.2);   color: #FCA5A5; }

/* ───── Data table ───── */
.ac-table-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: 10px; }
.ac-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ac-table th {
  padding: 12px 16px; text-align: left;
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--hairline);
  background: var(--surface-2);
}
.ac-table td { padding: 14px 16px; border-bottom: 1px solid var(--hairline); color: var(--ink); vertical-align: middle; }
.ac-table tr:last-child td { border-bottom: none; }
.ac-table tr:hover td { background: var(--surface-2); }
.mono { font-family: 'Courier New', monospace; font-size: 12px; }
.table-link { color: var(--navy); text-decoration: none; font-weight: 500; font-size: 12px; }
[data-theme="dark"] .table-link { color: var(--gold-soft); }
.table-link:hover { text-decoration: underline; }

/* ───── Form sections ───── */
.form-section-wrap { display: flex; flex-direction: column; }
.form-section {
  border: 1px solid var(--hairline); border-radius: 10px;
  padding: 28px; margin-bottom: 20px;
}
.form-section-head { margin-bottom: 20px; }
.form-section-title { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.form-section-desc { font-size: 13px; color: var(--muted); margin: 0; }

/* ───── Star rating ───── */
.star-rating { display: flex; gap: 2px; }
.star-btn {
  background: none; border: none; cursor: pointer; color: var(--muted);
  padding: 4px; transition: transform .12s, color .15s; line-height: 1;
}
.star-btn:hover { color: var(--gold); transform: scale(1.15); }
.star-btn:active { transform: scale(.95); }

/* ───── Checkout ───── */
.checkout-grid { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 48px; align-items: start; }
@media (max-width: 900px) { .checkout-grid { grid-template-columns: 1fr; } }
.checkout-step { margin-bottom: 32px; }
.checkout-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--navy); color: #fff;
  font-size: 12px; font-weight: 700; margin-right: 10px;
  flex-shrink: 0;
}
.checkout-step-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; margin: 0 0 20px; }

/* ───── Artist pages ───── */
.artist-dash-sidebar .dash-nav-item.active { background: rgba(201,168,76,.08); color: var(--gold); }

/* ───── Admin ───── */
.admin-stat-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 32px; }
@media (max-width: 1100px) { .admin-stat-row { grid-template-columns: repeat(2,1fr); } }

/* Moderation card */
.mod-card {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 20px; border: 1px solid var(--hairline);
  border-radius: 10px; background: var(--surface);
  margin-bottom: 16px;
}
.mod-card-img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.mod-card-body { flex: 1; }
.mod-card-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Chat */
.chat-layout {
  display: grid;
  grid-template-columns: 280px minmax(0,1fr);
  height: calc(100vh - 60px);
  overflow: hidden;
}
@media (max-width: 700px) { .chat-layout { grid-template-columns: 1fr; } }
.chat-sidebar {
  border-right: 1px solid var(--hairline);
  overflow-y: auto;
  background: var(--surface);
}
.chat-thread {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; cursor: pointer;
  border-bottom: 1px solid var(--hairline);
  transition: background .15s;
  text-decoration: none;
}
.chat-thread:hover, .chat-thread.active { background: var(--surface-2); }
.chat-thread-name { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.chat-thread-preview { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-thread-time { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.chat-thread-unread {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--navy); flex-shrink: 0;
}
[data-theme="dark"] .chat-thread-unread { background: var(--gold); }

.chat-main { display: flex; flex-direction: column; }
.chat-header {
  padding: 16px 24px; border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
}
.chat-protect-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; font-size: 12px; color: #92400e;
  background: #fffbeb; border-bottom: 1px solid #fde68a;
  flex-shrink: 0;
}
.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 24px; display: flex; flex-direction: column; gap: 16px;
}
.chat-msg { display: flex; gap: 10px; max-width: 70%; }
.chat-msg.outgoing { align-self: flex-end; flex-direction: row-reverse; }
.chat-bubble {
  padding: 10px 14px; border-radius: 16px;
  font-size: 14px; line-height: 1.5;
  background: var(--surface-2); color: var(--ink);
}
.chat-msg.outgoing .chat-bubble { background: var(--navy); color: #fff; border-radius: 16px 16px 4px 16px; }
.chat-msg:not(.outgoing) .chat-bubble { border-radius: 4px 16px 16px 16px; }
.chat-time { font-size: 10px; color: var(--muted); margin-top: 4px; }
.chat-msg.outgoing .chat-time { text-align: right; }
.chat-input-bar {
  padding: 16px 24px; border-top: 1px solid var(--hairline);
  display: flex; gap: 10px; align-items: flex-end;
  background: var(--surface);
}
.chat-input {
  flex: 1; resize: none; min-height: 42px; max-height: 120px;
  padding: 10px 14px; border: 1px solid var(--hairline);
  border-radius: 21px; font-size: 14px; background: var(--surface-2);
  color: var(--ink); font-family: var(--sans); outline: none;
}
.chat-input:focus { border-color: var(--navy); }
.chat-send-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--navy); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
  transition: background .2s, transform .1s;
}
.chat-send-btn:hover { background: #0a1830; }
.chat-send-btn:active { transform: scale(.95); }

/* ── Call icon buttons in header ── */
.call-icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink-soft); flex-shrink: 0;
  transition: background .15s, color .15s, border-color .15s;
}
.call-icon-btn:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── Voice recording ── */
.voice-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink-soft); flex-shrink: 0;
  transition: background .15s, color .15s;
}
.voice-btn.recording { background: #dc2626; border-color: #dc2626; color: #fff; }
.recording-indicator {
  flex: 1; align-items: center; gap: 8px;
  padding: 8px 14px; background: rgba(220,38,38,.07);
  border: 1px solid rgba(220,38,38,.2); border-radius: 21px;
  font-size: 13px; color: #dc2626;
}
.rec-dot { width:8px;height:8px;border-radius:50%;background:#dc2626;flex-shrink:0;animation:rec-blink 1s infinite; }
@keyframes rec-blink { 0%,100%{opacity:1} 50%{opacity:.2} }

/* ── Voice message bubble ── */
.voice-bubble { padding: 6px 10px !important; background: transparent !important; }
.chat-msg.outgoing .voice-bubble audio { filter: invert(1) brightness(2); }
.voice-bubble audio { display:block; height:36px; min-width:180px; max-width:240px; outline:none; }
.chat-bubble-img { padding: 4px !important; background: transparent !important; }
.chat-bubble-file { display:flex; align-items:center; gap:8px; min-width:180px; }

/* ── Incoming call modal ── */
.call-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 9990;
  background: rgba(0,0,0,.75); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.call-modal-overlay.is-open { display: flex; }
.call-modal {
  background: var(--surface); border-radius: 20px; padding: 40px 32px;
  text-align: center; width: 300px; max-width: 90vw;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
}
.call-modal-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  margin: 0 auto 16px; overflow: hidden;
  background: var(--navy-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-size: 26px; font-weight: 600;
  animation: ring-pulse 1.5s infinite;
}
@keyframes ring-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(20,44,84,.35)} 60%{box-shadow:0 0 0 20px rgba(20,44,84,0)} }
.call-modal-name { font-size: 20px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.call-modal-sub  { font-size: 13px; color: var(--muted); margin-bottom: 32px; }
.call-actions    { display: flex; gap: 24px; justify-content: center; }
.call-action-btn {
  width: 64px; height: 64px; border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform .1s, filter .15s;
}
.call-action-btn:active { transform: scale(.9); }
.call-action-btn.accept  { background: #16a34a; }
.call-action-btn.decline { background: #dc2626; }
.call-action-label { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ── Active call overlay ── */
.active-call-overlay {
  display: none; position: fixed; inset: 0; z-index: 9995;
  background: #080f18; flex-direction: column;
}
.active-call-overlay.is-open { display: flex; }
#remote-video  { width:100%; height:100%; object-fit:cover; display:block; background:#000; }
#local-video   {
  position: absolute; bottom: 16px; right: 16px;
  width: 110px; height: 82px; object-fit: cover;
  border-radius: 8px; border: 2px solid rgba(255,255,255,.25);
}
.call-audio-ui {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: #fff;
}
.call-audio-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--navy); display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 600; color: var(--gold); margin-bottom: 20px;
  box-shadow: 0 0 0 16px rgba(255,255,255,.04), 0 0 0 32px rgba(255,255,255,.02);
}
.call-audio-name   { font-size: 26px; font-weight: 600; margin-bottom: 8px; }
.call-status-label { font-size: 14px; color: rgba(255,255,255,.55); }
.call-controls {
  padding: 20px 32px 28px; display: flex; gap: 16px;
  justify-content: center; align-items: center;
  background: rgba(0,0,0,.45); backdrop-filter: blur(8px);
}
.call-ctrl-btn {
  width: 52px; height: 52px; border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer; transition: transform .1s, background .15s;
  background: rgba(255,255,255,.12);
}
.call-ctrl-btn:active { transform: scale(.9); }
.call-ctrl-btn.toggled { background: rgba(255,255,255,.28); }
.call-ctrl-btn.hangup  { background: #dc2626; width: 60px; height: 60px; }
.call-ctrl-btn.hangup:hover { background: #b91c1c; }
#call-timer-badge {
  font-size: 13px; color: rgba(255,255,255,.75);
  min-width: 46px; text-align: center; font-variant-numeric: tabular-nums;
}
