/*
 * Aswaf frontend: 00-foundation.css
 * Responsibility: tokens, base elements, shared cards, badges, and progress styles.
 * This file was split from assets/css/frontend.css; keep import order in frontend.css.
 */

/*
 * Aswaf Frontend CSS — v5.0.0
 * ════════════════════════════════════════════════════
 * DESIGN TOKEN SYSTEM:
 *   Edit ONE place — --asw-* variables in :root
 *   All colors, radius, shadows inherit from here
 *   Buttons inherit from xStore CSS vars where available
 * ════════════════════════════════════════════════════
 */

/* ════════════════════════════════════════════
   SKELETON → CONTENT REVEAL
   Inline CSS shows skeleton + hides .asw-sc-real.
   When THIS stylesheet loads, we flip that.
════════════════════════════════════════════ */
.asw-skel-wrap .asw-sc-skel {
  display: none !important;
}
.asw-skel-wrap .asw-sc-real {
  display: block !important;
  animation: asw-skel-fadein 0.35s ease-out;
}
@keyframes asw-skel-fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ════════════════════════════════════════════
   DESIGN TOKENS — Edit here to change everything
════════════════════════════════════════════ */
:root {
  /* ── Brand Colors ── */
  --asw-site-primary: var(
    --e-global-color-primary,
    var(--et_active-color, #5e17eb)
  );
  --asw-site-secondary: var(--e-global-color-secondary, #ffb23b);
  --asw-site-accent: var(--e-global-color-accent, #27ae60);
  --asw-gold: var(--asw-site-secondary);
  --asw-gold-lt: color-mix(in srgb, var(--asw-gold) 14%, #fff);
  --asw-gold-dk: color-mix(in srgb, var(--asw-gold) 72%, #111);
  --asw-red: #c0392b;
  --asw-red-lt: #fce8e6;
  --asw-green: var(--asw-site-accent);
  --asw-green-lt: color-mix(in srgb, var(--asw-green) 12%, #fff);
  --asw-green-dk: color-mix(in srgb, var(--asw-green) 76%, #111);
  --asw-blue: color-mix(
    in srgb,
    var(--asw-site-primary) 78%,
    var(--asw-site-accent)
  );
  --asw-blue-lt: color-mix(in srgb, var(--asw-blue) 10%, #fff);
  --asw-orange: color-mix(
    in srgb,
    var(--asw-site-secondary) 80%,
    var(--asw-red)
  );

  /* ── Theme Inheritance (xStore) ── */
  /* If xStore defines --color-primary, buttons use that automatically */
  --asw-primary: var(--asw-site-primary);
  --asw-primary-dk: var(
    --color-primary-dark,
    color-mix(in srgb, var(--asw-primary) 78%, #111)
  );
  --asw-primary-lt: color-mix(in srgb, var(--asw-primary) 10%, #fff);
  --asw-primary-wash: color-mix(in srgb, var(--asw-primary) 5%, #fff);
  --asw-primary-soft: color-mix(in srgb, var(--asw-primary) 14%, #fff);
  --asw-primary-line: color-mix(in srgb, var(--asw-primary) 18%, transparent);
  --asw-primary-shadow: color-mix(in srgb, var(--asw-primary) 20%, transparent);

  /* ── Surfaces ── */
  --asw-bg: #ffffff;
  --asw-bg-2: #f7f7f7;
  --asw-bg-3: #eeeeee;
  --asw-border: #e0e0e0;
  --asw-border-dk: #c8c8c8;

  /* ── Text ── */
  --asw-text: var(--wp--preset--color--contrast, #1a1a1a);
  --asw-text-2: var(--e-global-color-text, #555555);
  --asw-text-3: #999999;
  --asw-text-inv: var(--et_btn-color, #ffffff);

  /* ── Border Radius ── */
  --asw-r: var(--radius-sm, 4px);
  --asw-r2: var(--radius, 6px);
  --asw-r3: 10px;
  --asw-r4: 14px;
  --asw-r-full: 999px;

  /* ── Shadows ── */
  --asw-sh-xs: 0 1px 3px rgba(0, 0, 0, 0.06);
  --asw-sh-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --asw-sh: 0 4px 16px rgba(0, 0, 0, 0.1);
  --asw-sh-lg: 0 8px 32px rgba(0, 0, 0, 0.14);
  --asw-sh-gold: 0 4px 20px var(--asw-primary-shadow);
  --asw-sh-red: 0 4px 20px rgba(192, 57, 43, 0.25);
  --asw-sh-green: 0 4px 20px
    color-mix(in srgb, var(--asw-green) 22%, transparent);

  /* ── Transitions ── */
  --asw-tr: 0.18s ease;
  --asw-tr-lg: 0.3s ease;
}

/* ════════════════════════════════════════════
   BASE
════════════════════════════════════════════ */
.asw-page {
  color: var(--asw-text);
  line-height: 1.65;
  padding: 2rem 0 5rem;
}

.asw-page *,
.asw-page *::before,
.asw-page *::after {
  box-sizing: border-box;
}

.asw-page a {
  color: var(--asw-primary);
  text-decoration: none;
}

.asw-page a:hover {
  color: var(--asw-primary-dk);
  text-decoration: underline;
}

.asw-page img {
  max-width: 100%;
  height: auto;
  display: block;
}

.asw-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ════════════════════════════════════════════
   BREADCRUMB
════════════════════════════════════════════ */
.asw-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--asw-text-3);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--asw-border);
}

.asw-breadcrumb a {
  color: var(--asw-text-2);
}

.asw-breadcrumb a:hover {
  color: var(--asw-primary);
  text-decoration: none;
}

.asw-bc-current {
  color: var(--asw-text);
  font-weight: 600;
}

.asw-bc-sep {
  color: var(--asw-border-dk);
}

/* ════════════════════════════════════════════
   CARD
════════════════════════════════════════════ */
.asw-card {
  background: var(--asw-bg);
  border: 1px solid var(--asw-border);
  border-radius: var(--asw-r3);
  padding: 1.4rem;
  box-shadow: var(--asw-sh-xs);
  margin-bottom: 1.25rem;
}

.asw-card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--asw-border);
}

.asw-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--asw-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.asw-card-sub {
  font-size: 0.83rem;
  color: var(--asw-text-2);
  margin-bottom: 0.9rem;
}

.asw-bold {
  font-weight: 700;
}

/* ════════════════════════════════════════════
   BADGES
════════════════════════════════════════════ */
.asw-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.71rem;
  font-weight: 700;
  padding: 0.18rem 0.6rem;
  border-radius: var(--asw-r-full);
  white-space: nowrap;
}

.asw-badge-open {
  background: var(--asw-green-lt);
  color: var(--asw-green);
  border: 1px solid var(--asw-green);
}

.asw-badge-done {
  background: var(--asw-red-lt);
  color: var(--asw-red);
  border: 1px solid var(--asw-red);
}

.asw-badge-closed {
  background: var(--asw-bg-2);
  color: var(--asw-text-3);
  border: 1px solid var(--asw-border);
}

.asw-badge-gold {
  background: var(--asw-gold-lt);
  color: var(--asw-gold-dk);
  border: 1px solid rgba(200, 168, 74, 0.3);
}

.asw-badges-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.asw-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--asw-r-full);
  background: var(--asw-green-lt);
  color: var(--asw-green);
  border: 1px solid rgba(39, 174, 96, 0.2);
}

.asw-live-dot {
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
  animation: aswBlink 1.3s infinite;
}

@keyframes aswBlink {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(1.5);
  }
}

.asw-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--asw-gold-dk);
  background: var(--asw-gold-lt);
  border: 1px solid rgba(200, 168, 74, 0.28);
  padding: 0.18rem 0.6rem;
  border-radius: var(--asw-r-full);
}

/* ════════════════════════════════════════════
   PROGRESS
════════════════════════════════════════════ */
.asw-progress-wrap {
  margin-top: 10px;
  height: 8px;
  background: var(--asw-bg-3);
  border-radius: var(--asw-r-full);
  overflow: hidden;
}

.asw-progress-bar {
  height: 100%;
  border-radius: var(--asw-r-full);
  background: linear-gradient(90deg, var(--asw-primary), var(--asw-red));
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.asw-progress-green {
  background: linear-gradient(90deg, var(--asw-green), #2ecc71);
}

.asw-ios-push-panel {
  position: fixed;
  inset: auto 14px calc(14px + env(safe-area-inset-bottom)) 14px;
  z-index: 999999;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 30px;
  align-items: start;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
  padding: 14px;
  color: #181128;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(104, 28, 226, 0.18);
  border-radius: 18px;
  box-shadow: 0 18px 55px rgba(24, 17, 40, 0.2);
  backdrop-filter: blur(14px);
}

.asw-ios-push-icon {
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 14px;
  background: #681ce2;
  box-shadow: 0 8px 18px rgba(104, 28, 226, 0.24);
}

.asw-ios-push-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.asw-ios-push-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
  font-size: 0.85rem;
  line-height: 1.65;
}

.asw-ios-push-copy strong {
  color: #28114f;
  font-size: 0.98rem;
  font-weight: 800;
}

.asw-ios-push-copy span,
.asw-ios-push-copy li {
  color: #594f6c;
}

.asw-ios-push-copy ol {
  margin: 2px 0 0;
  padding-inline-start: 18px;
}

.asw-ios-push-close {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #6f6680;
  background: #f4f0fb;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.asw-ios-push-action {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #681ce2;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(104, 28, 226, 0.23);
}

@media (max-width: 380px) {
  .asw-ios-push-panel {
    grid-template-columns: 42px minmax(0, 1fr) 28px;
    gap: 10px;
    padding: 12px;
  }

  .asw-ios-push-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }
}

