/* TackedOn Depth v1.0
   Visual-only enhancement. No JavaScript, API or layout logic changed.
   Load AFTER tackedon-theme.css.
*/
:root {
  --depth-shadow-sm: 0 2px 5px rgba(26,22,43,.045), 0 8px 20px rgba(26,22,43,.055);
  --depth-shadow-md: 0 3px 7px rgba(26,22,43,.045), 0 14px 34px rgba(26,22,43,.09);
  --depth-shadow-lg: 0 7px 15px rgba(26,22,43,.08), 0 24px 52px rgba(26,22,43,.14);
  --depth-accent: #ef565c;
}

/* Soft ambient light, without changing selected theme colours */
.main {
  position: relative;
  isolation: isolate;
}
.main::before {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  inset: 0 0 0 244px;
  background:
    radial-gradient(ellipse 44% 38% at 93% 4%, rgba(239,86,92,.075), transparent 80%),
    radial-gradient(ellipse 35% 42% at 24% 86%, rgba(114,93,175,.05), transparent 85%);
}

/* Consistent card elevation across all existing and injected modules */
.main .card,
.main .sd-card,
.main .sr-card,
.main .rc-panel,
.main .rc-card,
.main .trends-metric,
.main .intel-box {
  box-shadow: var(--depth-shadow-sm);
  transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
}
.main .card:hover,
.main .sd-card:hover,
.main .sr-card:hover,
.main .rc-panel:hover,
.main .rc-card:hover,
.main .trends-metric:hover,
.main .intel-box:hover {
  box-shadow: var(--depth-shadow-md);
}

/* Interactive cards rise slightly, but not forms or conversation panes */
.main .metric:hover,
.main .trends-metric:hover,
.main .ticket:hover {
  transform: translateY(-2px);
}
.main .metric,
.main .trends-metric {
  position: relative;
  overflow: hidden;
}
.main .metric::before,
.main .trends-metric::before {
  content: "";
  position: absolute;
  top: 0; left: 18px; right: 18px;
  height: 2px;
  border-radius: 0 0 5px 5px;
  background: linear-gradient(90deg, transparent, rgba(239,86,92,.38), transparent);
}

/* Daily brief: richer depth, inner highlight and ambient coral glow */
.main .hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  box-shadow: var(--depth-shadow-lg), inset 0 1px 0 rgba(255,255,255,.14);
}
.main .hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 45%;
  aspect-ratio: 1;
  right: -8%;
  top: -170%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,120,118,.28), transparent 72%);
  pointer-events: none;
}
.main .hero h2,
.main .hero-count {
  text-shadow: 0 2px 9px rgba(0,0,0,.14);
}

/* Small Outlook / D1 connection tiles remain compact */
.main .health,
.main .db-bar {
  box-shadow: var(--depth-shadow-sm), inset 0 1px 0 rgba(255,255,255,.45);
}
.main .health:hover,
.main .db-bar:hover {
  box-shadow: var(--depth-shadow-md);
}

/* Sidebar and selected navigation item */
.sidebar {
  box-shadow: 6px 0 28px rgba(21,17,40,.12);
  position: relative;
  z-index: 2;
}
.sidebar .nav button {
  transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}
.sidebar .nav button:hover {
  transform: translateX(2px);
}
.sidebar .nav button.active {
  box-shadow: 0 6px 17px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.12);
}

/* Buttons feel tactile, with accessible focus still controlled by original CSS */
.main .btn,
.main button[class*="rc-"],
.main button[class*="sr-"] {
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.main .btn:not(:disabled):hover,
.main button[class*="rc-"]:not(:disabled):hover,
.main button[class*="sr-"]:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(26,22,43,.12);
}
.main .btn:not(:disabled):active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(26,22,43,.1);
}

/* Input clarity */
.main input:not([type="checkbox"]),
.main select,
.main textarea {
  transition: border-color .18s ease, box-shadow .18s ease;
}
.main input:focus,
.main select:focus,
.main textarea:focus {
  box-shadow: 0 0 0 4px rgba(239,86,92,.09);
}

/* Ticket selection */
.main .ticket {
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.main .ticket.active {
  box-shadow: 0 3px 13px rgba(78,61,124,.1);
}

/* Respect users who prefer reduced animation */
@media (prefers-reduced-motion: reduce) {
  .main .card, .main .sd-card, .main .sr-card,
  .main .rc-panel, .main .rc-card, .main .trends-metric,
  .main .intel-box, .main .metric, .main .ticket,
  .main .btn, .sidebar .nav button {
    transition: none !important;
    transform: none !important;
  }
}
@media (max-width: 700px) {
  .main::before { inset: 0; }
  .sidebar { box-shadow: 0 5px 18px rgba(21,17,40,.12); }
}

/* Compact touch layouts: keep long subjects and controls inside their panels. */
@media (max-width: 700px) {
  .main, .main .view, .main .card, .main .workspace-grid > *, .main .cp-facts > * { min-width: 0; }
  .main .workspace-grid { grid-template-columns: minmax(0,1fr) !important; }
  .main .section-heading, .main .toolbar, .main .cp-actions, .main .cp-tabs { flex-wrap: wrap; }
  .main .ticket-title, .main .cp-fact, .main .detail-head h2, .main .message { overflow-wrap: anywhere; }
  .main input:not([type=checkbox]):not([type=radio]), .main select, .main textarea { max-width: 100%; font-size: 16px; }
  .main .btn, .main .cp-btn, .main .cp-tabs button { min-height: 44px; white-space: normal; }
  .main .cp-metrics, .main .cp-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .main .ticket:hover, .main .metric:hover { transform: none; }
  #clientAssignmentPanel > div { max-width: calc(100vw - 24px); max-height: 85dvh; overflow-y: auto; }
}
@media (max-width: 380px) {
  .main .cp-metrics, .main .cp-facts { grid-template-columns: minmax(0,1fr); }
}
