/* ================================================================
   L'Atelier Crème — Dashboard-specific styles
   ----------------------------------------------------------------
   Base styles live in /common/css/panel.css
   This file contains ONLY atelier dashboard–specific components.
   ================================================================ */


/* ================================================================
   CONTENT WRAPPER
   ================================================================ */

#content {
  width: 100%;
}

/* ================================================================
   INSIGHT CARD (sparkline)
   ================================================================ */

.insight-card {
  background: linear-gradient(180deg, color-mix(in srgb, #3905c8 5%, #fff) 0%, #fff 50%);
  border: 2.5px solid #171412;
  border-radius: 1.55rem;
  box-shadow: 7px 7px 0 #171412;
  padding: 1.5rem 1.3rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.insight-card .card-header { margin-bottom: 1.1rem; }

/* Live tag */
.tag-live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #ffea29;
  color: #171412;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 14px;
  border: 2.5px solid #171412;
  border-radius: 50px;
  box-shadow: 3px 3px 0 #171412;
  transform: rotate(-3deg);
}
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #171412;
  animation: live-blink 1.4s ease-in-out infinite;
}
@keyframes live-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* --- Activity Curve Chart --- */

.chart-area {
  position: relative;
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 200px;
  background: #fffdf7;
  border: 2px solid #e5e2da;
  border-radius: 0.85rem;
  overflow: hidden;
  cursor: crosshair;
}

.chart-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-hover-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: #171412;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 3;
}

.chart-hover-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid #3905c8;
  box-shadow: 0 2px 6px rgba(57, 5, 200, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 0.12s ease;
  z-index: 4;
}

.chart-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.chart-tooltip {
  position: absolute;
  z-index: 10;
  background: #171412;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  white-space: nowrap;
  box-shadow: 3px 3px 0 rgba(57, 5, 200, 0.22);
  transform: translateX(-50%);
}
.chart-tooltip.is-visible {
  opacity: 1;
}
.chart-tooltip-date {
  font-size: 0.6rem;
  font-weight: 600;
  color: #b5ada5;
  margin-bottom: 2px;
}
.chart-tooltip-val {
  font-size: 0.85rem;
  font-weight: 800;
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0.15rem 0;
}
.chart-axis-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #8e827c;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chart-legend {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #171412;
}
.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.chart-legend-dot {
  width: 18px;
  height: 3px;
  border-radius: 2px;
}
.chart-legend-dot--purple { background: #3905c8; }
.chart-legend-dot--green  { background: #00c26b; }

/* ================================================================
   CARD TITLE OVERRIDE — bigger for dashboard
   ================================================================ */

.card-title {
  font-size: clamp(1.25rem, 5vw, 1.55rem);
}

/* ================================================================
   CARD-NUM VARIANTS
   ================================================================ */

.card-num--green  { background: #00c26b; }
.card-num--orange { background: #fc6b44; }
.card-num--yellow { background: #ffea29; color: #171412; }

/* ================================================================
   VILLES CARD — Podium
   ================================================================ */

.card-villes {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  padding-bottom: 0;
}

.card-villes::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(57, 5, 200, 0.055) 0 1px, transparent 1px),
    linear-gradient(180deg, rgba(57, 5, 200, 0.055) 0 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
}

.podium-wrap {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.7rem;
  min-height: 286px;
  margin-right: -1.15rem;
  margin-bottom: -1.15rem;
  margin-left: -1.15rem;
  padding: 1.25rem 1.15rem 0;
  z-index: 1;
}

.podium-empty {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #8e827c;
  padding: 2rem 0;
  width: 100%;
}

.podium-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  max-width: 145px;
}

.podium-col--1 {
  flex: 1.12;
}

.podium-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 0.55rem;
  border: 2.5px solid #171412;
  border-radius: 999px;
  box-shadow: 3px 3px 0 #171412;
  font-size: 1.3rem;
  transform: rotate(-6deg);
}

.podium-col--1 .podium-medal {
  width: 62px;
  height: 62px;
  background: #ffea29;
  font-size: 1.55rem;
  transform: rotate(5deg);
}

.podium-col--2 .podium-medal {
  background: #3905c8;
  color: #ffea29;
}

.podium-col--3 .podium-medal {
  background: #00c26b;
  color: #ffffff;
}

.podium-label {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  color: #171412;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-count {
  margin: 0.3rem 0 0.7rem;
  color: #57534e;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.podium-bar {
  position: relative;
  display: flex;
  width: 100%;
  align-items: flex-start;
  justify-content: center;
  border: 2.5px solid #171412;
  border-bottom-width: 0;
  border-radius: 1.05rem 1.05rem 0 0;
  box-shadow: 5px 0 0 #171412;
  overflow: hidden;
}

.podium-bar::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1.5px dashed rgba(23, 20, 18, 0.18);
  border-radius: 0.65rem 0.65rem 0 0;
  pointer-events: none;
}

.podium-rank {
  position: relative;
  z-index: 1;
  margin-top: 0.78rem;
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.08em;
}

.podium-bar--1 {
  height: 204px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34) 0 26%, transparent 27%),
    #ffea29;
}

