/* Amoot.Hub Design System — shared primitives for web + panel.
   Prefer these tokens and .card / .card-header / .card-body over page-specific boxes.
   Shell owns --hub-shell-* independently; User Area owns its additional --hub-ds-* settings. */
:root {
    --hub-ds-primary: #2166ae;
    --hub-ds-primary-hover: #19528c;
    --hub-ds-primary-soft: #edf5fe;
    /* Canonical product brand colors. Use these root tokens anywhere in web or user panel. */
    --hub-ds-product-avanak: #42BFB9;
    --hub-ds-product-payamak: #FD6038;
    --hub-ds-product-koolak: #A40841;
    --hub-ds-product-owjcloud: #6A3BED;
    --hub-ds-product-alavan: #ED1944;
    --hub-ds-text: #1c3049;
    --hub-ds-heading: #172b43;
    --hub-ds-muted: #718096;
    --hub-ds-border: #edf1f5;
    --hub-ds-border-interactive: #d6e3f1;
    --hub-ds-surface: #fff;
    --hub-ds-surface-alt: #f7f9fc;
    --hub-ds-danger: #cf3650;
    --hub-ds-danger-soft: #fff2f4;
    --hub-ds-success: #20865c;
    --hub-ds-warning: #a76622;
    --hub-ds-radius: 4px;
    --hub-ds-radius-control: 4px;
    --hub-ds-shadow: 0 1px 3px rgba(29, 51, 85, .018);
    --hub-ds-focus: 0 0 0 3px rgba(33, 102, 174, .15);
    --hub-ds-space-1: 4px;
    --hub-ds-space-2: 8px;
    --hub-ds-space-3: 12px;
    --hub-ds-space-4: 16px;
    --hub-ds-space-5: 20px;
    --hub-ds-space-6: 24px;
    --hub-ds-card-padding: var(--hub-ds-space-6);
    --hub-ds-skeleton-base: #eef1f6;
    --hub-ds-skeleton-highlight: #f8f9fb;
    --hub-ds-skeleton-duration: 1.6s;
}

/* Reusable product context: add a .hub-ds-product--* modifier to any container.
   Children may consume --hub-ds-product-color (exact brand color),
   --hub-ds-product-ink (legible brand-colored text on white / pale surfaces),
   --hub-ds-product-on-color (contrasting text on solid brand background),
   and --hub-ds-product-soft (a restrained tinted surface).
   The root --hub-ds-product-* values remain accessible without a modifier. */
