/* Visual polish. Loaded last; changes colour, depth, radius and motion only.
   Nothing here moves a control, changes what is shown, or alters layout. */

/* ---- Tokens --------------------------------------------------------------- */
:root {
  --ease-out: cubic-bezier(.22, .8, .36, 1);
  --radius-card: 12px;
  /* Resting depth for cards: a hairline lift, not a float. */
  --shadow-xs: 0 1px 2px rgba(1, 5, 8, .35);
  --shadow-hover: 0 10px 28px -12px rgba(1, 5, 8, .7), 0 2px 6px rgba(1, 5, 8, .3);
  /* A faint top highlight gives dark surfaces an edge without another border. */
  --edge-light: inset 0 1px 0 rgba(255, 255, 255, .035);
  --focus-glow: 0 0 0 3px color-mix(in srgb, var(--info) 22%, transparent);
  scrollbar-color: var(--line-strong) transparent;
}

/* Light mode leans a touch warm, towards the brand cream, with white raised
   surfaces. The media stage keeps its neutral grey so colour still reads true. */
:root[data-theme="light"] {
  --shell: #eeeeeb;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f2f2ef;
  --surface-3: #e9e9e5;
  --line: #e2e2dd;
  --line-strong: #d0d1cc;
  --accent-soft: color-mix(in srgb, var(--yellow) 24%, var(--surface));
  --shadow-xs: 0 1px 2px rgba(8, 31, 40, .06);
  --shadow-hover: 0 12px 28px -14px rgba(8, 31, 40, .28), 0 2px 6px rgba(8, 31, 40, .06);
  --shadow: 0 18px 50px -8px rgba(8, 31, 40, .18), 0 2px 8px rgba(8, 31, 40, .06);
  --shadow-sm: 0 8px 24px -6px rgba(8, 31, 40, .14), 0 1px 3px rgba(8, 31, 40, .06);
  --edge-light: 0 0 0 transparent;
}

::selection { color: var(--navy); background: color-mix(in srgb, var(--yellow) 70%, transparent); }

/* ---- Frame ------------------------------------------------------------------
   The sidebar and topbar share the shell; the work sits in one raised panel.
   On desktop the panel's own border already separates it from the sidebar, so
   the sidebar's border made a doubled line down the seam. */
@media (min-width: 981px) {
  .sidebar { border-right-color: transparent; }
}
.library-screen, .car-studio-screen, .ad-engine-screen, .people-screen {
  box-shadow: var(--edge-light), var(--shadow-xs);
}
:root[data-theme="light"] :is(.library-screen, .car-studio-screen, .ad-engine-screen, .people-screen) {
  border-color: color-mix(in srgb, var(--line) 80%, transparent);
  box-shadow: 0 1px 3px rgba(8, 31, 40, .05), 0 0 0 1px rgba(8, 31, 40, .015);
}

/* ---- Headings --------------------------------------------------------------- */
.library-hero h1 { font-weight: 650; letter-spacing: -.028em; }
.modal-header h2, .notifications-panel h2, .empty-state h2 { letter-spacing: -.022em; }

/* ---- Sidebar ---------------------------------------------------------------- */
.sidebar .browse-value, .folder-tree-row, .profile-row, .profile-menu-item, .browse-toggle, .tree-chevron {
  transition: background-color .15s ease, color .15s ease;
}
.sidebar .browse-value svg, .folder-tree-row > svg { transition: color .15s ease; }
/* The current place carries the brand: a yellow icon on the raised row. */
.sidebar .browse-value.active { box-shadow: var(--edge-light); }
.sidebar .browse-value.active svg { color: var(--accent-text); }
[aria-current="page"] > .folder-tree-row > svg { color: var(--accent-text); }
[aria-current="page"] > .folder-tree-row { font-weight: 600; box-shadow: var(--edge-light); }
.brand-mark { border-radius: 8px; }
/* Light mode: the current row is a white tab on the shell, which the shell's
   pale greys could not show on their own. */
:root[data-theme="light"] .sidebar .browse-value:hover:not(.active),
:root[data-theme="light"] .folder-tree-row:hover { background: color-mix(in srgb, var(--surface) 55%, var(--shell)); }
:root[data-theme="light"] .sidebar .browse-value.active,
:root[data-theme="light"] [aria-current="page"] > .folder-tree-row {
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(8, 31, 40, .08), 0 0 0 1px rgba(8, 31, 40, .04);
}

