/* ==========================================================
   globalassets.css — SBL Core Activation Engine
   Global design tokens, resets, and shared components
   Glassmorphism dark theme · Orange #FF6B00 · Cyan #00C2FF
   ========================================================== */

/* ----------------------------------------------------------
   CSS Custom Properties
   ---------------------------------------------------------- */
:root {
  --accent:           #FF6B00;
  --accent2:          #00C2FF;
  --bg:               #060608;
  --surface:          rgba(255, 255, 255, 0.05);
  --text:             #f0f0f0;
  --text-muted:       rgba(240, 240, 240, 0.5);
  --border:           rgba(255, 255, 255, 0.1);
  --border-accent:    rgba(255, 107, 0, 0.3);
  --radius:           16px;
  --blur:             18px;
  --font-primary:     'Inter', sans-serif;
  --font-mono:        'Courier New', monospace;
  --shadow:           0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ----------------------------------------------------------
   Reset & Base
   ---------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background:               var(--bg);
  color:                    var(--text);
  font-family:              var(--font-primary);
  line-height:              1.6;
  -webkit-font-smoothing:   antialiased;
  -moz-osx-font-smoothing:  grayscale;
}

/* ----------------------------------------------------------
   Glassmorphism Utilities
   ---------------------------------------------------------- */
.glass {
  background:              rgba(255, 255, 255, 0.05);
  backdrop-filter:         blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border:                  1px solid rgba(255, 255, 255, 0.1);
  border-radius:           var(--radius);
}

.glass--dark {
  background: rgba(0, 0, 0, 0.3);
}

.glass--orange {
  border-color: rgba(255, 107, 0, 0.3);
  box-shadow:   0 0 30px rgba(255, 107, 0, 0.08);
}

/* ----------------------------------------------------------
   Buttons
   ---------------------------------------------------------- */
.btn {
  display:        inline-flex;
  align-items:    center;
  gap:            0.5rem;
  padding:        0.75rem 1.5rem;
  border-radius:  10px;
  font-weight:    600;
  font-size:      0.92rem;
  font-family:    var(--font-primary);
  border:         none;
  cursor:         pointer;
  text-decoration: none;
  transition:     all 0.2s ease;
  white-space:    nowrap;
}

/* Primary — orange fill */
.btn-primary {
  background:  var(--accent);
  color:       #ffffff;
  box-shadow:  0 0 20px rgba(255, 107, 0, 0.25);
}
.btn-primary:hover {
  box-shadow:  0 0 36px rgba(255, 107, 0, 0.5);
  transform:   translateY(-1px);
  background:  #ff7a1a;
}

/* Glass — frosted */
.btn-glass {
  background:  rgba(255, 255, 255, 0.08);
  color:       var(--text);
  border:      1px solid rgba(255, 255, 255, 0.15);
}
.btn-glass:hover {
  border-color: var(--accent);
  background:   rgba(255, 107, 0, 0.06);
}

/* Outline — accent border */
.btn-outline {
  background:  transparent;
  color:       var(--accent);
  border:      1px solid var(--accent);
}
.btn-outline:hover {
  background:  rgba(255, 107, 0, 0.08);
}

/* Ghost — text only */
.btn-ghost {
  background:  transparent;
  color:       var(--text-muted);
  border:      none;
}
.btn-ghost:hover {
  color: var(--text);
}

/* Danger */
.btn-danger {
  background:  #ef4444;
  color:       #ffffff;
}
.btn-danger:hover {
  background:  #dc2626;
  box-shadow:  0 0 20px rgba(239, 68, 68, 0.35);
}

/* Size variants */
.btn-lg {
  padding:    1rem 2rem;
  font-size:  1.05rem;
}

.btn-xl {
  padding:    1.1rem 2.5rem;
  font-size:  1.1rem;
}

.btn-sm {
  padding:    0.4rem 0.9rem;
  font-size:  0.8rem;
}

.btn-full {
  width:            100%;
  justify-content:  center;
}

button:disabled,
.btn:disabled {
  opacity:        0.5;
  cursor:         not-allowed;
  pointer-events: none;
}

/* ----------------------------------------------------------
   Forms
   ---------------------------------------------------------- */
.form-group {
  margin-bottom: 1.4rem;
}

