/* ══════════════════════════════════════════════════════════════
   DASHBOARD.CSS — OceanLinux-Style Layout with Site's Purple Theme
   Layout from OceanLinux, Colors from HostingHub/BatsClouds
   ══════════════════════════════════════════════════════════════ */

/* ── Dashboard Page Layout ── */
.dashboard-page {
  display: flex;
  min-height: 100vh;
  background: var(--bg-body);
}

/* ── Sidebar (OceanLinux Layout + Site's Purple Theme) ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: var(--bg-card-solid);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  z-index: var(--z-fixed);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-default);
}

.sidebar-header .navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-default);
}

/* Sidebar Items — OceanLinux layout: left-border highlight + site purple */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  margin-bottom: 2px;
  border-radius: 8px;
  color: var(--text-tertiary);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  border: none;
  border-left: 3px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-item:hover {
  color: var(--text-primary);
  background: var(--primary-glow);
  border-left-color: rgba(135, 80, 247, 0.4);
}

.sidebar-item.active {
  background: var(--primary-glow);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

.sidebar-item.active i {
  color: var(--primary);
}

.sidebar-item i {
  width: 1.25rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-tertiary);
  transition: color 0.2s;
}

.sidebar-item:hover i {
  color: var(--text-secondary);
}

.sidebar-item .lock-icon {
  margin-left: auto;
  font-size: 0.65rem;
}

/* Nav section labels */
.sidebar-nav .text-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
  margin-top: 0.75rem;
}

/* Sidebar divider */
.sidebar .divider {
  height: 1px;
  background: var(--border-default);
  margin: 0.5rem 0.75rem;
}

/* User card in sidebar */
.sidebar-user-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.75rem;
}

/* ── Main Content Area ── */
.main-with-sidebar {
  margin-left: 260px;
  min-height: 100vh;
  padding: 2rem;
  background: var(--bg-body);
  transition: margin-left 0.3s ease;
}

/* ── Mobile Header ── */
.dashboard-mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  padding: 0.75rem 1.25rem;
  background: var(--bg-card-solid);
  border-bottom: 1px solid var(--border-default);
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 768px) {
  .dashboard-mobile-header {
    display: flex;
  }
  .sidebar {
    width: 280px;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-with-sidebar {
    margin-left: 0;
    padding: 1.25rem;
    padding-top: calc(3.5rem + 1.25rem);
  }
}

/* ── Dashboard Stats Grid ── */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Stat Cards — Site theme */
.stat-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: rgba(135, 80, 247, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(135, 80, 247, 0.1);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 12px 12px 0 0;
}

.stat-card--emerald::before { background: var(--emerald); }
.stat-card--amber::before   { background: var(--amber); }
.stat-card--purple::before  { background: var(--purple); }
.stat-card--blue::before    { background: var(--primary); }

.stat-card__label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
}

.stat-card__value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
}

/* ── Server Management Card (OceanLinux Layout + Purple Theme) ── */
.server-card-premium {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.server-card-premium:hover {
  border-color: rgba(135, 80, 247, 0.3);
  box-shadow: 0 4px 25px rgba(135, 80, 247, 0.12);
}

.server-card-premium .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-default);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.server-card-premium .server-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
  margin-bottom: 0.25rem;
}

.server-card-premium .server-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 50px;
}

.status-badge.online {
  background: var(--emerald-glow);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.online::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.status-badge.offline {
  background: var(--red-glow);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.offline::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
}

.status-badge.pending {
  background: var(--amber-glow);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
}

.server-card-premium .os-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.server-card-premium .os-icon i {
  font-size: 1.3rem;
  color: var(--primary);
}

/* ── Progress Bars (CPU/RAM) ── */
.server-card-premium .card-stats {
  padding: 1.25rem 1.5rem;
}

.stat-item {
  margin-bottom: 0.75rem;
}

.stat-item:last-child {
  margin-bottom: 0;
}

.stat-item label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 0.4rem;
}

.stat-item label span {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar .fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-bar .fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15));
}

.progress-bar.bar-green .fill {
  background: linear-gradient(90deg, var(--emerald), var(--emerald-dark));
}

.progress-bar.bar-amber .fill {
  background: linear-gradient(90deg, var(--amber), #e3b341);
}

.progress-bar.bar-red .fill {
  background: linear-gradient(90deg, var(--red), var(--red-dark));
}

/* ── Server Card Footer (Action Buttons) ── */
.server-card-premium .card-footer {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-default);
  flex-wrap: wrap;
  align-items: center;
}

.btn-action {
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
  color: var(--text-primary);
}

