/* Nestive Dynamic UI Management Panel - Dark Glassmorphism Stylesheet */
:root {
  --bg-primary: #0A0D14;
  --bg-secondary: #121826;
  --card-bg: rgba(20, 27, 45, 0.65);
  --card-border: rgba(255, 255, 255, 0.08);
  --accent-purple: #6C5CE7;
  --accent-purple-glow: rgba(108, 92, 231, 0.4);
  --accent-cyan: #00CEC9;
  --accent-blue: #0984E3;
  --accent-green: #00B894;
  --accent-red: #FF7675;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Background Ambient Glows */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  z-index: 0;
  pointer-events: none;
}
.bg-glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(108, 92, 231, 0.25) 0%, rgba(0,0,0,0) 70%);
  top: -100px;
  left: -100px;
}
.bg-glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 206, 201, 0.18) 0%, rgba(0,0,0,0) 70%);
  bottom: -150px;
  right: -150px;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 13, 20, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
}
.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  box-shadow: 0 4px 20px var(--accent-purple-glow);
}
.logo-text h1 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.sub-tag {
  font-size: 12px;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.server-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}
.status-dot.online {
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
}
.status-dot.pulse {
  animation: statusPulse 1.5s infinite;
}
@keyframes statusPulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* Main Container */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
  position: relative;
  z-index: 1;
}

/* Stats Bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.stat-icon.purple { background: rgba(108, 92, 231, 0.15); color: var(--accent-purple); }
.stat-icon.blue { background: rgba(9, 132, 227, 0.15); color: var(--accent-blue); }
.stat-icon.green { background: rgba(0, 184, 148, 0.15); color: var(--accent-green); }

.stat-info { display: flex; flex-direction: column; }
.stat-label { font-size: 13px; color: var(--text-secondary); }
.stat-value { font-family: var(--font-heading); font-size: 26px; font-weight: 700; margin-top: 2px; }
.text-sm { font-size: 18px; }

/* Controls Bar */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}
.search-box i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.search-box input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.search-box input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 12px var(--accent-purple-glow);
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.filter-pill {
  padding: 8px 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.filter-pill:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}
.filter-pill.active {
  background: var(--accent-purple);
  color: white;
  border-color: var(--accent-purple);
  box-shadow: 0 4px 15px var(--accent-purple-glow);
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple), #8E7CFF);
  color: white;
  box-shadow: 0 4px 16px var(--accent-purple-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.6);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}
.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  justify-content: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
}
.btn-icon:hover {
  color: white;
  border-color: var(--accent-purple);
}

/* Screen Section */
.screen-section {
  margin-bottom: 48px;
}
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--card-border);
}
.screen-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.screen-title h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}
.screen-count-badge {
  padding: 4px 12px;
  background: rgba(108, 92, 231, 0.15);
  border: 1px solid rgba(108, 92, 231, 0.3);
  color: var(--accent-purple);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* Assets Grid */
.assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.asset-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.asset-card:hover {
  transform: translateY(-4px);
  border-color: rgba(108, 92, 231, 0.5);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

/* Asset Preview Media Container */
.asset-media-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  background: #05070D;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.asset-media-wrapper img, .asset-media-wrapper video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.media-type-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 206, 201, 0.3);
}
.media-type-badge.gif { color: #FD79A8; border-color: rgba(253, 121, 168, 0.4); }
.media-type-badge.video { color: #74B9FF; border-color: rgba(116, 185, 255, 0.4); }

/* Asset Card Content */
.asset-card-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.dynamic-id-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(0, 206, 201, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  width: fit-content;
}
.asset-url-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
}
.asset-url-text {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}
.copy-btn:hover { color: var(--accent-purple); }

.asset-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--card-border);
}

.asset-card-footer {
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.card-action-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.card-action-btn.edit:hover { color: white; background: var(--accent-purple); border-color: var(--accent-purple); }
.card-action-btn.delete:hover { color: white; background: var(--accent-red); border-color: var(--accent-red); }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5, 7, 13, 0.85);
  backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-card {
  background: #121826;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}
.modal-overlay.active .modal-card {
  transform: scale(1);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}
.modal-close-btn:hover { color: white; }

.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.required { color: var(--accent-red); }

.form-group input[type="text"], .form-group input[type="url"] {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}
.form-group input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 10px var(--accent-purple-glow);
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed rgba(108, 92, 231, 0.4);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  background: rgba(108, 92, 231, 0.04);
  cursor: pointer;
  transition: all 0.2s;
}
.drop-zone:hover, .drop-zone.dragover {
  background: rgba(108, 92, 231, 0.12);
  border-color: var(--accent-purple);
}
.drop-icon {
  font-size: 32px;
  color: var(--accent-purple);
  margin-bottom: 10px;
}
.drop-text { font-size: 14px; color: var(--text-secondary); margin-bottom: 4px; }
.drop-text span { color: var(--accent-purple); font-weight: 600; text-decoration: underline; }
.drop-hint { font-size: 11px; color: var(--text-muted); }

.file-preview-bar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0, 206, 201, 0.1);
  border: 1px solid rgba(0, 206, 201, 0.3);
  border-radius: var(--radius-sm);
}
.file-info { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-primary); }
.file-size { font-size: 11px; color: var(--text-muted); }
.file-remove-btn { background: none; border: none; font-size: 18px; color: var(--accent-red); cursor: pointer; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}

/* Loading & Empty States */
.loading-container {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(108, 92, 231, 0.2);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 14px 20px;
  background: #1E293B;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  animation: toastIn 0.3s ease forwards;
}
.toast.success i { color: var(--accent-green); }
.toast.error i { color: var(--accent-red); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }
