/* POIS Service - Dark Gradient Theme (matching analyzer.techexlab.com) */

/* Global reset */
* { 
  box-sizing: border-box; 
  margin: 0;
  padding: 0;
}

html, body { 
  height: 100%; 
  margin: 0;
}

/* === Brand tokens (from analyzer) === */
:root {
  --primary:   #667eea;
  --secondary: #764ba2;
  --success:   #48bb78;
  --warning:   #ffd93d;
  --error:     #ff6b6b;

  --text-primary:  #e0e0e0;
  --text-secondary:#a0a0a0;

  --dark:    #0a0a0a;                  /* gradient start */
  --panel:   rgba(20, 20, 35, 0.95);   /* frosted panels */
  --border:  rgba(255,255,255,0.10);   /* panel borders */

  --field-bg: rgba(255,255,255,0.05);  /* filled inputs */
  --field-bg-hover: rgba(255,255,255,0.08);
  
  --topbar-h: 64px;
}

/* Background gradient (matches analyzer) */
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, var(--dark) 0%, #1a1a2e 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  padding-top: var(--topbar-h);
}

/* === HEADER / TOPBAR === */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 32px;
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  height: 32px;
  width: auto;
  display: block;
}

/* Fallback text logo if no image provided */
.logo-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
  text-decoration: none;
  display: inline-block;
}

.brand-sub {
  color: var(--primary);
  text-decoration: none;
  font-size: 18px;
  font-weight: 500;
}

.nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav a {
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
  font-weight: 500;
}

.nav a:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.nav a.active {
  color: var(--primary);
  background: rgba(102, 126, 234, 0.1);
}

.spacer {
  flex: 1;
}

.right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Connected status dot */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 8px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.status-text {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Token display */
#tokenDisplay, #token-state {
  color: var(--text-secondary);
  font-size: 13px;
}

/* === MAIN CONTENT === */
.content {
  max-width: 1400px;
  margin: 32px auto;
  padding: 0 24px;
}

.content-max-width {
  max-width: 980px;
  margin: 32px auto;
  padding: 0 24px;
}

.events-max-width {
  max-width: 1400px;
  margin: 32px auto;
  padding: 0 24px;
}

h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
}

h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* Gradient text utility */
.grad-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* === PANELS & CARDS === */
.panel,
.card {
  background: var(--panel);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 14px;
}

/* === FORMS & INPUTS === */
.form-row, .row {
  display: flex;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 150px;
}

label {
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--field-bg-hover);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-secondary);
}

/* Custom select styling */
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='12' viewBox='0 0 20 20' width='12' xmlns='http://www.w3.org/2000/svg'><path d='M5.516 7.548l4.484 4.484 4.484-4.484L16 9.064l-6 6-6-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 36px;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 100px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 13px;
}

/* === BUTTONS === */
button,
.btn {
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--field-bg);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  font-family: inherit;
}

button:hover:not(:disabled),
.btn:hover:not(:disabled) {
  background: var(--field-bg-hover);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: 0;
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
  transform: translateY(-2px);
}

