/* ==========================================================================
   PlotBird Analytics - application styles
   Tailwind (Play CDN) generates the utility classes. This file only contains
   plain CSS: the self-hosted Inter font, the animations the dashboard uses and
   a handful of rules Tailwind has no utility for.
   Component classes built with @apply live in /templates/partials/tailwind.php,
   because the Play CDN only processes <style type="text/tailwindcss"> blocks.
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../vendor/fonts/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../vendor/fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  margin: 0;
}

/* Alpine.js: hide uninitialised markup to avoid a flash of raw templates. */
[x-cloak] {
  display: none !important;
}

/* --- Dashboard widgets ---------------------------------------------------- */

.pb-widget {
  transition: box-shadow 150ms ease, transform 150ms ease, opacity 150ms ease;
}

/* SortableJS state classes */
.pb-widget-ghost {
  opacity: 0.4;
}

.pb-widget-chosen {
  box-shadow: 0 20px 40px -20px rgb(2 132 199 / 0.55);
}

.pb-drag-handle {
  cursor: grab;
  touch-action: none;
}

.pb-drag-handle:active {
  cursor: grabbing;
}

/* Public share pages are read-only: no reordering, no handles. */
.pb-readonly .pb-drag-handle {
  display: none !important;
}

/* --- Flags ---------------------------------------------------------------- */

/* Country flags are SVG images, not emoji: Windows has no flag emoji font and
   would show the two regional indicator letters instead of a flag. */
.pb-flag {
  display: inline-block;
  width: 1.25rem;
  height: 0.9375rem;
  flex: none;
  border-radius: 2px;
  object-fit: cover;
  vertical-align: -0.15em;
  box-shadow: 0 0 0 1px rgb(15 23 42 / 0.1);
}

.pb-flag-fallback {
  width: auto;
  height: auto;
  box-shadow: none;
  font-size: 1rem;
  line-height: 1;
}

.pb-flag-lg {
  width: 1.5rem;
  height: 1.125rem;
}

/* --- Charts --------------------------------------------------------------- */

.pb-chart {
  position: relative;
  width: 100%;
}

.jvm-container {
  height: 100%;
}

.jvm-zoom-btn {
  background-color: #0284c7 !important;
}

/* --- Scrollbars ----------------------------------------------------------- */

.pb-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.pb-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.pb-scroll::-webkit-scrollbar-thumb {
  background-color: rgb(148 163 184 / 0.45);
  border-radius: 9999px;
}

.pb-scroll::-webkit-scrollbar-thumb:hover {
  background-color: rgb(100 116 139 / 0.7);
}

/* --- Animation ------------------------------------------------------------ */

.pb-fade-in {
  animation: pb-fade-in 240ms ease-out both;
}

@keyframes pb-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.pb-pulse {
  position: relative;
}

.pb-pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  background-color: currentColor;
  opacity: 0.35;
  animation: pb-pulse 1.8s ease-out infinite;
}

@keyframes pb-pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* Sortable placeholder keeps the grid from collapsing while dragging. */
.pb-grid-sorting {
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  .pb-fade-in,
  .pb-pulse::after {
    animation: none;
  }

  .pb-widget {
    transition: none;
  }
}

/* Print: a shared dashboard is often turned into a PDF. */
@media print {
  .pb-no-print {
    display: none !important;
  }

  body {
    background: #fff;
  }
}

/* Widget tabs ---------------------------------------------------------------
   A small segmented control inside a card header: Map / Countries, and the
   three device breakdowns. Plain CSS on purpose - see the note at the top. */

.pb-tabs {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.16);
}

.pb-tab {
    border-radius: 10px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: inherit;
    opacity: 0.72;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

.pb-tab:hover {
    opacity: 1;
}

.pb-tab[aria-selected="true"] {
    background: #ffffff;
    opacity: 1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.dark .pb-tab[aria-selected="true"] {
    background: rgba(30, 41, 59, 0.92);
    box-shadow: none;
}

/* The world map takes its size from the block: the ratio sets the height, and
   the cap stops it from becoming a page of its own on a wide screen. */
.pb-map {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 420px;
}

/* A list row that opens the drill-down page. */
.pb-row-link {
    display: block;
    border-radius: 10px;
    transition: background-color 0.15s ease;
}

.pb-row-link:hover {
    background: rgba(148, 163, 184, 0.14);
}

/* Tables on the details page. */
.pb-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.pb-detail-table th {
    padding: 6px 8px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.pb-detail-table td {
    padding: 7px 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.pb-detail-table tr:last-child td {
    border-bottom: 0;
}

.pb-detail-table .pb-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
/* A small monogram in front of an operating system or a browser. Letters on a
   brand-ish colour: recognisable at a glance, and no trademark artwork to
   license or ship. */

.pb-mono {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    border-radius: 6px;
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}
/* A brand mark in front of a browser or an operating system. The marks are
   coloured, so each sits on a light plate: it stays legible on a dark card, and
   the row keeps one rhythm whatever the logo's own shape is. */

.pb-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: #f8fafc;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28);
}

.dark .pb-icon {
    background: #e2e8f0;
}

/* Interface glyphs need no plate: they are drawn in the text colour. */
.pb-icon-plain {
    background: none;
    box-shadow: none;
    color: inherit;
}

.pb-brand {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    object-fit: contain;
}