.hub-ds-product--avanak {
    --hub-ds-product-color: var(--hub-ds-product-avanak);
    --hub-ds-product-ink: #0C736E;
    --hub-ds-product-on-color: #fff;
}
.hub-ds-product--payamak {
    --hub-ds-product-color: var(--hub-ds-product-payamak);
    --hub-ds-product-ink: #A73517;
    /* The primary background must be the EXACT product brand token.
       Dark ink preserves WCAG AA contrast on this orange surface. */
    --hub-ds-product-on-color: #fff;
    --hub-ds-product-action-bg: var(--hub-ds-product-payamak);
}
.hub-ds-product--koolak {
    --hub-ds-product-color: var(--hub-ds-product-koolak);
    --hub-ds-product-ink: var(--hub-ds-product-koolak);
    --hub-ds-product-on-color: #fff;
}
.hub-ds-product--owjcloud {
    --hub-ds-product-color: var(--hub-ds-product-owjcloud);
    --hub-ds-product-ink: var(--hub-ds-product-owjcloud);
    --hub-ds-product-on-color: #fff;
}
.hub-ds-product--alavan {
    --hub-ds-product-color: var(--hub-ds-product-alavan);
    --hub-ds-product-ink: #B50D32;
    --hub-ds-product-on-color: #fff;
    --hub-ds-product-action-bg: color-mix(in srgb, var(--hub-ds-product-alavan) 95%, #000);
}
:where(.hub-ds-product--avanak, .hub-ds-product--payamak, .hub-ds-product--koolak, .hub-ds-product--owjcloud, .hub-ds-product--alavan) {
    --hub-ds-product-soft: color-mix(in srgb, var(--hub-ds-product-color) 9%, #fff);
}

/* Site cards opt in via .hub-ds-card; panel .card is governed by panel-components.css.
   The semantic card classes are shared across both surfaces. */
body[data-hub-surface="web"] .card.hub-ds-card {
    min-width: 0;
    max-width: 100%;
    border: 1px solid var(--hub-ds-border);
    border-radius: var(--hub-ds-radius);
    background: var(--hub-ds-surface);
    box-shadow: var(--hub-ds-shadow);
    overflow-wrap: anywhere;
}
body[data-hub-surface="web"] .card.hub-ds-card > .card-header {
    background: transparent;
    color: var(--hub-ds-heading);
    border-color: var(--hub-ds-border);
}
body[data-hub-surface="web"] .card.hub-ds-card > .card-body { min-width: 0; padding: var(--hub-ds-card-padding); }

/* One skeleton grammar for Razor partials and AJAX-generated placeholders. */
.hub-skeleton { width: 100%; min-width: 0; max-width: 100%; }
.hub-skeleton__card.card,
.hub-skeleton__line-card.card {
    min-width: 0;
    border: 1px solid var(--hub-ds-border);
    border-radius: var(--hub-ds-radius) !important;
    background: var(--hub-ds-surface);
    box-shadow: var(--hub-ds-shadow);
}
.hub-skeleton__card > .card-body,
.hub-skeleton__line-card > .card-body { padding: var(--hub-ds-card-padding); }
.hub-skeleton__card { min-height: 160px; }
.hub-skeleton__line-card { min-height: 76px; margin-bottom: var(--hub-ds-space-3); }
.hub-skeleton__bar,
.hub-skeleton__circle,
.hub-skeleton__pill {
    display: block;
    flex-shrink: 0;
    background: linear-gradient(100deg, var(--hub-ds-skeleton-base) 18%, var(--hub-ds-skeleton-highlight) 48%, var(--hub-ds-skeleton-base) 78%);
    background-size: 210% 100%;
    animation: hub-ds-skeleton-shimmer var(--hub-ds-skeleton-duration) linear infinite;
}
.hub-skeleton__bar { width: 100%; height: 13px; margin-bottom: var(--hub-ds-space-4); border-radius: var(--hub-ds-radius); }
.hub-skeleton__bar:last-child { margin-bottom: 0; }
.hub-skeleton__bar--wide { width: 78%; }
.hub-skeleton__bar--medium { width: 94%; }
.hub-skeleton__bar--short { width: 54%; }
.hub-skeleton__bar--tiny { width: 32px; }
.hub-skeleton__bar--w-45 { width: 45%; }
.hub-skeleton__bar--w-70 { width: 70%; }
.hub-skeleton__bar--w-85 { width: 85%; }
.hub-skeleton__bar--thin { height: 8px; }
.hub-skeleton__pill { height: 26px; width: 86px; border-radius: 999px; }
.hub-skeleton__circle { width: 42px; height: 42px; border-radius: 50%; }
.hub-skeleton__row { display: flex; align-items: center; gap: var(--hub-ds-space-3); min-width: 0; }
.hub-skeleton__row > .hub-skeleton__bar { min-width: 0; flex-shrink: 1; margin-bottom: 0; }
.hub-skeleton__list { display: grid; gap: var(--hub-ds-space-4); }
.hub-skeleton--inline { padding-block: var(--hub-ds-space-3); }
.hub-skeleton--dashboard-widget .hub-skeleton__card { min-height: 140px; }
.hub-skeleton--dashboard-panel .hub-skeleton__card,
.hub-skeleton--dashboard-panel-services .hub-skeleton__card { min-height: 470px; }
.hub-skeleton--dashboard-panel-sm .hub-skeleton__card { min-height: 350px; }
.hub-skeleton--dashboard-panel .hub-skeleton__card > .card-body,
.hub-skeleton--dashboard-panel-services .hub-skeleton__card > .card-body,
.hub-skeleton--dashboard-panel-sm .hub-skeleton__card > .card-body { padding: var(--hub-ds-space-5); }
.hub-skeleton--dashboard-widget .hub-skeleton__card > .card-body { padding: var(--hub-ds-space-5); }
.hub-skeleton--dashboard-panel .hub-skeleton__list,
.hub-skeleton--dashboard-panel-services .hub-skeleton__list,
.hub-skeleton--dashboard-panel-sm .hub-skeleton__list { margin-top: var(--hub-ds-space-6); }
.hub-skeleton--dashboard-widget .hub-skeleton__row { margin-bottom: var(--hub-ds-space-6); justify-content: space-between; }
.hub-skeleton--dashboard-panel .hub-skeleton__row:first-child,
.hub-skeleton--dashboard-panel-services .hub-skeleton__row:first-child,
.hub-skeleton--dashboard-panel-sm .hub-skeleton__row:first-child { justify-content: space-between; }
@keyframes hub-ds-skeleton-shimmer { to { background-position-x: -210%; } }
@media (prefers-reduced-motion: reduce) {
    .hub-skeleton__bar, .hub-skeleton__circle, .hub-skeleton__pill { animation: none; }
}
@media (max-width: 575.98px) {
    :root { --hub-ds-card-padding: var(--hub-ds-space-4); }
    .hub-skeleton--dashboard-panel .hub-skeleton__card,
    .hub-skeleton--dashboard-panel-services .hub-skeleton__card,
    .hub-skeleton--dashboard-panel-sm .hub-skeleton__card { min-height: 240px; }
}

/* Homepage cards maintain legacy list structure until migrated. */
body[data-hub-surface="web"] .card.hub-ds-card.box-posts > .card-header {
    padding: 0;
    border: 0;
    background: transparent;
}
body[data-hub-surface="web"] .card.hub-ds-card.box-posts > .card-body { padding: 0; }
body[data-hub-surface="web"] .card.hub-ds-card.product-brand-box > .card-body { padding: var(--hub-ds-space-4); }

/* Tiny viewports: prevent logos, callouts and contact cards from overflowing. */
body[data-hub-surface="web"] .card.hub-ds-card { min-width: 0; }
body[data-hub-surface="web"] .card.hub-ds-card img { max-width: 100%; }