.btn-success {
  background: var(--success);
  border: 0;
  color: white;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  background: var(--field-bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sm:hover {
  background: var(--field-bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}

/* === TABLES === */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

thead {
  border-bottom: 1px solid var(--border);
}

thead th {
  padding: 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.2s;
}

tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

tbody td {
  padding: 14px 12px;
  color: var(--text-primary);
  font-size: 14px;
}

/* Events table specific */
.events-table {
  width: 100%;
  border-collapse: collapse;
}

.events-table th {
  text-align: left;
  padding: 14px 16px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.events-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.events-table tbody tr {
  transition: background 0.15s;
}

.events-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* === BADGES & STATUS === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid;
}

.badge-success {
  background: rgba(72, 187, 120, 0.15);
  border-color: rgba(72, 187, 120, 0.35);
  color: var(--success);
}

.badge-warning {
  background: rgba(255, 217, 61, 0.15);
  border-color: rgba(255, 217, 61, 0.35);
  color: var(--warning);
}

.badge-error {
  background: rgba(255, 107, 107, 0.15);
  border-color: rgba(255, 107, 107, 0.35);
  color: var(--error);
}

.badge-primary {
  background: rgba(102, 126, 234, 0.15);
  border-color: rgba(102, 126, 234, 0.35);
  color: var(--primary);
}

.badge-neutral {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border);
  color: var(--text-secondary);
}

/* Badge styles for events page */
.badge-noop {
  background: rgba(160, 160, 160, 0.15);
  color: #a0a0a0;
  border: 1px solid rgba(160, 160, 160, 0.3);
}

.badge-delete {
  background: rgba(255, 107, 107, 0.15);
  color: var(--error);
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.badge-replace {
  background: rgba(102, 126, 234, 0.15);
  color: var(--primary);
  border: 1px solid rgba(102, 126, 234, 0.3);
}

/* Action badges (for POIS events) */
.action-noop {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid;
  display: inline-block;
}

.action-delete {
  background: rgba(255, 107, 107, 0.15);
  border-color: rgba(255, 107, 107, 0.35);
  color: var(--error);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid;
  display: inline-block;
}

.action-replace {
  background: rgba(72, 187, 120, 0.15);
  border-color: rgba(72, 187, 120, 0.35);
  color: var(--success);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid;
  display: inline-block;
}

/* Status colors */
.status-200 {
  color: var(--success);
  font-weight: 600;
}

.status-400,
.status-500 {
  color: var(--error);
  font-weight: 600;
}

/* === STATISTICS CARDS === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--panel);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.2s;
}

.stat-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.auto-refresh {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* === FILTER BAR === */
.filter-bar {
  background: var(--panel);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
}

/* === PAGINATION === */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  margin-top: -1px;
}

.pagination-info {
  color: var(--text-secondary);
  font-size: 14px;
}

.pagination-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* === SORTABLE HEADERS === */
.sortable-header {
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

.sortable-header:hover {
  color: var(--primary);
}

.sort-indicator {
  display: inline-block;
  margin-left: 6px;
  opacity: 0.5;
  font-size: 10px;
}

/* === MODAL - FIXED FOR EVENTS PAGE === */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal.show {
  display: flex;
  opacity: 1;
  pointer-events: all;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  z-index: 10001;
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  color: var(--text-primary);
}

/* Detail grid for event details */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.detail-item {
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.detail-item strong {
  display: block;
  color: var(--text-secondary);
  font-size: 11px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.detail-item pre {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* === CODE / PRE === */
pre,
code {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 6px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 13px;
  color: var(--text-primary);
}

pre {
  padding: 16px;
  overflow-x: auto;
  line-height: 1.5;
}

.small {
  font-size: 12px;
  color: var(--text-secondary);
}

/* === UTILITY CLASSES === */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.items-end {
  align-items: flex-end;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }

.ml-2 { margin-left: 8px; }

.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }

.px-2 { padding-left: 8px; padding-right: 8px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-sm {
  font-size: 12px;
}

.text-xs {
  font-size: 11px;
}

.text-2xl {
  font-size: 24px;
}

.font-mono {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.text-muted {
  color: var(--text-secondary);
}

.text-primary {
  color: var(--primary);
}

.text-success {
  color: var(--success);
}

.text-error {
  color: var(--error);
}

.text-red-600 {
  color: var(--error);
}

.w-full {
  width: 100%;
}

.w-64 {
  width: 16rem;
}

.hidden {
  display: none;
}

.overflow-auto {
  overflow: auto;
}

.overflow-x-auto {
  overflow-x: auto;
}

.cursor-pointer {
  cursor: pointer;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .topbar {
    padding: 0 16px;
    gap: 16px;
  }

  .content, .content-max-width, .events-max-width {
    padding: 0 16px;
    margin: 16px auto;
  }

  .filter-bar,
  .form-row,
  .row {
    flex-direction: column;
    align-items: stretch;
  }

  .form-group {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 12px;
  }

  thead th,
  tbody td {
    padding: 8px;
  }

  .nav {
    flex-wrap: wrap;
  }
}

/* === EMPTY STATES === */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  line-height: 1.6;
}

/* === LOADING SPINNER === */
.spinner {
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 40px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* === ADMIN SPECIFIC === */
.toolbar {
  background: var(--panel);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.channel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.channel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.channel-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.channel-item.active {
  background: rgba(102, 126, 234, 0.15);
  border-color: rgba(102, 126, 234, 0.4);
}

.rule-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.rule-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.admin-sidebar {
  min-height: calc(100vh - 64px);
}

.space-y-1 > * + * {
  margin-top: 4px;
}

.space-y-2 > * + * {
  margin-top: 8px;
}

.grid {
  display: grid;
}

.grid-cols-12 {
  grid-template-columns: repeat(12, 1fr);
}

.col-span-3 {
  grid-column: span 3;
}

.col-span-9 {
  grid-column: span 9;
}

.border {
  border: 1px solid var(--border);
}

.border-r {
  border-right: 1px solid var(--border);
}

.border-b {
  border-bottom: 1px solid var(--border);
}

.rounded {
  border-radius: 8px;
}

.text-xl {
  font-size: 20px;
}

.text-gray-500 {
  color: var(--text-secondary);
}

.text-gray-900 {
  color: var(--text-primary);
}

.bg-white {
  background: transparent;
}

.bg-gray-50 {
  background: rgba(255, 255, 255, 0.02);
}

.min-h-screen {
  min-height: 100vh;
}

/* === HR === */
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* =============================================================
   PASSWORD CHANGE MODAL
   Add these styles to your static/app.css file
   ============================================================= */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}

.error-message {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  color: #ff6b6b;
  padding: 12px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 14px;
}

.success-message {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  color: #4caf50;
  padding: 12px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 14px;
}

/* Clickable username in header */
.username-clickable {
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.2s;
  color: var(--text-primary);
  font-weight: 500;
}

.username-clickable:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Responsive modal */
@media (max-width: 600px) {
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 16px;
  }
}