/* ---- Topbar and search ------------------------------------------------------ */
.search-spotlight { box-shadow: var(--shadow-xs); }
:root[data-theme="light"] .search-spotlight { background: var(--surface); }
.icon-button { transition: background-color .15s ease, color .15s ease; }

/* ---- Buttons ---------------------------------------------------------------- */
.button { transition: transform .12s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease; }
.button.primary {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 2px rgba(8, 31, 40, .2);
}
.button.primary:hover:not(:disabled) {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 3px 7px rgba(0, 0, 0, .25);
}
.button.primary:disabled { box-shadow: none; }
.button.secondary { box-shadow: var(--shadow-xs); }
.filter-button, .sort-control, .segmented, .view-actions .appearance-control summary {
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.filter-button, .sort-control, .segmented { box-shadow: var(--shadow-xs); }
.segmented button { transition: background-color .15s ease, color .15s ease; }
.segmented button.active { box-shadow: var(--shadow-xs), var(--edge-light); }

/* ---- Filters and pills ------------------------------------------------------ */
/* The selected status read as a bright ring; a filled chip is calmer and just
   as clear. */
.status-tile.active {
  border-color: color-mix(in srgb, var(--ink) 30%, transparent);
  background: var(--surface-3);
  box-shadow: var(--edge-light);
}
.category-pill.active { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-text) 30%, transparent); }
.active-filters button { transition: border-color .15s ease, background-color .15s ease; }

/* ---- Cards ------------------------------------------------------------------ */
/* Room for the hover shadow at the foot of each group's paint containment. */
.market-group { padding-bottom: 10px; }
.market-group + .market-group { margin-top: 20px; }

.asset-grid:not(.list-view):not(.board-view) .asset-card,
.campaign-project, .drive-folder {
  transition: transform .22s var(--ease-out), box-shadow .22s var(--ease-out), border-color .15s ease, background-color .15s ease;
}
.asset-grid:not(.list-view):not(.board-view) .asset-card {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-xs), var(--edge-light);
}
.asset-grid:not(.list-view):not(.board-view) .asset-card:hover {
  box-shadow: var(--shadow-hover), var(--edge-light);
  transform: translateY(-2px);
}
/* White cards in light mode: a hover tint reads as grey, so the lift does the work. */
:root[data-theme="light"] .asset-grid:not(.list-view):not(.board-view) .asset-card:hover { background: var(--surface); }

/* Status control on a grid card: a soft chip with its label beside the dot. */
.asset-grid:not(.list-view) .list-status .status-pill { border-radius: 7px; }
.card-status-button { transition: background-color .15s ease, border-color .15s ease; }
.card-status-button > span { flex: 1; text-align: left; }
.card-status-button > svg { opacity: .7; transition: opacity .15s ease; }
.card-status-button:hover:not(:disabled) > svg { opacity: 1; }
.card-status-button.not-reviewed:hover:not(:disabled) { background: color-mix(in srgb, var(--ink-2) 12%, var(--surface)); }
.card-status-button.in-review:hover:not(:disabled), .card-status-button.picture-lock:hover:not(:disabled) { background: color-mix(in srgb, var(--info) 18%, var(--surface)); }
.card-status-button.approved:hover:not(:disabled) { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); }
.card-status-button.rejected:hover:not(:disabled) { background: color-mix(in srgb, var(--danger-fill) 75%, var(--surface)); }

.campaign-project { border-radius: var(--radius-card); box-shadow: var(--shadow-xs), var(--edge-light); }
.campaign-project:not(.is-list *):hover { box-shadow: var(--shadow-hover), var(--edge-light); transform: translateY(-2px); }
:root[data-theme="light"] .campaign-project:not(.is-list *):hover { background: var(--surface); }
.campaign-project-cover img { transition: transform .5s var(--ease-out); }
.campaign-project:hover .campaign-project-cover img { transform: scale(1.03); }
.campaign-project-open { transition: transform .2s var(--ease-out), color .15s ease; }
.campaign-project:hover .campaign-project-open { color: var(--ink); transform: translateX(2px); }
.is-list .campaign-project { box-shadow: none; }

.drive-folder { border-radius: var(--radius-card); }
.drive-folder:hover { transform: translateY(-1px); }
.drive-folder > svg:last-child { transition: transform .2s var(--ease-out); }
.drive-folder:hover > svg:last-child { transform: translateX(2px); }
.is-list .drive-folder { border-radius: 0; }
.is-list .drive-folder:hover { transform: none; }

