/* ==========================================================================
   charms.css - charms bar, the clock/status block, and the flyout panes
   ========================================================================== */

/* Scrim darkens whatever is behind the charms, as Windows 8 did. */
.charms-scrim {
  position: fixed;
  inset: 0;
  z-index: 240;
  background: rgba(0, 0, 0, 0.35);
  animation: fade-in var(--dur-med) var(--ease-std) both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.charms-scrim.is-leaving { animation: fade-out var(--dur-fast) var(--ease-std) both; }
@keyframes fade-out { to { opacity: 0; } }

/* --------------------------------------------------------------------------
   CHARMS BAR
   -------------------------------------------------------------------------- */
.charms {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 250;
  width: 88px;
  background: var(--charms-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  animation: charms-in 220ms var(--ease-out) both;
}
@keyframes charms-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.charms.is-leaving { animation: charms-out 180ms var(--ease-in) both; }
@keyframes charms-out {
  to { transform: translateX(100%); }
}

.charm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 9px 0;
  color: rgba(255, 255, 255, 0.9);
  transition: color var(--dur-fast) var(--ease-std);
}
.charm:hover { color: #fff; }

.charm-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  transition: transform var(--dur-fast) var(--ease-out);
}
.charm-icon svg { width: 30px; height: 30px; }
.charm:hover .charm-icon { transform: scale(1.06); }
.charm:active .charm-icon { transform: scale(0.94); }

.charm-label { font-size: 12px; font-weight: 400; }

/* The Start charm is visually dominant and picks up the accent on hover,
   the only charm that ever showed colour. */
.charm-start .charm-icon svg { width: 34px; height: 34px; }
.charm-start:hover .charm-icon { color: var(--accent); }

/* --------------------------------------------------------------------------
   CLOCK / STATUS BLOCK
   Slides in bottom-left whenever the charms are open.
   -------------------------------------------------------------------------- */
.charms-info {
  position: fixed;
  left: 44px;
  bottom: 44px;
  z-index: 245;
  animation: info-in 260ms var(--ease-out) both;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
@keyframes info-in {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: none; }
}
.charms-info.is-leaving { animation: info-out 180ms var(--ease-in) both; }
@keyframes info-out {
  to { opacity: 0; transform: translateX(-40px); }
}

.charms-info-time {
  font-family: var(--font-light);
  font-weight: 200;
  font-size: 58px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.charms-info-date {
  font-family: var(--font-light);
  font-weight: 300;
  font-size: 21px;
  margin-top: 4px;
}

.charms-info-status {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.92);
}
.charms-info-status svg { width: 21px; height: 21px; }

/* --------------------------------------------------------------------------
   FLYOUT PANE - Settings, Search, Share, Devices
   -------------------------------------------------------------------------- */
.flyout {
  position: fixed;
  top: 0;
  right: 88px;
  bottom: 0;
  z-index: 252;
  width: 320px;
  background: var(--accent);
  display: flex;
  flex-direction: column;
  animation: flyout-in 220ms var(--ease-out) both;
  overflow-y: auto;
}
@keyframes flyout-in {
  from { transform: translateX(calc(100% + 88px)); }
  to   { transform: translateX(0); }
}
.flyout.is-leaving { animation: flyout-out 180ms var(--ease-in) both; }
@keyframes flyout-out {
  to { transform: translateX(calc(100% + 88px)); }
}

.flyout-header {
  padding: 22px 20px 16px;
  font-family: var(--font-light);
  font-weight: 300;
  font-size: 25px;
  line-height: 1.1;
}

.flyout-section { padding: 0 20px; }

/* Text links stacked in the upper half of the Settings pane. */
.flyout-links { padding: 4px 20px 20px; }
.flyout-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 0;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  transition: color var(--dur-fast) var(--ease-std);
}
.flyout-link:hover { color: #fff; text-decoration: underline; }
.flyout-link small { display: block; font-size: 12px; opacity: 0.7; }

.flyout-spacer { flex: 1 1 auto; min-height: 20px; }

/* The six quick-toggle icons at the bottom of the Settings pane. */
.flyout-quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 6px;
  padding: 20px;
}