.podium-bar--2 {
  height: 166px;
  background:
    linear-gradient(135deg, rgba(255, 234, 41, 0.24) 0 26%, transparent 27%),
    #3905c8;
}

.podium-bar--3 {
  height: 140px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24) 0 26%, transparent 27%),
    #00c26b;
}

.podium-bar--1 .podium-rank { color: #171412; }
.podium-bar--2 .podium-rank { color: #ffea29; }
.podium-bar--3 .podium-rank { color: #ffffff; }

.podium-wrap::after {
  display: none;
}

/* ================================================================
   SOURCES DU TRAFIC — Card background
   ================================================================ */

.card-sources {
  background-color: #ffffff;
  position: relative;
  overflow: hidden;
}

.card-sources::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(0, 194, 107, 0.10);
  pointer-events: none;
}

.card-sources::after {
  content: "";
  position: absolute;
  top: -80px;
  left: -80px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255, 234, 41, 0.18);
  pointer-events: none;
}

.card-sources .card-header {
  position: relative;
  z-index: 1;
}

.card-sources .card-header::after {
  display: none;
}

.card-sources .bar-list::after {
  content: "";
  position: absolute;
  bottom: -80px;
  right: -40px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: none;
  background: rgba(252, 107, 68, 0.12);
  pointer-events: none;
  z-index: 0;
}

.card-sources .bar-list {
  position: relative;
  z-index: 1;
}

/* ================================================================
   PAGES POPULAIRES — Card background + Ranking list
   ================================================================ */

.card-pages {
  background-color: #ffffff;
  position: relative;
  overflow: hidden;
}

.card-pages::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 140px;
  height: 140px;
  pointer-events: none;
  background-image: url("/common/assets/noun-splash-purple.svg");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.5;
}

.card-pages::after {
  content: "";
  position: absolute;
  bottom: -50px;
  left: -50px;
  width: 130px;
  height: 130px;
  pointer-events: none;
  background-image: url("/common/assets/noun-splash-yellow.svg");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.5;
}

.card-pages .bar-list::after {
  content: "";
  position: absolute;
  top: 40%;
  left: -40px;
  width: 110px;
  height: 110px;
  pointer-events: none;
  z-index: 0;
  background-image: url("/common/assets/noun-splash-green.svg");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.45;
}

.page-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0;
  border-bottom: 1.5px solid #f0ede5;
}
.page-row:last-child { border-bottom: none; }

.page-rank {
  flex-shrink: 0;
  width: 28px;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #c8c2ba;
  text-align: right;
  line-height: 1;
}

.page-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.32rem;
  min-width: 0;
}

.page-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: #171412;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}

.page-track {
  width: 100%;
  height: 6px;
  background: #f0ede5;
  border-radius: 999px;
  overflow: hidden;
}