.btn-action.btn-action-danger {
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--red);
}

.btn-action.btn-action-danger:hover {
  background: var(--red-glow);
  border-color: var(--red);
}

.btn-manage-primary {
  padding: 0.45rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
}

.btn-manage-primary:hover {
  box-shadow: 0 4px 15px rgba(135, 80, 247, 0.35);
  transform: translateY(-1px);
}

/* ── Wallet / Balance Card ── */
.wallet-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.wallet-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--primary-glow);
  filter: blur(40px);
}

.wallet-card::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(42, 20, 84, 0.3);
  filter: blur(40px);
}

.wallet-card .wallet-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 0.4rem;
}

.wallet-card .wallet-amount {
  font-size: 2rem;
  font-weight: 900;
  color: var(--emerald);
  line-height: 1;
}

.wallet-card .wallet-spent {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-top: 0.5rem;
}

.wallet-card .wallet-spent strong {
  color: var(--text-primary);
}

.wallet-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-default);
  position: relative;
  z-index: 1;
}

.wallet-metric {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.btn-add-funds {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid rgba(135, 80, 247, 0.4);
  border-radius: var(--radius-full);
  background: var(--primary-glow);
  color: var(--primary);
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 1rem;
  position: relative;
  z-index: 1;
}

.btn-add-funds:hover {
  background: rgba(135, 80, 247, 0.25);
  box-shadow: 0 4px 15px rgba(135, 80, 247, 0.2);
  transform: translateY(-1px);
}

/* ── Quick Actions ── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.25rem 0.75rem;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease-spring);
}

.quick-action-btn:hover {
  transform: translateY(-4px);
  border-color: rgba(135, 80, 247, 0.3);
  color: var(--primary);
  box-shadow: 0 4px 25px rgba(135, 80, 247, 0.15);
}

.quick-action-btn i {
  font-size: 1.4rem;
}

/* ── Console-Style Terminal Card (Proxy Setup) ── */
.terminal-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-default);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dots span:nth-child(1) { background: var(--red); }
.terminal-dots span:nth-child(2) { background: var(--amber); }
.terminal-dots span:nth-child(3) { background: var(--emerald); }

.terminal-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-left: auto;
  font-family: var(--font-mono);
}

.terminal-body {
  padding: 1.5rem;
}

.terminal-input-group {
  margin-bottom: 1rem;
}

.terminal-input-group label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.terminal-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-body);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: border-color 0.2s;
}

.terminal-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.terminal-input::placeholder {
  color: var(--text-tertiary);
}

.btn-connect {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 0.5rem;
  box-shadow: 0 4px 15px rgba(135, 80, 247, 0.25);
}

.btn-connect:hover {
  box-shadow: 0 6px 25px rgba(135, 80, 247, 0.4);
  transform: translateY(-1px);
}

/* ── Server Monitor Widget ── */
.server-monitor {
  background: var(--bg-card-solid) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: 12px;
  padding: 1.25rem;
}

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 640px) {
  .monitor-grid {
    grid-template-columns: 1fr;
  }
}

.monitor-item {
  padding: 0.75rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.monitor-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.monitor-bar {
  background: var(--bg-body) !important;
  height: 6px !important;
  border-radius: 10px !important;
  overflow: hidden;
  margin: 0.5rem 0;
}

.monitor-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 1.5s ease;
}

