/**
 * TIMETECH DIGITALZ V7 — UI COMPONENT SYSTEM
 * Reusable badges, software cards, PWA install toasts, stat counters,
 * and conversion-focused interactive elements.
 */

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #C7D8EB;
  padding: 5px 12px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  background: #F4F8FD;
}

.badge.badge-accent {
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
  border-color: rgba(37, 99, 235, 0.25);
}

.badge.badge-teal {
  background: rgba(14, 165, 165, 0.1);
  color: var(--teal);
  border-color: rgba(14, 165, 165, 0.25);
}

.badge.badge-gold {
  background: rgba(245, 158, 11, 0.12);
  color: #B45309;
  border-color: rgba(245, 158, 11, 0.28);
}

.badge.badge-live {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.3);
}

.badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
  border-radius: var(--radius-full);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.check-list li {
  margin: 10px 0;
  padding-left: 24px;
  position: relative;
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.check-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--teal);
  font-weight: 800;
}

/* Software Product Cards (Homepage & Store Previews) */
.software-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 36px;
}

.software-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: transform 300ms var(--ease-spring), box-shadow 300ms var(--ease-spring), border-color 300ms ease;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.software-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), 0 0 25px rgba(37, 99, 235, 0.12);
  border-color: #BFDBFE;
}

.software-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.software-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #EAF3FF, #EFF6FF);
  border: 1px solid #BFDBFE;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--blue);
  box-shadow: var(--shadow-sm);
}

.software-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--navy);
}

.software-card p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0 0 20px;
}

.software-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
}

.software-card-meta .platform-tag {
  color: var(--muted);
  font-weight: 600;
}

.software-card-meta .explore-link {
  color: var(--blue);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 200ms ease;
}

.software-card:hover .explore-link {
  transform: translateX(4px);
}

/* Trust Stats Bar */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  margin-top: 48px;
}

.stat-item {
  text-align: center;
  border-right: 1px solid var(--line);
  padding: 8px 16px;
}

.stat-item:last-child {
  border-right: none;
}

.stat-value {
  display: block;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* PWA In-App Install Banner & Offline Notice */
.pwa-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 420px;
  width: calc(100% - 48px);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(16, 42, 67, 0.18);
  padding: 18px 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 400ms var(--ease-spring), opacity 400ms ease;
}

.pwa-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.pwa-banner-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--navy);
  display: grid;
  place-items: center;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 1.1rem;
}

.pwa-banner-text h4 {
  margin: 0;
  font-size: 0.92rem;
  color: var(--navy);
}

.pwa-banner-text p {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pwa-install-btn {
  padding: 8px 14px;
  background: var(--blue);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 200ms ease;
}

.pwa-install-btn:hover {
  background: var(--blue-deep);
}

.pwa-close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  padding: 4px;
  cursor: pointer;
}

/* Offline Status Notification */
.offline-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: #1E293B;
  color: #F8FAFC;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  z-index: 2000;
  transition: transform 350ms var(--ease-spring);
}

.offline-toast.is-active {
  transform: translateX(-50%) translateY(0);
}

.offline-toast .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #EF4444;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .software-grid {
    grid-template-columns: 1fr;
  }
  .stats-strip {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .stat-item:nth-child(2) {
    border-right: none;
  }
}

@media (max-width: 600px) {
  .stats-strip {
    grid-template-columns: 1fr;
  }
  .stat-item {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding-bottom: 16px;
  }
  .stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
}