.page-fill {
  height: 100%;
  border-radius: 999px;
  background: #3905c8;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.page-fill.bar-fill--yellow { background: #ffea29; }
.page-fill.bar-fill--green  { background: #00c26b; }
.page-fill.bar-fill--orange { background: #fc6b44; }
.page-fill.bar-fill--purple { background: #3905c8; }
.page-fill.bar-fill--pink   { background: #ff66bc; }
.page-fill.bar-fill--blue   { background: #43c1f9; }

.page-count {
  flex-shrink: 0;
  font-size: 1.05rem;
  font-weight: 900;
  color: #171412;
  letter-spacing: -0.03em;
  min-width: 2ch;
  text-align: right;
}

/* ================================================================
   GRID HELPERS
   ================================================================ */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.grid-3-appareils {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* ================================================================
   BAR LIST (devices, sources, pages, cities)
   ================================================================ */

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.bar-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.bar-row-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #171412;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.bar-row-value {
  font-size: 0.8rem;
  font-weight: 700;
  color: #8e827c;
  flex-shrink: 0;
}

.bar-track {
  width: 100%;
  height: 10px;
  background: #f5f2ea;
  border-radius: 5px;
  border: 1.5px solid #e5e2da;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  background: #3905c8;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-fill--yellow { background: #ffea29; }
.bar-fill--green  { background: #00c26b; }
.bar-fill--orange { background: #fc6b44; }
.bar-fill--purple { background: #3905c8; }
.bar-fill--pink   { background: #ff66bc; }
.bar-fill--blue   { background: #43c1f9; }

.bar-empty {
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #8e827c;
}

/* ================================================================
   DONUT CHART (appareils)
   ================================================================ */

.donut-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.5rem 0 0.75rem;
}

.donut-chart {
  position: relative;
  width: 150px;
  height: 150px;
  flex-shrink: 0;
}
.donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(0deg);
}
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #171412;
}
.donut-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid #171412;
  flex-shrink: 0;
}

/* ================================================================
   DESKTOP (min-width: 900px)
   ================================================================ */

@media (min-width: 900px) {
  #content { width: 100%; }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.25rem;
  }

  .insight-card { margin-bottom: 2.25rem; padding: 2rem; }
  .insight-card .card-header { margin-bottom: 1.4rem; }

  .grid-2 {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.25rem;
    align-items: start;
  }

  .grid-3-appareils {
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    margin-bottom: 2.25rem;
    align-items: stretch;
  }
}

#content .main-header {
  background:
    radial-gradient(circle at 86% 18%, rgba(252, 107, 68, 0.18) 0 52px, transparent 53px),
    radial-gradient(circle at 92% 88%, rgba(57, 5, 200, 0.18) 0 38px, transparent 39px),
    radial-gradient(circle at 8% 100%, rgba(0, 194, 107, 0.18) 0 110px, transparent 111px),
    linear-gradient(135deg, #ffffff 0%, #fffdf2 62%, #f4edff 100%);
  border: 2.5px solid #171412;
  border-radius: 1.6rem;
  box-shadow: 7px 7px 0 #171412;
  padding: 1.35rem;
  position: relative;
  overflow: hidden;
}

#content .main-header::after {
  display: none;
}

#content .page-badge {
  background: #3905c8;
  color: #ffea29;
  box-shadow: 3px 3px 0 #171412;
}

#content .page-title {
  font-size: clamp(2.75rem, 13vw, 4.75rem);
  max-width: 760px;
}

#content .page-title .hl {
  background-image: linear-gradient(transparent 54%, #ffea29 54%, #ffea29 88%, transparent 88%);
}

#content .page-subtitle {
  font-size: clamp(1rem, 3.2vw, 1.25rem);
  color: #57534e;
  max-width: 580px;
}

#site-url-badge {
  font-size: 0.88rem;
  padding: 0.75rem 1.25rem;
  position: relative;
  z-index: 1;
}

.grid-2 > .card,
.grid-3-appareils > .card {
  border-radius: 1.45rem;
}

.grid-2 > .card:not(.card-villes):not(.card-pages):not(.card-sources),
.grid-3-appareils > .card:not(.card-appareils) {
  background:
    linear-gradient(135deg, rgba(255, 234, 41, 0.08) 0%, transparent 42%),
    #ffffff;
  overflow: hidden;
}

.card-header {
  position: relative;
  z-index: 1;
}

.card-num {
  width: 46px;
  height: 46px;
  box-shadow: 3px 3px 0 #171412;
  border-radius: 0.75rem;
}
.card-num svg {
  width: 25px;
  height: 25px;
}


.bar-list {
  gap: 1rem;
}

.bar-row {
  gap: 0.48rem;
  position: relative;
  z-index: 1;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  border-color: #171412;
  background:
    repeating-linear-gradient(45deg, rgba(23, 20, 18, 0.06) 0 4px, transparent 4px 8px),
    #f5f2ea;
}

.bar-fill {
  border-radius: 999px;
  box-shadow: inset -2px 0 0 rgba(23, 20, 18, 0.18);
  min-width: 10px;
}

.donut-section {
  gap: 1.25rem;
}

.donut-chart {
  width: 138px;
  height: 138px;
  background: #fbf9ef;
  border: 2.5px solid #171412;
  border-radius: 999px;
  box-shadow: 4px 4px 0 #171412;
  padding: 0.5rem;
}

.donut-svg {
  filter: drop-shadow(1px 1px 0 rgba(23, 20, 18, 0.24));
}

.donut-legend {
  background: #ffffff;
  border: 2px solid #171412;
  border-radius: 1rem;
  box-shadow: 3px 3px 0 rgba(23, 20, 18, 0.18);
  padding: 0.8rem;
}

.appareils-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ================================================================
   APPAREILS CARD — clean consolidated
   ================================================================ */

.card-appareils {
  background-color: #fffef8;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 22px,
    rgba(57, 5, 200, 0.055) 22px,
    rgba(57, 5, 200, 0.055) 23px
  );
}

.card-appareils .donut-section {
  padding: 0.5rem 0;
  background: transparent;
  border: none;
  box-shadow: none;
  gap: 1.5rem;
}

.card-appareils .donut-chart {
  width: 175px;
  height: 175px;
  flex-shrink: 0;
  background: #fffef8;
}

.card-appareils .donut-svg { filter: none; }
.card-appareils .donut-svg circle:first-child { stroke: #d7d0c3; stroke-width: 3; }
.card-appareils #donut-mobile  { stroke: #3905c8; stroke-width: 3.5; }
.card-appareils #donut-desktop { stroke: #00c26b; stroke-width: 3.5; }
.card-appareils #donut-tablet  { stroke: #fc6b44; stroke-width: 3.5; }

.card-appareils .donut-center {
  width: 90px;
  height: 90px;
  margin: auto;
  border-radius: 50%;
  background-color: #fffef8;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 22px,
    rgba(57, 5, 200, 0.055) 22px,
    rgba(57, 5, 200, 0.055) 23px
  );
  border: 1.5px solid #e5e2da;
}

.card-appareils .donut-legend {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  gap: 0.55rem;
}
.card-appareils .donut-legend-item { font-size: 1rem; font-weight: 800; }
.card-appareils .donut-legend-dot  { width: 12px; height: 12px; }

.card-appareils #donut-pct-text {
  font-weight: 900;
  color: #171412;
}

