/**
 * WiseIQ Telemetry Alert Engine — Styles v1.0
 */

/* ── Alert panel (slide-in from bottom) ──────────────────────── */
.wiq-ta-panel {
  position: fixed;
  bottom: -200px;
  left: 16px;
  right: 16px;
  max-width: 520px;
  margin: 0 auto;
  z-index: 9998;
  background: var(--ta-bg, #FEF2F2);
  border: 1.5px solid var(--ta-border, #FECACA);
  border-left: 4px solid var(--ta-color, #EF4444);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  transition: bottom 0.4s cubic-bezier(0.34,1.2,0.64,1);
}
.wiq-ta-panel.wiq-ta-visible { bottom: 80px; }
.wiq-ta-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
}
.wiq-ta-icon { flex-shrink: 0; margin-top: 2px; }
.wiq-ta-content { flex: 1; }
.wiq-ta-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
  line-height: 1.4;
}
.wiq-ta-body {
  font-size: 12px;
  color: #374151;
  line-height: 1.5;
  margin-bottom: 8px;
}
.wiq-ta-urgency {
  font-size: 11px;
  color: var(--ta-color, #EF4444);
  font-weight: 600;
  margin-bottom: 8px;
}
.wiq-ta-cta {
  display: inline-block;
  background: var(--ta-color, #EF4444);
  color: #fff;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  transition: opacity 0.15s;
}
.wiq-ta-cta:hover { opacity: 0.88; }
.wiq-ta-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #9CA3AF;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
}
.wiq-ta-close:hover { color: #374151; }
.wiq-ta-more {
  padding: 8px 16px 12px;
  font-size: 12px;
  color: #6B7280;
  border-top: 1px solid var(--ta-border, #FECACA);
}
.wiq-ta-more-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--ta-color, #EF4444);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-weight: 600;
}

/* ── All alerts modal ─────────────────────────────────────────── */
.wiq-ta-modal {
  position: fixed;
  inset: 0;
  z-index: 10004;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.wiq-ta-modal.wiq-ta-modal-open { opacity: 1; pointer-events: auto; }
.wiq-ta-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.wiq-ta-dialog {
  position: relative;
  background: #fff;
  border-radius: 18px;
  max-width: 480px;
  width: calc(100% - 32px);
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34,1.2,0.64,1);
}
.wiq-ta-modal.wiq-ta-modal-open .wiq-ta-dialog { transform: scale(1); }
.wiq-ta-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0;
  position: sticky;
  top: 0;
  background: #fff;
}
.wiq-ta-dialog-header h3 { font-size: 17px; font-weight: 800; color: #111827; margin: 0; }
.wiq-ta-dialog-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #9CA3AF;
  cursor: pointer;
}
.wiq-ta-dialog-body { padding: 14px 20px 20px; }
.wiq-tam-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #F3F4F6;
}
.wiq-tam-item:last-child { border-bottom: none; }
.wiq-tam-icon { flex-shrink: 0; margin-top: 2px; }
.wiq-tam-title { font-size: 13px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.wiq-tam-body  { font-size: 12px; color: #6B7280; line-height: 1.5; margin-bottom: 8px; }
.wiq-tam-cta {
  display: inline-block;
  background: #1D4ED8;
  color: #fff;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

/* ── Push notification opt-in ─────────────────────────────────── */
.wiq-push-prompt {
  position: fixed;
  bottom: -100px;
  left: 16px;
  right: 16px;
  max-width: 480px;
  margin: 0 auto;
  z-index: 9996;
  background: #fff;
  border: 1.5px solid #BFDBFE;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  transition: bottom 0.4s cubic-bezier(0.34,1.2,0.64,1);
}
.wiq-push-prompt.wiq-pp-visible { bottom: 80px; }
.wiq-pp-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  flex-wrap: wrap;
}
.wiq-pp-icon {
  width: 36px; height: 36px;
  background: #EFF6FF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wiq-pp-text { flex: 1; min-width: 140px; }
.wiq-pp-title { font-size: 13px; font-weight: 700; color: #111827; }
.wiq-pp-sub   { font-size: 11px; color: #6B7280; }
.wiq-pp-allow {
  background: #1D4ED8;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.wiq-pp-allow:hover { background: #1E40AF; }
.wiq-pp-dismiss {
  background: none;
  border: none;
  font-size: 12px;
  color: #9CA3AF;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}

/* ── Dark mode ────────────────────────────────────────────────── */
[data-theme="dark"] .wiq-ta-panel    { background: #1F2937; border-color: #374151; }
[data-theme="dark"] .wiq-ta-title    { color: #F9FAFB; }
[data-theme="dark"] .wiq-ta-body     { color: #D1D5DB; }
[data-theme="dark"] .wiq-ta-dialog   { background: #1F2937; }
[data-theme="dark"] .wiq-ta-dialog-header { background: #1F2937; }
[data-theme="dark"] .wiq-ta-dialog-header h3 { color: #F9FAFB; }
[data-theme="dark"] .wiq-tam-title   { color: #F9FAFB; }
[data-theme="dark"] .wiq-tam-body    { color: #9CA3AF; }
[data-theme="dark"] .wiq-push-prompt { background: #1F2937; border-color: #3B82F6; }
[data-theme="dark"] .wiq-pp-title    { color: #F9FAFB; }
