/**
 * licenses.css — تنسيقات صفحة licenses v2
 * القاعدة: لا تُعرِّف :root هنا — كل المتغيرات في theme.css
 */

/* ══ Connection Info Card ════════════════════════════════════════ */
.conn-card {
  background: linear-gradient(135deg, rgba(16,185,129,.05), rgba(59,130,246,.04));
  border: 1px solid rgba(16,185,129,.2);
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
  overflow: hidden;
}

.conn-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(16,185,129,.1);
  cursor: pointer;
}

.conn-card-icon {
  font-size: 22px;
  width: 42px;
  height: 42px;
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.conn-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--tx1);
  margin-bottom: 2px;
}

.conn-card-sub {
  font-size: 11.5px;
  color: var(--tx3);
}

.conn-toggle {
  margin-right: auto;
  background: none;
  border: none;
  color: var(--tx3);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.conn-toggle:hover { background: rgba(255,255,255,.04); color: var(--tx1); }
.conn-toggle svg { transition: transform .25s; }

.conn-body {
  padding: 18px 20px;
}

.conn-urls {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}

.conn-url-item {
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color .2s;
}
.conn-url-item:hover { border-color: rgba(16,185,129,.2); }

.conn-url-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--tx2);
  margin-bottom: 2px;
}

.conn-url-desc {
  font-size: 10.5px;
  color: var(--tx3);
  margin-bottom: 8px;
}

.conn-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.conn-url-code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #93c5fd;
  background: rgba(59,130,246,.08);
  border: 1px solid rgba(59,130,246,.15);
  padding: 5px 9px;
  border-radius: 6px;
  word-break: break-all;
  direction: ltr;
  text-align: left;
  cursor: text;
  user-select: all;
}

/* ══ Copy Buttons ════════════════════════════════════════════════ */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.25);
  color: #34d399;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.copy-btn:hover { background: rgba(16,185,129,.16); border-color: rgba(16,185,129,.4); }

.copy-btn-xs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid rgba(148,163,184,.15);
  color: #64748b;
  border-radius: 5px;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.copy-btn-xs:hover { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.3); color: #34d399; }

.copy-btn-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: transparent;
  border: 1px solid rgba(148,163,184,.12);
  color: #475569;
  border-radius: 5px;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.copy-btn-inline:hover { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.3); color: #34d399; }

/* ══ License Key Styles ══════════════════════════════════════════ */
.lic-key {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--em);
  cursor: pointer;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}
.lic-key:hover { color: var(--green); }

.plugin-key {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #fbbf24;
  cursor: pointer;
  letter-spacing: 1px;
  font-weight: 700;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}
.plugin-key:hover { color: #fde68a; }

/* ══ Package Box (inline after create) ══════════════════════════ */
.pkg-box {
  background: rgba(16,185,129,.05);
  border: 1px solid rgba(16,185,129,.2);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin: 14px 0 20px;
  display: none;
}
.pkg-box.show { display: block; animation: fadeIn .2s ease; }

.pkg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 7px;
  background: rgba(0,0,0,.3);
  margin-bottom: 6px;
}
.pkg-row:last-child { margin-bottom: 0; }
.pkg-row label {
  color: var(--tx3);
  font-size: 11px;
  min-width: 100px;
  flex-shrink: 0;
  white-space: nowrap;
}
.pkg-row code {
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 11px;
  flex: 1;
  word-break: break-all;
  text-align: left;
  direction: ltr;
}

/* ══ Modal ══════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
}

.modal {
  background: #0c1424;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  min-width: 480px;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.8);
  font-family: inherit;
  display: flex;
  flex-direction: column;
}

.modal-lg {
  min-width: 620px;
  max-width: 860px;
  max-height: 85vh;
}

.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-close {
  background: none;
  border: none;
  color: #666;
  font-size: 18px;
  cursor: pointer;
  margin-right: auto;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all .15s;
}
.modal-close:hover { color: #fff; background: rgba(255,255,255,.08); }

/* ══ Models Check Modal Content ══════════════════════════════════ */
.models-loading {
  padding: 40px 0;
  text-align: center;
}

.models-ok-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.2);
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 13px;
  color: #a7f3d0;
}

.models-err-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: rgba(239,68,68,.07);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: 10px;
  font-size: 13px;
  color: #fca5a5;
}

.models-providers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.models-provider-block {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  overflow: hidden;
}

.models-provider-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(0,0,0,.2);
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.models-provider-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--brand, #64748b) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand, #64748b) 40%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: var(--brand, #94a3b8);
  font-family: 'Inter', sans-serif;
  flex-shrink: 0;
}

.models-provider-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--tx2);
  flex: 1;
}

.models-provider-count {
  font-size: 10px;
  color: var(--tx3);
  background: rgba(255,255,255,.05);
  padding: 1px 6px;
  border-radius: 99px;
}

.models-list {
  list-style: none;
  padding: 6px 0;
}

.models-list-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  transition: background .1s;
}
.models-list-item:hover { background: rgba(255,255,255,.025); }

.model-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #334155;
  flex-shrink: 0;
}

.model-id {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: left;
}