/* Insight box */
.appareils-insight {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 1rem 1.1rem;
  background: #ffffff;
  border: 2px solid #e5e2da;
  border-left: 4px solid #3905c8;
  border-radius: 0.85rem;
  box-shadow: none;
  min-height: 100px;
}

.appareils-insight-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: #3905c8;
  border: 2px solid #171412;
  border-radius: 999px;
  box-shadow: 2px 2px 0 #171412;
  color: #ffffff;
}

.appareils-insight-top {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}

.appareils-insight-title {
  font-size: 1.2rem;
  font-weight: 900;
  color: #171412;
  line-height: 1;
}

.appareils-insight-text {
  font-size: 1rem;
  line-height: 1.55;
  color: #57534e;
  margin: 0;
}

.insight-highlight {
  background: linear-gradient(transparent 60%, #ffea29 60%, #ffea29 88%, transparent 88%);
  color: #171412;
  font-weight: 800;
}

@media (min-width: 900px) {
  #content .main-header {
    padding: 2rem 2.15rem;
    margin-bottom: 2.5rem;
  }

  #content .main-header::after {
    display: none;
  }

  .stats-grid {
    gap: 1.35rem;
    margin-bottom: 2.45rem;
  }

  .insight-card {
    margin-bottom: 2.45rem;
  }

  .grid-2 {
    gap: 1.6rem;
    margin-bottom: 2.45rem;
  }

  .grid-3-appareils {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.6rem;
    margin-bottom: 2.45rem;
  }

  .card-appareils {
    grid-column: span 1;
  }

  .card-appareils .appareils-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: stretch;
  }

  .card-appareils .donut-section {
    height: 100%;
    align-items: center;
  }

  .card-appareils .appareils-insight {
    margin: 0;
    height: 100%;
  }
}

@media (max-width: 520px) {
  #content .main-header {
    border-radius: 1.2rem;
    padding: 1.15rem 1rem;
  }

  #content .main-header::after {
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .donut-section {
    flex-direction: column;
    align-items: stretch;
  }

  .card-appareils .appareils-layout {
    display: flex;
    flex-direction: column;
  }

  .card-appareils .donut-chart {
    width: 146px;
    height: 146px;
  }

  .card-appareils .donut-center {
    width: 78px;
    height: 78px;
  }

  .card-appareils .appareils-insight {
    align-items: center;
    text-align: center;
  }
}