.flyout-quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  color: #fff;
  font-size: 12px;
  text-align: center;
  transition: opacity var(--dur-fast) var(--ease-std);
}
.flyout-quick-item:hover { opacity: 0.75; }
.flyout-quick-item svg { width: 30px; height: 30px; }
.flyout-quick-item span { line-height: 1.2; }

.flyout-footer {
  padding: 14px 20px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.flyout-footer button {
  font-size: 15px;
  color: #fff;
}
.flyout-footer button:hover { text-decoration: underline; }

/* -- search flyout --------------------------------------------------------- */
.flyout-search-field {
  display: flex;
  margin: 0 20px 18px;
  background: #fff;
}
.flyout-search-field input {
  flex: 1;
  height: 34px;
  padding: 0 10px;
  border: 0;
  font-size: 15px;
  color: #1a1a1a;
  background: transparent;
}
.flyout-search-field button {
  width: 34px;
  display: grid;
  place-items: center;
  color: #666;
}
.flyout-search-field button svg { width: 17px; height: 17px; }

.flyout-results { padding: 0 20px 20px; }
.flyout-result {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 8px;
  text-align: left;
  transition: background-color var(--dur-fast) var(--ease-std);
}
.flyout-result:hover { background: rgba(255, 255, 255, 0.16); }
.flyout-result-icon {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--tile-color, rgba(0, 0, 0, 0.25));
}
.flyout-result-icon svg { width: 17px; height: 17px; }
.flyout-result-text { font-size: 14px; line-height: 1.25; }
.flyout-result-text small { display: block; font-size: 12px; opacity: 0.72; }

.flyout-empty {
  padding: 8px 20px 20px;
  font-size: 14px;
  opacity: 0.8;
}

/* -- device / share list --------------------------------------------------- */
.flyout-list { padding: 0 20px 20px; }
.flyout-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 8px;
  text-align: left;
  font-size: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  transition: background-color var(--dur-fast) var(--ease-std);
}
.flyout-list-item:hover { background: rgba(255, 255, 255, 0.14); }
.flyout-list-item svg { width: 22px; height: 22px; flex: none; }
.flyout-list-item small { display: block; font-size: 12px; opacity: 0.72; }

/* -- power menu ------------------------------------------------------------ */
.power-menu {
  position: absolute;
  right: 20px;
  bottom: 108px;
  min-width: 152px;
  background: #2b2b2b;
  box-shadow: 0 3px 18px rgba(0, 0, 0, 0.55);
  padding: 4px 0;
  animation: size-menu-in 140ms var(--ease-out) both;
}
.power-menu-item {
  display: block;
  width: 100%;
  padding: 10px 18px;
  text-align: left;
  font-size: 14px;
  color: #fff;
  transition: background-color var(--dur-fast) var(--ease-std);
}
.power-menu-item:hover { background: var(--accent); }

/* --------------------------------------------------------------------------
   TOAST - the Windows 8 notification banner
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 400;
  min-width: 250px;
  max-width: 330px;
  padding: 14px 17px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 3px 20px rgba(0, 0, 0, 0.45);
  animation: toast-in 260ms var(--ease-out) both;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: none; }
}
.toast.is-leaving { animation: toast-out 260ms var(--ease-in) both; }
@keyframes toast-out {
  to { opacity: 0; transform: translateX(60px); }
}
.toast-icon { flex: none; display: grid; place-items: center; }
.toast-text { font-size: 14px; line-height: 1.35; }

/* -- personalise colour swatches ------------------------------------------- */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 4px 20px 20px;
}
.swatch {
  aspect-ratio: 1;
  background: var(--sw);
  box-shadow: inset 0 0 0 0 #fff;
  transition: box-shadow var(--dur-fast) var(--ease-std),
              transform var(--dur-fast) var(--ease-out);
}
.swatch:hover { transform: scale(1.08); }
.swatch.is-active { box-shadow: inset 0 0 0 3px #fff; }
