/*
 * 3D icon tiles (v1) - raised "keycap" tiles with a glossy top, a solid edge and a soft cast shadow.
 * Pure CSS + SVG: no JavaScript, no images, no libraries, so it adds no measurable load cost.
 * The tile reacts to its parent button: lifts and tilts on hover, presses down on click.
 * Behavior of the buttons is unchanged; only the look of the icon inside them.
 */

.i3d-tile{
  --c1:#5aa9ff;--c2:#1f62d6;--edge:#143f93;
  --s:34px;
  position:relative;display:grid;place-items:center;flex:0 0 auto;
  width:var(--s);height:var(--s);border-radius:30%;
  background:linear-gradient(155deg,var(--c1),var(--c2));
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,.55),
    inset 0 -2px 3px rgba(0,0,0,.26),
    0 3px 0 var(--edge),
    0 8px 14px rgba(0,8,20,.38);
  transform:perspective(320px) rotateX(0) rotateY(0) translateY(0);
  transition:transform .18s cubic-bezier(.2,.7,.2,1),box-shadow .18s cubic-bezier(.2,.7,.2,1);
}
.i3d-tile::before{ /* glossy highlight */
  content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:linear-gradient(180deg,rgba(255,255,255,.38),rgba(255,255,255,0) 54%);
}
.i3d-tile svg{
  position:relative;width:58%;height:58%;color:#fff;
  filter:drop-shadow(0 1.5px 0 rgba(0,0,0,.28));
  pointer-events:none;
}

/* Colour themes */
.i3d-tile.c-blue  {--c1:#5aa9ff;--c2:#1f62d6;--edge:#143f93}
.i3d-tile.c-teal  {--c1:#34d3c4;--c2:#0b8a8f;--edge:#075e66}
.i3d-tile.c-green {--c1:#4fdc9a;--c2:#13915f;--edge:#0b6542}
.i3d-tile.c-red   {--c1:#ff7b8b;--c2:#d0364c;--edge:#8f1f31}
.i3d-tile.c-orange{--c1:#ffb35c;--c2:#e07a12;--edge:#9a510a}
.i3d-tile.c-amber {--c1:#ffd266;--c2:#d99a12;--edge:#946609}
.i3d-tile.c-purple{--c1:#a58bff;--c2:#6445d6;--edge:#432a99}
.i3d-tile.c-pink  {--c1:#ff8fc4;--c2:#c93a86;--edge:#8b2260}
.i3d-tile.c-indigo{--c1:#7d8cff;--c2:#3d46cf;--edge:#292f94}
.i3d-tile.c-slate {--c1:#8fb0c9;--c2:#476b88;--edge:#304a60}

/* Interaction: lift + tilt on hover, press down on click (driven by the button the tile lives in) */
:is(button,a,[role="button"],.cc-mod):hover .i3d-tile{
  transform:perspective(320px) rotateX(12deg) rotateY(-10deg) translateY(-3px);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,.6),
    inset 0 -2px 3px rgba(0,0,0,.26),
    0 5px 0 var(--edge),
    0 14px 20px rgba(0,8,20,.42);
}
:is(button,a,[role="button"],.cc-mod):active .i3d-tile{
  transform:perspective(320px) rotateX(0) rotateY(0) translateY(3px);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,.45),
    inset 0 -1px 2px rgba(0,0,0,.3),
    0 0 0 var(--edge),
    0 2px 4px rgba(0,8,20,.35);
}
:is(button,a,[role="button"]):focus-visible .i3d-tile{transform:perspective(320px) translateY(-2px)}

/* Sidebar navigation (30px tiles) */
body .nav button .ico.i3d-tile{--s:30px;width:30px;height:30px;border-radius:30%;background:linear-gradient(155deg,var(--c1),var(--c2));font-size:0}
body .nav button.active .ico.i3d-tile{background:linear-gradient(155deg,var(--c1),var(--c2));box-shadow:inset 0 1.5px 0 rgba(255,255,255,.6),inset 0 -2px 3px rgba(0,0,0,.26),0 3px 0 var(--edge),0 0 0 2px rgba(255,255,255,.7),0 8px 14px rgba(0,8,20,.4)}

/* Home: workspace module cards (big tiles) */
body.cc-shell .cc-mod .mi.i3d-tile{--s:56px;display:grid;width:56px;height:56px;margin-bottom:14px;font-size:0;border-radius:28%}

/* Home: KPI cards */
body.cc-shell .cc-kpi .ico.i3d-tile{--s:40px;width:40px;height:40px;font-size:0;background:linear-gradient(155deg,var(--c1),var(--c2))}

/* Reduced motion: keep the 3D look, drop the movement */
@media(prefers-reduced-motion:reduce){
  .i3d-tile,:is(button,a,[role="button"],.cc-mod):hover .i3d-tile,:is(button,a,[role="button"],.cc-mod):active .i3d-tile{transition:none;transform:none}
}
/* Touch devices have no hover: show only the press effect */
@media(hover:none){
  :is(button,a,[role="button"],.cc-mod):hover:not(:active) .i3d-tile{transform:perspective(320px) rotateX(0) rotateY(0) translateY(0)}
}
@media print{.i3d-tile{box-shadow:none;transform:none}}

/* White keycap with a coloured glyph: used on saturated cards where a coloured tile would blend in */
.i3d-tile.c-white{--c1:#ffffff;--c2:#d4e3f2;--edge:#8eaac6}
.i3d-tile.c-white svg{color:var(--glyph,#1f62d6);filter:drop-shadow(0 1px 0 rgba(255,255,255,.7))}

/* Sidebar built by ui/platform_navigation_v2.js: beat the older fixed-size/!important icon rules */
body.cc-shell #nav[data-labmaster-nav="v2"] .ico.i3d-tile{
  --s:32px;width:32px!important;height:32px!important;font-size:0!important;border:0!important;border-radius:30%!important;
  background:linear-gradient(155deg,var(--c1),var(--c2))!important;
  box-shadow:inset 0 1.5px 0 rgba(255,255,255,.55),inset 0 -2px 3px rgba(0,0,0,.26),0 3px 0 var(--edge),0 7px 12px rgba(0,8,20,.38)!important;
}
body.cc-shell #nav[data-labmaster-nav="v2"]>button:hover .ico.i3d-tile,
body.cc-shell .lm-group-toggle:hover .ico.i3d-tile{
  box-shadow:inset 0 1.5px 0 rgba(255,255,255,.6),inset 0 -2px 3px rgba(0,0,0,.26),0 5px 0 var(--edge),0 12px 18px rgba(0,8,20,.42)!important;
}
body.cc-shell #nav[data-labmaster-nav="v2"]>button:active .ico.i3d-tile,
body.cc-shell .lm-group-toggle:active .ico.i3d-tile{
  box-shadow:inset 0 1.5px 0 rgba(255,255,255,.45),inset 0 -1px 2px rgba(0,0,0,.3),0 0 0 var(--edge),0 2px 4px rgba(0,8,20,.35)!important;
}
body.cc-shell #nav[data-labmaster-nav="v2"]>button.active .ico.i3d-tile{
  box-shadow:inset 0 1.5px 0 rgba(255,255,255,.6),inset 0 -2px 3px rgba(0,0,0,.26),0 3px 0 var(--edge),0 0 0 2px rgba(255,255,255,.75),0 8px 14px rgba(0,8,20,.4)!important;
}
