/* ============================================================
   Viper Design System — Shared Utilities
   ============================================================
   Add this file to angular.json styles[] so all components
   can use these classes without repeating them locally.
   ============================================================ */

/* ── Page shell ── */
.viper-page {
  padding: 1.5rem;
  background: white;
  border-radius: 10px;
}

.viper-breadcrumb {
  margin-bottom: 0.25rem;
}

.viper-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0e3852;
  margin-bottom: 1.25rem;
}

.viper-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #0e3852;
  margin-bottom: 0.75rem;
}

/* ── Buttons ── */
.viper-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  border-radius: 7px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
  text-decoration: none;
}

.viper-btn--primary { background: #1d4ed8; color: white; }
.viper-btn--primary:hover { background: #1e40af; color: white; text-decoration: none; }

.viper-btn--ghost { background: white; color: #374151; border: 1.5px solid #cbd5e1; }
.viper-btn--ghost:hover { background: #f1f5f9; }

.viper-btn--success { background: #16a34a; color: white; }
.viper-btn--success:hover { background: #15803d; color: white; text-decoration: none; }

.viper-btn--danger { background: #b91c1c; color: white; }
.viper-btn--danger:hover { background: #991b1b; }

.viper-btn--danger-ghost { background: white; color: #b91c1c; border: 1.5px solid #fca5a5; }
.viper-btn--danger-ghost:hover { background: #fff1f2; }

.viper-btn--sm { padding: 0.25rem 0.625rem; font-size: 0.8125rem; }

/* ── Icon buttons ── */
.viper-icon-btn {
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
  margin-right: 0.2rem;
}

.viper-icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.viper-icon-btn--play     { background: #dcfce7; color: #16a34a; }
.viper-icon-btn--play:not(:disabled):hover { background: #bbf7d0; }
.viper-icon-btn--download { background: #dbeafe; color: #1d4ed8; }
.viper-icon-btn--download:hover { background: #bfdbfe; }
.viper-icon-btn--delete   { background: #fee2e2; color: #b91c1c; }
.viper-icon-btn--delete:hover { background: #fecaca; }
.viper-icon-btn--mark     { background: #fef9c3; color: #a16207; }
.viper-icon-btn--mark:hover { background: #fef08a; }
.viper-icon-btn--edit     { background: #f1f5f9; color: #374151; }
.viper-icon-btn--edit:hover { background: #e2e8f0; }

/* ── Navigation tabs ── */
.viper-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.viper-tab {
  padding: 0.4rem 1rem;
  border-radius: 6px;
  border: 1.5px solid #cbd5e1;
  background: white;
  color: #374151;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  cursor: pointer;
}

.viper-tab:hover { background-color: #f1f5f9; text-decoration: none; color: #374151; }
.viper-tab--active { background-color: #1d4ed8; border-color: #1d4ed8; color: white; }
.viper-tab--active:hover { background-color: #1e40af; color: white; }

/* ── Filter panel ── */
.viper-filter-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.viper-filter-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0e3852;
  margin: 0;
}

/* ── Form elements ── */
.viper-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.viper-input,
.viper-select {
  border: 1.5px solid #cbd5e1;
  border-radius: 7px;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  color: #374151;
  background: white;
  width: 100%;
}

.viper-input:focus,
.viper-select:focus {
  outline: none;
  border-color: #93c5fd;
}

.viper-input:disabled,
.viper-select:disabled {
  background-color: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

/* ── Table ── */
.viper-table-wrapper {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.viper-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.viper-table thead tr { background-color: #f1f5f9; }

.viper-table th {
  padding: 0.6rem 0.85rem;
  font-weight: 700;
  color: #374151;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.viper-table td {
  padding: 0.55rem 0.85rem;
  color: #4b5563;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.viper-table tbody tr:hover { background-color: #f8fafc; }

/* ── Badges ── */
.viper-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.viper-badge--blue   { background: #dbeafe; color: #1d4ed8; }
.viper-badge--green  { background: #dcfce7; color: #16a34a; }
.viper-badge--red    { background: #fee2e2; color: #b91c1c; }
.viper-badge--yellow { background: #fef9c3; color: #a16207; }
.viper-badge--gray   { background: #f1f5f9; color: #6b7280; }
.viper-badge--purple { background: #ede9fe; color: #6d28d9; }

/* ── Empty state ── */
.viper-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem;
  color: #9ca3af;
  gap: 0.75rem;
  text-align: center;
}

.viper-empty-icon { font-size: 2.5rem; }

/* ── Info banner ── */
.viper-info-banner {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  color: #3730a3;
  margin-bottom: 1.25rem;
}

/* ── Dropdown menu ── */
.viper-dropdown-menu {
  position: absolute;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 200;
  overflow: hidden;
}

.viper-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  color: #1f2937;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s;
}

.viper-dropdown-item:hover {
  background-color: #f1f5f9;
  text-decoration: none;
  color: #1f2937;
}

.viper-dropdown-divider {
  height: 1px;
  background-color: #e2e8f0;
  margin: 0.25rem 0;
}

/* ── Input group (input + adjacent button) ── */
.viper-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.viper-input-group .viper-input { flex: 1; }

/* ── Label row (label + action button on same line) ── */
.viper-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.viper-label-row .viper-label { margin-bottom: 0; }

/* ── Upsell link ── */
.viper-upsell-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #6d28d9;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
}

.viper-upsell-link:hover { color: #5b21b6; text-decoration: underline; }

/* ── Accordion ── */
.viper-accordion {
  margin-top: 1.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.viper-accordion-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem 1rem;
  background: #f8fafc;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  color: #374151;
  text-align: left;
  transition: background 0.15s;
}

.viper-accordion-trigger:hover { background: #f1f5f9; }

.viper-accordion-body {
  padding: 1rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

/* ── Add-on cards ── */
.viper-addon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.viper-addon-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fafafa;
}

.viper-addon-card-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: #1e293b;
}

.viper-addon-card-desc {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 0;
  flex: 1;
}

.viper-addon-card-cost {
  font-size: 0.8125rem;
  color: #64748b;
}

/* ── Card layout ── */
.viper-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.viper-card-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.viper-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #0e3852;
}

.viper-card-sub {
  font-size: 0.8rem;
  font-weight: 400;
  color: #64748b;
  margin-left: 0.35rem;
}

.viper-card-body {
  padding: 0.75rem 1rem;
}

/* ── Option buttons (portal edit pages) ── */
.viper-opt {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: #0e3852;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.15s;
}

.viper-opt:hover {
  background: #11324d;
  color: white;
  text-decoration: none;
}

.viper-opt--back { background: #31b0bf; }
.viper-opt--back:hover { background: #2a9aa8; }

.viper-opt-icon {
  font-size: 1.1rem;
  width: 1.5rem;
  text-align: center;
  flex-shrink: 0;
}

.viper-opt strong { display: block; }

.viper-opt-sub {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.15rem;
}

.viper-opt-badges {
  display: inline-flex;
  gap: 0.35rem;
  margin-left: 0.5rem;
}

/* ── Alerts ── */
.viper-alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.viper-alert--info    { background: #dbeafe; color: #1e40af; }
.viper-alert--warning { background: #fef9c3; color: #854d0e; }
.viper-alert--danger  { background: #fee2e2; color: #991b1b; }
.viper-alert a { color: inherit; text-decoration: underline; }

/* ── no-more-table — mobile responsive table ── */
@media (max-width: 800px) {
  .viper-page { padding: 1rem; }

  .no-more-table table,
  .no-more-table thead,
  .no-more-table tbody,
  .no-more-table tfoot,
  .no-more-table th,
  .no-more-table td,
  .no-more-table tr { display: block; }

  .no-more-table thead { display: none; }

  .no-more-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .no-more-table tr {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 0.5rem;
  }

  .no-more-table td {
    border: none;
    border-bottom: 1px solid #f1f5f9;
    padding: 0.5rem 0.85rem;
    white-space: normal;
    text-align: left;
    position: relative;
    padding-left: 40%;
  }

  .no-more-table td::before {
    content: attr(data-title);
    position: absolute;
    top: 0.5rem;
    left: 0.85rem;
    width: 35%;
    font-weight: 700;
    color: #374151;
    white-space: nowrap;
  }
}
