/* ═══════════════════════════════════════════════════════════
   RumShop – User Dashboard CSS (Modern Premium v2)
   ═══════════════════════════════════════════════════════════ */

/* ── Layout ───────────────────────────────────────────────── */
.rsd-wrap {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  min-height: 80vh;
  margin: 40px 0;
  color: #c9d1d9;
}

/* ── Glassmorphism Panels ─────────────────────────────────── */
.rsd-panel, .rsd-sidebar, .rsd-stat-card, .rsd-license-card {
  background: rgba(22, 27, 34, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ── Sidebar ──────────────────────────────────────────────── */
.rsd-sidebar {
  padding: 24px 16px;
  height: max-content;
  position: sticky;
  top: 100px;
}
.rsd-user-avatar {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.rsd-avatar-img { 
  border-radius: 50%; 
  border: 3px solid transparent; 
  background: linear-gradient(#161b22, #161b22) padding-box, linear-gradient(135deg, #E8651A, #F3A183) border-box;
  width: 72px; height: 72px;
  box-shadow: 0 4px 12px rgba(232, 101, 26, 0.2);
}
.rsd-user-info strong { display: block; font-size: 16px; font-weight: 700; color: #fff; letter-spacing: 0.3px; }
.rsd-user-info span   { font-size: 13px; color: #8b949e; word-break: break-all; }

.rsd-nav { display: flex; flex-direction: column; gap: 6px; }
.rsd-nav-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; color: #8b949e; text-decoration: none;
  font-size: 14px; font-weight: 600; transition: all .3s ease;
  border-radius: 12px;
}
.rsd-nav-item:hover { color: #fff; background: rgba(255,255,255, 0.04); transform: translateX(4px); }
.rsd-nav-item.active {
  color: #fff; 
  background: linear-gradient(90deg, rgba(232,101,26,0.15) 0%, rgba(232,101,26,0.02) 100%);
  border-left: 3px solid #E8651A;
  box-shadow: inset 1px 0 0 rgba(255,255,255,0.05);
}
.rsd-nav-logout { color: #f85149 !important; margin-top: 16px; border-top: 1px solid rgba(255,255,255,0.03); border-radius: 0 0 12px 12px;}
.rsd-nav-logout:hover { background: rgba(248,81,73,.08) !important; transform: translateX(0); }

/* ── Main Area ────────────────────────────────────────────── */
.rsd-main { width: 100%; min-width: 0; }

/* ── Stats ────────────────────────────────────────────────── */
.rsd-stats-row {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-bottom: 36px;
}
.rsd-stat-card {
  padding: 24px;
  display: flex; align-items: center; gap: 18px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.rsd-stat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.3); border-color: rgba(255,255,255,0.1); }
.rsd-stat-icon { 
  font-size: 26px; width: 56px; height: 56px; 
  display: flex; align-items: center; justify-content: center; 
  border-radius: 16px;
  background: color-mix(in srgb, var(--ic) 15%, transparent);
  color: var(--ic);
}
.rsd-stat-value { font-size: 32px; font-weight: 800; color: #fff; display: block; line-height: 1.1; }
.rsd-stat-label { font-size: 13px; color: #8b949e; margin-top: 4px; display: block; }

/* ── Tabs ─────────────────────────────────────────────────── */
.rsd-tab-content { display: none; opacity: 0; transform: translateY(10px); transition: opacity 0.4s ease, transform 0.4s ease; }
.rsd-tab-content.active { display: block; opacity: 1; transform: translateY(0); }
.rsd-tab-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 16px;}
.rsd-tab-header h2 { margin: 0; font-size: 22px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 10px; }

/* ── License Cards ────────────────────────────────────────── */
#rsd-licenses-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}
.rsd-license-card {
  padding: 28px;
  transition: all .3s ease;
  position: relative; overflow: hidden;
  height: 100%; display: flex; flex-direction: column;
}
.rsd-license-card::before {
  content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
  background: transparent; transition: background 0.3s;
}
.rsd-license-card:hover { border-color: rgba(255,255,255,0.15); box-shadow: 0 12px 40px rgba(0,0,0,0.3); }
.rsd-license-card.expired { opacity: .6; border-style: dashed; }
.rsd-license-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px;
}
.rsd-license-product { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.rsd-license-plan { font-size: 13px; color: #8b949e; }
.rsd-status-pill {
  font-size: 11px; font-weight: 700; padding: 6px 12px;
  border-radius: 20px; text-transform: uppercase; white-space: nowrap; letter-spacing: 0.5px;
}
.rsd-pill-active  { background: rgba(63,185,80,.1);  color: #3fb950; border: 1px solid rgba(63,185,80,.3); }
.rsd-pill-expired { background: rgba(210,153,34,.1); color: #d29922; border: 1px solid rgba(210,153,34,.3); }
.rsd-pill-dead    { background: rgba(248,81,73,.1);  color: #f85149; border: 1px solid rgba(248,81,73,.3); }

.rsd-key-display {
  background: #040608; border: 1px dashed rgba(255,255,255,0.1); border-radius: 12px;
  padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: auto; box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
  margin-top: 16px; flex: 1; min-height: 80px;
}
.rsd-key-val { font-family: 'Courier New', Courier, monospace; font-size: 17px; font-weight: 800; color: #E8651A; letter-spacing: 2px; text-shadow: 0 0 10px rgba(232, 101, 26, 0.4); word-break: break-all; }
.rsd-copy-key {
  background: #21262d; border: 1px solid #30363d; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; color: #c9d1d9;
  transition: all .2s; flex-shrink: 0;
}
.rsd-copy-key:hover { border-color: #E8651A; color: #E8651A; background: rgba(232, 101, 26, 0.1); }
.rsd-copy-key.copied { border-color: #3fb950; color: #3fb950; background: rgba(63,185,80,.1); }

.rsd-license-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 24px; margin-bottom: 20px; padding: 16px; background: rgba(255,255,255,0.02); border-radius: 10px;}
.rsd-meta-item { font-size: 13px; color: #8b949e; display: flex; align-items: center; gap: 6px;}
.rsd-meta-item strong { color: #fff; }
.rsd-meta-expiry-soon { color: #d29922 !important; font-weight: 700; }

.rsd-license-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.rsd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 10px; font-size: 14px;
  font-weight: 600; cursor: pointer; text-decoration: none;
  border: none; transition: all .3s ease;
}
.rsd-btn-primary { background: linear-gradient(135deg, #E8651A, #F3A183); color: #fff; box-shadow: 0 4px 12px rgba(232, 101, 26, 0.3); }
.rsd-btn-primary:hover { background: linear-gradient(135deg, #c4501a, #E8651A); box-shadow: 0 6px 16px rgba(232, 101, 26, 0.5); transform: translateY(-2px); }
.rsd-btn-outline-primary { background: rgba(232, 101, 26, 0.1); color: #E8651A; border: 1px solid rgba(232, 101, 26, 0.3); }
.rsd-btn-outline-primary:hover { background: rgba(232, 101, 26, 0.2); border-color: rgba(232, 101, 26, 0.6); }
.rsd-btn-ghost {
  background: rgba(255,255,255,0.05); color: #c9d1d9; border: 1px solid rgba(255,255,255,0.1);
}
.rsd-btn-ghost:hover { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.1); }
.rsd-btn-danger { background: rgba(248,81,73,.1); color: #f85149; border: 1px solid rgba(248,81,73,.2); }
.rsd-btn-danger:hover { background: rgba(248,81,73,.2); border-color: rgba(248,81,73,.4); }
.rsd-btn-warning { background: rgba(210,153,34,.1); color: #d29922; border: 1px solid rgba(210,153,34,.2); }
.rsd-btn-warning:hover { background: rgba(210,153,34,.2); border-color: rgba(210,153,34,.4); }
.rsd-btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important;}

/* ── Orders Table ─────────────────────────────────────────── */
.rsd-table {
  width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px;
}
.rsd-table th, .rsd-table td {
  padding: 16px 20px; text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.rsd-table th { color: #8b949e; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.rsd-table td { color: #c9d1d9; }
.rsd-table tbody tr { transition: background 0.2s; }
.rsd-table tbody tr:hover { background: rgba(255,255,255,.02); }
.rsd-badge {
  font-size: 11px; font-weight: 700; padding: 4px 10px;
  border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px;
}
.rsd-badge-ok   { background: rgba(63,185,80,.15);  color: #3fb950; }
.rsd-badge-warn { background: rgba(210,153,34,.15); color: #d29922; }
.rsd-badge-fail { background: rgba(248,81,73,.15);  color: #f85149; }

/* ── Device chips ─────────────────────────────────────────── */
.rsd-device-item {
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-radius: 12px;
  padding: 20px 24px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between;
  transition: border-color 0.2s;
}
.rsd-device-item:hover { border-color: rgba(255,255,255,0.1); }
.rsd-device-name { font-size: 16px; font-weight: 600; color: #fff; }
.rsd-device-meta { font-size: 13px; color: #8b949e; margin-top: 6px; }
.rsd-device-key  { font-size: 12px; color: #8b949e; font-family: monospace; display: inline-block; margin-top: 6px; padding: 2px 6px; background: rgba(255,255,255,0.05); border-radius: 4px;}

/* ── Loading ──────────────────────────────────────────────── */
.rsd-loading { display: flex; justify-content: center; padding: 10px; }
.rsd-spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.05); border-top-color: #E8651A;
  animation: rsdSpin .8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes rsdSpin { to { transform: rotate(360deg); } }

.rsd-empty {
  text-align: center; padding: 60px 20px; color: #8b949e; font-size: 16px;
  border: 1px dashed rgba(255,255,255,0.1); border-radius: 16px; background: rgba(255,255,255,0.01);
}

/* ── Confirm Modal ────────────────────────────────────────── */
.rsd-modal-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.rsd-modal-overlay[style*="display: block"],
.rsd-modal-overlay.show {
  opacity: 1; pointer-events: auto; display: flex !important;
}
.rsd-modal-box {
  background: #161b22; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px; padding: 32px; max-width: 440px; width: 90%;
  box-shadow: 0 24px 80px rgba(0,0,0,.8);
  transform: scale(0.95); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.rsd-modal-overlay[style*="display: block"] .rsd-modal-box,
.rsd-modal-overlay.show .rsd-modal-box { transform: scale(1); }
.rsd-modal-box h3 { margin: 0 0 16px; color: #fff; font-size: 22px; font-weight: 700;}
.rsd-modal-box p  { color: #8b949e; font-size: 15px; margin-bottom: 28px; line-height: 1.5; }
.rsd-modal-actions { display: flex; gap: 12px; justify-content: flex-end;}

/* ── Toast ────────────────────────────────────────────────── */
.rsd-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 999999;
  background: rgba(22, 27, 34, 0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 16px 24px; font-size: 15px; font-weight: 500;
  color: #fff; max-width: 400px;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
  transform: translateY(30px); opacity: 0;
  transition: all .4s cubic-bezier(0.175, 0.885, 0.32, 1.275); pointer-events: none;
}
.rsd-toast.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.rsd-toast.success { border-left: 4px solid #3fb950; }
.rsd-toast.error   { border-left: 4px solid #f85149; }

/* ── Hint ─────────────────────────────────────────────────── */
.rsd-hint { font-size: 14px; color: #8b949e; margin-bottom: 24px; background: rgba(255,255,255,0.03); padding: 16px; border-radius: 10px; border-left: 3px solid #E8651A; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .rsd-wrap { grid-template-columns: 1fr; gap: 24px; }
  .rsd-sidebar { position: static; height: auto; }
  .rsd-nav { flex-direction: row; overflow-x: auto; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
  .rsd-nav-item { border-left: none; border-bottom: 3px solid transparent; border-radius: 8px; white-space: nowrap; }
  .rsd-nav-item.active { border-bottom-color: #E8651A; border-left: none; background: rgba(255,255,255,0.05); box-shadow: none; }
  .rsd-nav-logout { border: none; margin-top: 0; }
  .rsd-stats-row { grid-template-columns: 1fr; gap: 16px; }
  .rsd-stat-card { padding: 20px; }
  .rsd-main { padding: 0; }
  .rsd-key-val { font-size: 16px; letter-spacing: 2px; }
  .rsd-license-card-header { flex-direction: column; gap: 12px; align-items: stretch; }
  .rsd-status-pill { align-self: flex-start; }
}