.grid-skeleton i { border-radius: var(--radius-card); }
.board-column { border-radius: var(--radius-card); box-shadow: var(--edge-light); }
.board .asset-card { transition: border-color .15s ease, box-shadow .15s ease; }
.board .asset-card:hover { box-shadow: var(--shadow-sm); }
.list-view .asset-card { transition: background-color .12s ease; }

@media (prefers-reduced-motion: reduce) {
  .asset-grid .asset-card:hover, .campaign-project:hover, .drive-folder:hover,
  .campaign-project:hover .campaign-project-cover img, .campaign-project:hover .campaign-project-open,
  .drive-folder:hover > svg:last-child { transform: none; }
}

/* ---- Menus and popovers ----------------------------------------------------- */
/* Every menu arrives the same way: a short fade and settle. They are shown by
   toggling [hidden] or [open], which restarts the animation each time. */
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.985); } }
@keyframes menu-up { from { opacity: 0; transform: translateY(4px) scale(.985); } }
.decision-menu, .download-menu, .reviewers-menu, .version-menu, .mention-menu,
.appearance-popover, .member-tools-menu, .card-status-menu, .review-more-panel {
  border-radius: var(--radius-card);
  transform-origin: top right;
  animation: menu-in .14s var(--ease-out) both;
}
.profile-menu, .bulk-menu.decision-menu, .bulk-menu.reviewers-menu {
  border-radius: var(--radius-card);
  transform-origin: bottom left;
  animation: menu-up .14s var(--ease-out) both;
}
.decision-menu button, .download-original, .version-menu button, .mention-menu button, .reviewer-option {
  transition: background-color .12s ease;
}
.notifications-panel[open] { animation: menu-in .16s var(--ease-out) both; }

/* ---- Modals and toasts ------------------------------------------------------ */
.modal-card { box-shadow: var(--shadow), var(--edge-light); }
.modal-footer { background: color-mix(in srgb, var(--bg) 92%, var(--surface)); }
.toast { box-shadow: var(--shadow), var(--edge-light); }
.share-field input, .filter-form-grid select, .filter-form-grid input[type="text"],
.filter-form-grid input[type="number"], .filter-form-grid input[type="date"],
.people-panel :is(input, select, textarea), .login-form input {
  transition: border-color .15s ease, box-shadow .15s ease;
}
.upload-dropzone { transition: border-color .15s ease, background-color .15s ease; }

/* ---- Review workspace ------------------------------------------------------- */
.review-tool, .review-icon, .reviewers-button, .decision-button, .annotation-tools button,
.comment-time, .version-actions button, .version-pill, .film-thumb, .send-button, .reaction {
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
/* The decision carries its colour as a wash as well as a border, so the
   asset's state is readable from across the screen. */
.decision-button.in-review, .decision-button.picture-lock { background: color-mix(in srgb, var(--info) 9%, var(--surface-2)); }
.decision-button.approved { background: color-mix(in srgb, var(--ok) 9%, var(--surface-2)); }
.decision-button.rejected { background: color-mix(in srgb, var(--danger-fill) 45%, var(--surface-2)); }
.decision-button.in-review:hover, .decision-button.picture-lock:hover { background: color-mix(in srgb, var(--info) 15%, var(--surface-2)); }
.decision-button.approved:hover { background: color-mix(in srgb, var(--ok) 15%, var(--surface-2)); }
.decision-button.rejected:hover { background: color-mix(in srgb, var(--danger-fill) 65%, var(--surface-2)); }

.review-screen:not(.fullscreen) .comments-panel,
.review-screen:not(.fullscreen) .annotation-tools { box-shadow: var(--edge-light); }
.comment-thread { transition: border-color .15s ease; }
.comment-thread:hover { border-color: var(--line-strong); }
.composer-box { transition: border-color .15s ease, box-shadow .15s ease; }
.composer-box:focus-within { box-shadow: var(--focus-glow); }
.send-button { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.panel-tabs button { transition: background-color .15s ease, color .15s ease; }
.panel-tabs button.active { box-shadow: var(--shadow-xs), var(--edge-light); }
.film-thumb { border-radius: 8px; }

/* ---- Login ------------------------------------------------------------------ */
.login-card { border-radius: 16px; box-shadow: var(--shadow), var(--edge-light); }
