/* Copied from app/globals.css to serve as static CSS */
html, body { margin: 0; padding: 0; background: #0b0c0e; color: #e9eaee; font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu; }
* { box-sizing: border-box; }
.bg-grid { position: fixed; inset: 0; pointer-events: none; background-image: linear-gradient(transparent 95%, rgba(255,255,255,0.06) 96%), linear-gradient(90deg, transparent 95%, rgba(255,255,255,0.06) 96%); background-size: 24px 24px, 24px 24px; opacity: .4; }
.container { max-width: 1200px; margin: 0 auto; padding: 32px; position: relative; }
.dashboard-wrap { min-height: 100vh; }
.title { font-size: 28px; font-weight: 700; letter-spacing: .02em; }
.subtitle { color: #b7b9c0; margin: 0; }
.center { display: grid; place-items: center; min-height: 70vh; gap: 12px; }
.button { 
  background: linear-gradient(135deg, #6b7cff, #5a67d8); 
  color: #fff; 
  padding: 12px 20px; 
  border: none; 
  border-radius: 10px; 
  cursor: pointer; 
  font-weight: 500;
  font-size: 14px;
  transition: all .2s ease; 
  box-shadow: 0 4px 12px rgba(107,124,255,.25);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
.button:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 6px 20px rgba(107,124,255,.35);
  background: linear-gradient(135deg, #7c8dff, #6b7cff);
}
.button:active {
  transform: translateY(0px);
  box-shadow: 0 2px 8px rgba(107,124,255,.3);
}
.button.secondary { 
  background: linear-gradient(135deg, #2a2d33, #1f2228); 
  color: #e9eaee; 
  border: 1px solid #3a3d43;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.button.secondary:hover {
  background: linear-gradient(135deg, #34373e, #2a2d33);
  border-color: #4a4d53;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.input, select { width: 100%; padding: 10px; background: #0f1013; border: 1px solid #2a2d33; color: #e9eaee; border-radius: 8px; }
.input:focus, select:focus { outline: none; border-color: #6b7cff; box-shadow: 0 0 0 3px rgba(107,124,255,.16); }
.dashboard { display: flex; flex-direction: column; gap: 24px; }
.dash-header { display: flex; align-items: center; justify-content: space-between; }
.title-wrap { display: flex; flex-direction: column; gap: 6px; }
.grid.two { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 960px) { .grid.two { grid-template-columns: 1fr 1fr; } }
.panel-section { background: linear-gradient(180deg,#0e1014,#0c0e12) padding-box, linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02)) border-box; border: 1px solid transparent; border-radius: 14px; padding: 16px; }
.section-head { display: flex; align-items: center; gap: 12px; }
.section-head h2 { margin: 0; font-size: 16px; letter-spacing: .08em; text-transform: uppercase; color: #b7b9c0; }
.section-head .rule { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255,255,255,.18), rgba(255,255,255,.04)); }
.section-body { display: flex; flex-direction: column; gap: 16px; }
.split { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1000px) { .split { grid-template-columns: 1fr 1fr; } }
.current { display: grid; gap: 10px; align-content: start; }
.current .kv { display: flex; align-items: center; justify-content: space-between; background: #0f1116; border: 1px solid #20232a; padding: 10px 12px; border-radius: 10px; }
.current .kv span { color: #a7abb5; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.current .kv b { font-size: 14px; }
.editor { display: grid; gap: 16px; }

.editor .button + .button {
  margin-left: 12px;
}

.permissions-save-section .editor {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  align-items: center;
}
.field { display: grid; gap: 6px; }
.field label { color: #a7abb5; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.field .actions { display: flex; justify-content: flex-end; }
.list { display: grid; gap: 10px; }
.list h3 { margin: 8px 0 4px; font-size: 14px; color: #c9ccd4; }
.list-scroll { max-height: 240px; overflow: auto; border: 1px solid #20232a; border-radius: 10px; padding: 8px; background: #0f1116; }
.row { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; border-bottom: 1px dashed #262a33; }
.row:last-child { border-bottom: 0; }
.muted { color: #9aa0aa; }
.toast { position: fixed; right: 24px; bottom: 24px; background: #11131a; border: 1px solid #2a2d33; padding: 10px 12px; border-radius: 8px; }

/* Layout helpers for previews */
.vstack { display: flex; flex-direction: column; gap: 2px; }
.hstack { display: flex; align-items: center; gap: 12px; }
.reason-badge { color: #9aa0aa; font-size: 12px; }
.preview-title { font-size: 15px; font-weight: 600; }
.preview-meta { color: #a7abb5; font-size: 12px; }

/* Member management styles */
.members-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}

.member-card {
  background: linear-gradient(180deg, #0f1116, #0d0f14) padding-box,
              linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)) border-box;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .15s ease, box-shadow .15s ease;
}

.member-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}

.member-avatars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #2a2d33;
  background: #0f1116;
}

.discord-avatar {
  border-color: #5865f2;
}

.roblox-avatar {
  border-color: #00a2ff;
}

.member-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.member-names {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.discord-info, .roblox-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #0d0f14;
  border-radius: 6px;
  border: 1px solid #20232a;
}

.platform-icon {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #a7abb5;
  min-width: 60px;
}

.user-name {
  font-size: 13px;
  color: #e9eaee;
  font-weight: 500;
}

.member-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.meta-label {
  color: #a7abb5;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.meta-value {
  color: #e9eaee;
  font-weight: 500;
}

.member-actions {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #20232a;
}

.button.small {
  padding: 6px 12px;
  font-size: 12px;
  flex: 1;
}

.button.danger {
  background: #dc3545;
  color: #fff;
}

.button.danger:hover {
  background: #c82333;
}

/* Modal styles */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal-content {
  background: linear-gradient(180deg, #0e1014, #0c0e12);
  border: 1px solid #2a2d33;
  border-radius: 12px;
  padding: 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #20232a;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  color: #e9eaee;
}

.modal-close {
  background: none;
  border: none;
  color: #9aa0aa;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background .15s ease;
}

.modal-close:hover {
  background: #20232a;
  color: #e9eaee;
}

.modal form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid #20232a;
}

/* Toast improvements */
.toast.success {
  background: #155724;
  border-color: #1e7e34;
  color: #d1eddb;
}

.toast.error {
  background: #721c24;
  border-color: #dc3545;
  color: #f5c6cb;
}

/* Permissions management styles */
.permission-level, .permission-group {
  background: linear-gradient(180deg, #0f1116, #0d0f14) padding-box,
              linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)) border-box;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  transition: transform .1s ease, box-shadow .1s ease;
}

.permission-level:hover, .permission-group:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}

.permission-level h3, .permission-group h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
  color: #e9eaee;
  font-weight: 600;
}

.permission-level p.muted, .permission-group p.muted {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: #9aa0aa;
}

.role-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px;
}

.dropdown-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.role-dropdown {
  min-height: 120px;
  max-height: 200px;
  padding: 8px;
  background: #0c0e12;
  border: 1px solid #2a2d33;
  color: #e9eaee;
  border-radius: 8px;
  font-size: 13px;
  resize: vertical;
}

.role-dropdown:focus {
  outline: none;
  border-color: #6b7cff;
  box-shadow: 0 0 0 3px rgba(107,124,255,.16);
}

.role-dropdown option {
  padding: 6px 8px;
  background: #0c0e12;
  color: #e9eaee;
  border: none;
}

.role-dropdown option:checked {
  background: #3498DB;
  color: #fff;
}

.role-dropdown option:hover {
  background: #2a2d33;
}

.dropdown-help {
  font-size: 11px;
  color: #9aa0aa;
  margin: 0;
  text-align: center;
  font-style: italic;
}

.role-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #0c0e12;
  border: 1px solid #20232a;
  border-radius: 6px;
  transition: background .15s ease;
}

.role-item:hover {
  background: #0f1116;
}

.role-item input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: #3498DB;
}

.role-label {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin: 0;
  color: #e9eaee;
}

.role-label:hover {
  color: #fff;
}

/* Special styling for high-priority permissions */
.permission-group[data-permission="permissions_management"] {
  border-color: rgba(220, 53, 69, 0.3);
  background: linear-gradient(180deg, #1a0d0f, #140a0c) padding-box,
              linear-gradient(180deg, rgba(220, 53, 69, .08), rgba(220, 53, 69, .02)) border-box;
}

.permission-level[data-level="owner"] {
  border-color: rgba(255, 215, 0, 0.3);
  background: linear-gradient(180deg, #1a1910, #14130c) padding-box,
              linear-gradient(180deg, rgba(255, 215, 0, .08), rgba(255, 215, 0, .02)) border-box;
}

/* Preview modal styles */
.preview-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.preview-description {
  text-align: center;
  color: #e9eaee;
  font-size: 14px;
  margin-bottom: 8px;
}

.preview-users {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 600px) {
  .preview-users {
    grid-template-columns: 1fr 1fr;
  }
}

.preview-user-card {
  background: linear-gradient(180deg, #0f1116, #0d0f14) padding-box,
              linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)) border-box;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 16px;
}

.preview-user-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.preview-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid #2a2d33;
  background: #0f1116;
  flex-shrink: 0;
}

.preview-avatar.discord-avatar {
  border-color: #5865f2;
}

.preview-avatar.roblox-avatar {
  border-color: #00a2ff;
}

.preview-user-info {
  flex: 1;
  min-width: 0;
}

.preview-user-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #a7abb5;
  margin-bottom: 4px;
}

.preview-user-name {
  font-size: 16px;
  font-weight: 600;
  color: #e9eaee;
  margin-bottom: 2px;
  word-wrap: break-word;
}

.preview-user-sub {
  font-size: 13px;
  color: #9aa0aa;
  margin-bottom: 2px;
  word-wrap: break-word;
}

.preview-user-id {
  font-size: 11px;
  color: #6b7280;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.preview-question {
  text-align: center;
  color: #e9eaee;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 0;
  border-top: 1px solid #20232a;
}