.monitor-value {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* ── Recent Orders ── */
.order-item-oceanlinux {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  transition: all 0.2s ease;
}

.order-item-oceanlinux:hover {
  border-color: rgba(135, 80, 247, 0.25);
  box-shadow: 0 2px 10px rgba(135, 80, 247, 0.08);
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 3rem;
}

.empty-state-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
  margin: 0 auto 1rem;
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-state-desc {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

/* ── Section Headers ── */
.section-header-ocean {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-header-ocean h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-header-ocean a {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

.section-header-ocean a:hover {
  color: var(--primary-light);
}

/* ── Credentials Box ── */
.cred-row-ocean {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

.cred-row-ocean:last-child {
  border-bottom: none;
}

.cred-row-ocean .cred-label {
  color: var(--text-tertiary);
  font-weight: 600;
  font-size: 0.75rem;
}

.cred-row-ocean .cred-value {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 700;
}

/* ── Notification bell ── */
.notification-bell {
  position: relative;
  cursor: pointer;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 1rem;
  height: 1rem;
  background: var(--red);
  color: white;
  border-radius: 50%;
  font-size: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ── Skeleton Loader ── */
.skeleton-ocean {
  background: linear-gradient(90deg, var(--bg-elevated) 0%, var(--bg-card-solid) 50%, var(--bg-elevated) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Server Controls ── */
.server-controls-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.server-control-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.server-control-btn:hover {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--text-primary);
}

.server-control-btn.btn-start {
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--emerald);
}
.server-control-btn.btn-start:hover {
  background: var(--emerald-glow);
}

.server-control-btn.btn-stop {
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--red);
}
.server-control-btn.btn-stop:hover {
  background: var(--red-glow);
}

.server-control-btn.btn-restart {
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--amber);
}
.server-control-btn.btn-restart:hover {
  background: var(--amber-glow);
}

/* ── Dashboard Welcome ── */
.welcome-header {
  margin-bottom: 1.5rem;
}

.welcome-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.welcome-header p {
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

/* ── Avatar ── */
.avatar-ocean {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ── Timeline (orders) ── */
.orders-timeline {
  position: relative;
  padding-left: 2rem;
}

.orders-timeline::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-default);
}

.timeline-dot--success { background: var(--emerald) !important; }
.timeline-dot--warning { background: var(--amber) !important; }
.timeline-dot--danger  { background: var(--red) !important; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
  .wallet-metrics {
    grid-template-columns: 1fr;
  }
  .server-card-premium .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .server-card-premium .card-footer {
    flex-direction: column;
  }
  .btn-manage-primary {
    margin-left: 0;
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

/* ══════════════════════════════════════════════════════════════
   FORMAT SERVER MODAL — OS Selection (Purple Theme)
   ══════════════════════════════════════════════════════════════ */

.format-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: calc(var(--z-fixed) + 10);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeInOverlay 0.2s ease;
}

.format-modal-overlay.hidden {
  display: none;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.format-modal-card {
  background: var(--bg-card-solid);
  border: 1px solid rgba(135, 80, 247, 0.25);
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(135, 80, 247, 0.1);
  animation: slideUpModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  position: relative;
}

@keyframes slideUpModal {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Glow accent at top */
.format-modal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--purple));
}

/* -- Modal Header -- */
.format-modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border-default);
}

.format-modal-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(79, 70, 229, 0.2));
  border: 1px solid rgba(168, 85, 247, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
  color: var(--purple);
}

.format-modal-header h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 0.15rem;
}

.format-modal-header p {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin: 0;
}

.format-modal-close {
  margin-left: auto;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.format-modal-close:hover {
  background: var(--red-glow);
  border-color: var(--red);
  color: var(--red);
}

/* -- Warning Banner -- */
.format-modal-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 1.25rem 1.5rem 0;
  padding: 0.85rem 1rem;
  background: rgba(239, 68, 68, 0.07);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.format-modal-warning i {
  color: var(--amber);
  font-size: 0.9rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.format-modal-warning strong {
  color: var(--amber);
}

/* -- Modal Body (OS Grid) -- */
.format-modal-body {
  padding: 1.25rem 1.5rem;
}

.format-modal-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 0.85rem;
}

.os-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 0.6rem;
}

/* Each OS option card */
.os-option {
  cursor: pointer;
  position: relative;
}

.os-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.os-option-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.9rem 0.7rem 0.75rem;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-default);
  border-radius: 12px;
  text-align: center;
  transition: all 0.2s ease;
}

.os-option:hover .os-option-inner {
  border-color: rgba(135, 80, 247, 0.4);
  background: var(--primary-glow);
}

.os-option.selected .os-option-inner {
  border-color: var(--primary);
  background: rgba(135, 80, 247, 0.12);
  box-shadow: 0 0 0 3px rgba(135, 80, 247, 0.15);
}

.os-brand-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.os-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.os-tag {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  background: rgba(135, 80, 247, 0.12);
  color: var(--primary);
  border: 1px solid rgba(135, 80, 247, 0.25);
}

/* -- Modal Footer -- */
.format-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-default);
}

.format-btn-cancel {
  padding: 0.55rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.format-btn-cancel:hover {
  border-color: var(--text-tertiary);
  color: var(--text-primary);
}

.format-btn-confirm {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: white;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
}

.format-btn-confirm:hover:not(:disabled) {
  box-shadow: 0 6px 22px rgba(168, 85, 247, 0.5);
  transform: translateY(-1px);
}

.format-btn-confirm:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Responsive */
@media (max-width: 480px) {
  .os-options-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .format-modal-footer {
    flex-direction: column-reverse;
  }
  .format-btn-cancel,
  .format-btn-confirm {
    width: 100%;
    justify-content: center;
  }
}