.form-group label {
  display:         block;
  font-size:       0.8rem;
  font-weight:     500;
  color:           rgba(240, 240, 240, 0.7);
  margin-bottom:   0.45rem;
  letter-spacing:  0.02em;
}

input,
textarea,
select {
  width:        100%;
  background:   rgba(0, 0, 0, 0.3);
  border:       1px solid var(--border);
  border-radius: 10px;
  color:        var(--text);
  padding:      0.75rem 1rem;
  font-size:    0.95rem;
  font-family:  var(--font-primary);
  outline:      none;
  transition:   border-color 0.2s ease, box-shadow 0.2s ease;
  appearance:          none;
  -webkit-appearance:  none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow:   0 0 0 3px rgba(255, 107, 0, 0.15);
}

input::placeholder,
textarea::placeholder {
  color: rgba(240, 240, 240, 0.3);
}

textarea {
  resize:     vertical;
  min-height: 120px;
}

/* Two-column form row */
.form-row {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   1rem;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Custom select with chevron arrow */
.custom-select-wrap {
  position: relative;
}

.custom-select-wrap select {
  padding-right:        2.5rem;
  background-image:     url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23FF6B00' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat:    no-repeat;
  background-position:  right 0.9rem center;
  background-size:      12px;
  cursor:               pointer;
}

/* Input with inline button */
.input-with-btn {
  display: flex;
  gap:     0.5rem;
}

.input-with-btn input {
  flex: 1;
}

/* ----------------------------------------------------------
   Alerts
   ---------------------------------------------------------- */
.alert {
  display:        flex;
  align-items:    flex-start;
  gap:            0.6rem;
  padding:        1rem 1.2rem;
  border-radius:  10px;
  font-size:      0.9rem;
  margin-bottom:  1.2rem;
}

.alert-success {
  background:   rgba(74, 222, 128, 0.1);
  border-left:  3px solid #4ade80;
  color:        #4ade80;
}

.alert-error {
  background:   rgba(248, 113, 113, 0.1);
  border-left:  3px solid #f87171;
  color:        #f87171;
}

.alert-warning {
  background:   rgba(250, 204, 21, 0.1);
  border-left:  3px solid #facc15;
  color:        #facc15;
}

/* ----------------------------------------------------------
   Badges
   ---------------------------------------------------------- */
.badge {
  display:         inline-block;
  padding:         0.2rem 0.6rem;
  border-radius:   999px;
  font-size:       0.7rem;
  font-weight:     700;
  letter-spacing:  0.05em;
  text-transform:  uppercase;
}

.badge-active {
  background: rgba(74, 222, 128, 0.15);
  color:      #4ade80;
}

.badge-suspended {
  background: rgba(250, 204, 21, 0.15);
  color:      #facc15;
}

.badge-expired {
  background: rgba(251, 146, 60, 0.15);
  color:      #fb923c;
}

.badge-revoked {
  background: rgba(248, 113, 113, 0.15);
  color:      #f87171;
}

.badge-type {
  background: rgba(0, 194, 255, 0.15);
  color:      #00C2FF;
}

/* ----------------------------------------------------------
   Typography helpers
   ---------------------------------------------------------- */
.muted {
  color:      var(--text-muted);
  font-size:  0.85rem;
}

small {
  font-size:  0.78rem;
  color:      var(--text-muted);
}

.req {
  color: #f87171;
}

/* ----------------------------------------------------------
   Code & Pre blocks
   ---------------------------------------------------------- */
code {
  font-family:   var(--font-mono);
  background:    rgba(255, 255, 255, 0.08);
  padding:       0.15rem 0.4rem;
  border-radius: 5px;
  font-size:     0.85em;
  color:         #00C2FF;
}

pre.code-block {
  background:    rgba(0, 0, 0, 0.5);
  border:        1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding:       1.5rem;
  overflow-x:    auto;
  overflow-y:    auto;
  font-family:   var(--font-mono);
  font-size:     0.82rem;
  line-height:   1.7;
  color:         rgba(240, 240, 240, 0.85);
  white-space:   pre;
  max-height:    500px;
}

.code-note {
  display:      flex;
  align-items:  flex-start;
  gap:          0.5rem;
  font-size:    0.82rem;
  color:        var(--text-muted);
  margin-top:   0.8rem;
}

/* ----------------------------------------------------------
   Tables
   ---------------------------------------------------------- */
.admin-table {
  width:           100%;
  border-collapse: collapse;
}

.admin-table thead tr {
  background:     rgba(0, 0, 0, 0.3);
  border-bottom:  1px solid rgba(255, 107, 0, 0.2);
}

.admin-table th {
  padding:         0.8rem 1rem;
  text-align:      left;
  font-size:       0.72rem;
  font-weight:     600;
  letter-spacing:  0.08em;
  text-transform:  uppercase;
  color:           var(--text-muted);
  white-space:     nowrap;
}

.admin-table td {
  padding:         0.85rem 1rem;
  border-bottom:   1px solid rgba(255, 255, 255, 0.05);
  vertical-align:  middle;
  font-size:       0.88rem;
}

.admin-table tbody tr:hover {
  background: rgba(255, 107, 0, 0.04);
}

.admin-table .row-unread {
  background:  rgba(255, 107, 0, 0.05);
  font-weight: 500;
}

.admin-table .empty-row td {
  text-align:   center;
  color:        var(--text-muted);
  padding:      3rem 1rem;
  font-style:   italic;
}

/* ----------------------------------------------------------
   Modals
   ---------------------------------------------------------- */
.modal {
  position:         fixed;
  inset:            0;
  z-index:          1000;
  display:          flex;
  align-items:      center;
  justify-content:  center;
}

.modal-backdrop {
  position:         absolute;
  inset:            0;
  background:       rgba(0, 0, 0, 0.7);
  backdrop-filter:  blur(4px);
}

.modal-box {
  position:      relative;
  z-index:       1;
  background:    rgba(15, 15, 20, 0.95);
  border:        1px solid rgba(255, 107, 0, 0.25);
  border-radius: 16px;
  padding:       2rem;
  width:         90%;
  max-width:     500px;
  max-height:    90vh;
  overflow-y:    auto;
}

.modal-wide {
  max-width: 800px;
}

.modal-actions {
  display:          flex;
  justify-content:  flex-end;
  gap:              0.75rem;
  margin-top:       1.5rem;
}

/* Detail table inside modals */
.detail-table {
  width:           100%;
  border-collapse: collapse;
}

.detail-table th {
  width:       140px;
  font-weight: 600;
  color:       var(--text-muted);
  padding:     0.5rem 0.8rem;
  text-align:  left;
  font-size:   0.82rem;
  vertical-align: top;
}

.detail-table td {
  padding:    0.5rem 0.8rem;
  font-size:  0.88rem;
  word-break: break-all;
}

.detail-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-table tr:last-child {
  border-bottom: none;
}

/* ----------------------------------------------------------
   Simple List (stats / rankings)
   ---------------------------------------------------------- */
.simple-list {
  list-style: none;
}

.simple-list li {
  display:       flex;
  align-items:   center;
  gap:           0.8rem;
  padding:       0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.simple-list li:last-child {
  border-bottom: none;
}

.simple-list li span {
  flex:      1;
  font-size: 0.88rem;
}

.simple-list li strong {
  min-width:            40px;
  text-align:           right;
  font-variant-numeric: tabular-nums;
  font-size:            0.88rem;
}

.bar-wrap {
  flex:          1;
  max-width:     120px;
  height:        4px;
  background:    rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}

.mini-bar {
  height:        100%;
  background:    var(--accent);
  border-radius: 2px;
  transition:    width 0.5s ease;
}

/* ----------------------------------------------------------
   Custom Scrollbar
   ---------------------------------------------------------- */
::-webkit-scrollbar {
  width:  6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background:    rgba(255, 107, 0, 0.4);
  border-radius: 3px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

/* ----------------------------------------------------------
   Utility classes
   ---------------------------------------------------------- */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.flex         { display: flex; }
.flex-1       { flex: 1; }
.items-center { align-items: center; }
.gap-1        { gap: 0.5rem; }
.gap-2        { gap: 1rem; }
.mt-1         { margin-top: 0.5rem; }
.mt-2         { margin-top: 1rem; }
.mb-1         { margin-bottom: 0.5rem; }
.mb-2         { margin-bottom: 1rem; }
.hidden       { display: none !important; }
.sr-only {
  position:   absolute;
  width:      1px;
  height:     1px;
  padding:    0;
  margin:     -1px;
  overflow:   hidden;
  clip:       rect(0, 0, 0, 0);
  white-space: nowrap;
  border:     0;
}
