/* ==========================================================================
   Design System & Premium CSS Custom Properties
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Default Theme: Glassmorphic Dark */
  --bg-gradient: linear-gradient(135deg, #0f0c20 0%, #15102a 50%, #06040a 100%);
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --accent-color: #6366f1; /* Indigo */
  --accent-glow: rgba(99, 102, 241, 0.5);
  --btn-bg: rgba(255, 255, 255, 0.05);
  --btn-border: rgba(255, 255, 255, 0.08);
  --btn-hover-bg: rgba(255, 255, 255, 0.12);
  --btn-hover-border: rgba(255, 255, 255, 0.2);
  --btn-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --pill-bg: rgba(255, 255, 255, 0.05);
  --pill-active-bg: #6366f1;
  --pill-active-text: #ffffff;
  
  --backdrop-blur: blur(20px);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --border-radius-sm: 8px;
}

/* Theme: Glassmorphic Light */
[data-theme="glassmorphic-light"] {
  --bg-gradient: linear-gradient(135deg, #eef2f6 0%, #e0e7ff 50%, #f5f3ff 100%);
  --card-bg: rgba(255, 255, 255, 0.45);
  --card-border: rgba(255, 255, 255, 0.6);
  --card-shadow: 0 20px 40px rgba(99, 102, 241, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --accent-color: #4f46e5;
  --accent-glow: rgba(79, 70, 229, 0.3);
  --btn-bg: rgba(255, 255, 255, 0.6);
  --btn-border: rgba(255, 255, 255, 0.8);
  --btn-hover-bg: rgba(255, 255, 255, 0.95);
  --btn-hover-border: #4f46e5;
  --btn-shadow: 0 4px 10px rgba(99, 102, 241, 0.05);
  --pill-bg: rgba(0, 0, 0, 0.05);
  --pill-active-bg: #4f46e5;
  --pill-active-text: #ffffff;
}

/* Theme: Cyberpunk Neon */
[data-theme="cyberpunk"] {
  --bg-gradient: linear-gradient(135deg, #050508 0%, #0d001a 100%);
  --card-bg: rgba(10, 5, 20, 0.9);
  --card-border: 2px solid #00f0ff;
  --card-shadow: 0 0 20px rgba(0, 240, 255, 0.2), 0 0 40px rgba(255, 0, 128, 0.1);
  --text-primary: #00f0ff;
  --text-secondary: #ff007f;
  --accent-color: #ff007f;
  --accent-glow: rgba(255, 0, 127, 0.6);
  --btn-bg: rgba(20, 0, 40, 0.7);
  --btn-border: 1px solid #ff007f;
  --btn-hover-bg: #ff007f;
  --btn-hover-border: #00f0ff;
  --btn-hover-text: #050508;
  --btn-shadow: 0 0 10px rgba(255, 0, 127, 0.3);
  --pill-bg: #140028;
  --pill-active-bg: #00f0ff;
  --pill-active-text: #050508;
}

/* Theme: Aurora Glow */
[data-theme="aurora"] {
  --bg-gradient: linear-gradient(135deg, #0b1c1e 0%, #081015 50%, #05070a 100%);
  --card-bg: rgba(10, 20, 25, 0.4);
  --card-border: rgba(50, 200, 160, 0.15);
  --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --text-primary: #e2f1f0;
  --text-secondary: #7fa2a0;
  --accent-color: #34d399; /* Emerald */
  --accent-glow: rgba(52, 211, 153, 0.4);
  --btn-bg: rgba(20, 35, 40, 0.4);
  --btn-border: rgba(52, 211, 153, 0.15);
  --btn-hover-bg: rgba(52, 211, 153, 0.15);
  --btn-hover-border: #34d399;
  --btn-shadow: 0 4px 15px rgba(52, 211, 153, 0.05);
  --pill-bg: rgba(255, 255, 255, 0.03);
  --pill-active-bg: #34d399;
  --pill-active-text: #0b1c1e;
}

/* Theme: Minimalist Soft */
[data-theme="minimalist"] {
  --bg-gradient: linear-gradient(135deg, #fafafa 0%, #f4f4f5 100%);
  --card-bg: #ffffff;
  --card-border: 1px solid #e4e4e7;
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
  --text-primary: #18181b;
  --text-secondary: #71717a;
  --accent-color: #18181b;
  --accent-glow: rgba(24, 24, 27, 0.1);
  --btn-bg: #ffffff;
  --btn-border: 1px solid #e4e4e7;
  --btn-hover-bg: #f4f4f5;
  --btn-hover-border: #18181b;
  --btn-shadow: none;
  --pill-bg: #f4f4f5;
  --pill-active-bg: #18181b;
  --pill-active-text: #ffffff;
  --backdrop-blur: none;
}

/* ==========================================================================
   Base Elements & Layout
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 20px;
  overflow-x: hidden;
  transition: background 0.5s ease;
  position: relative;
}

/* Dynamic ambient lights (only on glassmorphic/aurora themes) */
body::before, body::after {
  content: '';
  position: absolute;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  z-index: -1;
  filter: blur(120px);
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.5s ease, background 0.5s ease;
}

body:not([data-theme="minimalist"]):not([data-theme="cyberpunk"])::before {
  background: #6366f1;
  top: 10%;
  left: 15%;
  animation: floatLight1 20s infinite alternate ease-in-out;
}

body:not([data-theme="minimalist"]):not([data-theme="cyberpunk"])::after {
  background: #a855f7;
  bottom: 15%;
  right: 15%;
  animation: floatLight2 25s infinite alternate ease-in-out;
}

body[data-theme="aurora"]::before { background: #059669; }
body[data-theme="aurora"]::after { background: #0d9488; }

@keyframes floatLight1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.2); }
}
@keyframes floatLight2 {
  0% { transform: translate(0, 0) scale(1.2); }
  100% { transform: translate(-50px, -60px) scale(0.9); }
}

/* ==========================================================================
   Main Card Container (Glassmorphic)
   ========================================================================== */
.card-wrapper {
  opacity: 0;
  transform: translateY(30px);
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  width: 100%;
  max-width: 540px;
  z-index: 1;
}

.profile-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--card-shadow);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  padding: 36px 28px 24px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth), border 0.5s ease, box-shadow 0.5s ease;
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scanline and cyberpunk grid indicators */
[data-theme="cyberpunk"] .profile-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 4px, 6px 100%;
  pointer-events: none;
  z-index: 2;
}

/* ==========================================================================
   Header controls (Theme, Admin Gear)
   ========================================================================== */
.header-actions {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  gap: 12px;
  z-index: 10;
}

.header-left-actions {
  position: absolute;
  top: 24px;
  left: 24px;
  display: flex;
  gap: 12px;
  z-index: 10;
}

.icon-btn {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.icon-btn:hover {
  background: var(--btn-hover-bg);
  border-color: var(--btn-hover-border);
  transform: translateY(-2px) rotate(15deg);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ==========================================================================
   Profile Section Details
   ========================================================================== */
.profile-section {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar-container {
  position: relative;
  width: 110px;
  height: 110px;
  margin-bottom: 20px;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--card-border);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  transition: var(--transition-smooth);
}

.avatar-container::after {
  content: '';
  position: absolute;
  top: -6px; left: -6px; right: -6px; bottom: -6px;
  border-radius: 50%;
  border: 2px dashed var(--accent-color);
  opacity: 0.6;
  animation: rotateDashed 30s linear infinite;
  pointer-events: none;
}

@keyframes rotateDashed {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.profile-card:hover .avatar-img {
  transform: scale(1.05);
  border-color: var(--accent-color);
}

.profile-name {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.profile-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-color);
  background: rgba(99, 102, 241, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
  border: 1px solid rgba(99, 102, 241, 0.15);
  display: inline-block;
}

[data-theme="cyberpunk"] .profile-title {
  background: transparent;
  border: 1px solid #ff007f;
  color: #ff007f;
}

.profile-bio {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 380px;
  margin: 0 auto;
}

/* ==========================================================================
   Filter Tab Pills (Categories)
   ========================================================================== */
.categories-filter {
  display: flex;
  justify-content: safe center;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 10px;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.categories-filter::-webkit-scrollbar {
  height: 4px;
}

.categories-filter::-webkit-scrollbar-track {
  background: transparent;
}

.categories-filter::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  transition: var(--transition-smooth);
}

.categories-filter::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

[data-theme="glassmorphic-light"] .categories-filter::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
}

[data-theme="minimalist"] .categories-filter::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
}

.filter-pill {
  background: var(--pill-bg);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.filter-pill:hover {
  color: var(--text-primary);
  border-color: var(--btn-hover-border);
}

.filter-pill.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-text);
  border-color: var(--pill-active-bg);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* ==========================================================================
   Link Tree List Buttons
   ========================================================================== */
.links-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 320px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* Custom scrollbar for links list container */
.links-container::-webkit-scrollbar {
  width: 6px;
}

.links-container::-webkit-scrollbar-track {
  background: transparent;
}

.links-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  transition: var(--transition-smooth);
}

.links-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

[data-theme="glassmorphic-light"] .links-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
}

[data-theme="minimalist"] .links-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
}

.link-item {
  width: 100%;
  display: block;
  text-decoration: none;
  position: relative;
  animation: fadeInButton 0.5s ease forwards;
  opacity: 0;
  transform: translateY(10px);
}

@keyframes fadeInButton {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.link-btn {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: var(--border-radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  text-align: left;
  transition: var(--transition-smooth);
  box-shadow: var(--btn-shadow);
  position: relative;
  overflow: hidden;
}

.link-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  transition: 0.5s;
}

.link-btn:hover::before {
  left: 100%;
}

.link-btn:hover {
  background: var(--btn-hover-bg);
  border-color: var(--btn-hover-border);
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15), 0 0 12px var(--accent-glow);
}

/* Highlight item breathing border effect */
.link-item.highlighted .link-btn {
  border-color: var(--accent-color);
  box-shadow: 0 0 15px var(--accent-glow);
  animation: pulseBorder 2.5s infinite;
}

@keyframes pulseBorder {
  0% { box-shadow: 0 0 8px var(--accent-glow); }
  50% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.8), inset 0 0 4px var(--accent-glow); }
  100% { box-shadow: 0 0 8px var(--accent-glow); }
}

/* Icons styling inside buttons */
.link-icon-wrapper {
  background: rgba(255, 255, 255, 0.05);
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 18px;
  color: var(--accent-color);
  flex-shrink: 0;
  transition: var(--transition-smooth);
  border: 1px solid var(--card-border);
}

[data-theme="glassmorphic-light"] .link-icon-wrapper {
  background: rgba(0, 0, 0, 0.03);
}

.link-btn:hover .link-icon-wrapper {
  transform: scale(1.1) rotate(-5deg);
  background: var(--accent-color);
  color: #ffffff;
  border-color: var(--accent-color);
}

.link-icon-wrapper svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.link-info {
  flex-grow: 1;
}

.link-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-family: 'Outfit', sans-serif;
}

.link-description {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.link-arrow {
  color: var(--text-secondary);
  margin-left: 12px;
  transition: var(--transition-smooth);
  opacity: 0.5;
}

.link-btn:hover .link-arrow {
  transform: translateX(4px);
  color: var(--accent-color);
  opacity: 1;
}

.link-arrow svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Footer credits */
.footer-text {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.6;
}

.footer-text a {
  color: var(--accent-color);
  text-decoration: none;
}

/* ==========================================================================
   Admin Modal (Workspace & Config Panel)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: #110e20;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 900px;
  max-height: 85vh;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(15px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #f3f4f6;
}

.modal-overlay.active .modal-container {
  transform: scale(1) translateY(0);
}

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

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  padding: 4px;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: #ffffff;
  transform: scale(1.1);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .modal-body {
    grid-template-columns: 1fr;
  }
}

/* Admin Panels Sections */
.admin-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.admin-section-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #818cf8;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
}

/* Workspace Link Banner */
.workspace-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: var(--border-radius-md);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  margin-bottom: 20px;
  transition: var(--transition-smooth);
}

.workspace-banner.linked {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
}

.workspace-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
}

.workspace-banner.linked .status-indicator {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #9ca3af;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
  color: #ffffff;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Buttons inside admin panel */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
}

.btn-primary {
  background: #6366f1;
  color: #ffffff;
}

.btn-primary:hover {
  background: #4f46e5;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #f3f4f6;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: #ef4444;
  color: #ffffff;
}

.btn-success {
  background: #10b981;
  color: #ffffff;
}

.btn-success:hover {
  background: #059669;
}

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

.btn-full {
  width: 100%;
}

/* Link Editor Cards in Admin */
.admin-link-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-sm);
  padding: 14px;
  margin-bottom: 12px;
  position: relative;
}

.admin-link-card .card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

/* File explorer tree section */
.explorer-tree {
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  color: #a7f3d0;
  max-height: 250px;
  overflow-y: auto;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.explorer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
}

.explorer-item.folder {
  color: #fde047;
}

.explorer-item.file {
  color: #38bdf8;
  padding-left: 20px;
}

/* Modal Footer Actions */
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
}

.export-code-box {
  grid-column: span 2;
}

.export-code-box textarea {
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  background: #0c0a18;
  color: #38bdf8;
  min-height: 180px;
}

.badge-bot {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.badge-web {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

.badge-root {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

/* ==========================================================================
   Admin Dashboard & Humanized CRUD UI Additions
   ========================================================================== */
.admin-page {
  align-items: flex-start;
  padding-top: 60px;
}

.admin-link-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-smooth);
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-theme="glassmorphic-light"] .admin-link-card {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.02);
}

[data-theme="minimalist"] .admin-link-card {
  background: #ffffff;
  border-color: #e4e4e7;
  box-shadow: none;
}

.admin-link-card:hover {
  border-color: var(--accent-color);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 0 10px var(--accent-glow);
}

/* Admin Folder Cards */
.admin-folder-card {
  border-color: rgba(251, 191, 36, 0.2) !important;
}

.admin-folder-card:hover {
  border-color: #fbbf24 !important;
  background: rgba(251, 191, 36, 0.06) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 0 12px rgba(251, 191, 36, 0.25) !important;
}

[data-theme="glassmorphic-light"] .admin-folder-card {
  background: rgba(251, 191, 36, 0.05) !important;
}

[data-theme="glassmorphic-light"] .admin-folder-card:hover {
  background: rgba(251, 191, 36, 0.15) !important;
}

[data-theme="glassmorphic-light"] .admin-link-card:hover {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.08);
}

[data-theme="minimalist"] .admin-link-card:hover {
  background: #f4f4f5;
  box-shadow: none;
}

/* Reordering icon button styling */
.admin-link-card .icon-btn {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

[data-theme="glassmorphic-light"] .admin-link-card .icon-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.05);
}

.admin-link-card .icon-btn:hover:not([disabled]) {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #ffffff;
  transform: translateY(-1px);
}

.admin-link-card .icon-btn svg {
  width: 14px;
  height: 14px;
}

/* Responsive grid layout on tablets/mobiles */
@media (max-width: 820px) {
  #dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
}

/* At 100% zoom on desktop viewports, hide browser-level scrollbars to fit everything perfectly */
@media (min-height: 780px) and (min-width: 800px) {
  html, body {
    overflow: hidden;
  }
}

/* Admin Page Layout - Pinned Viewport for Desktop (No page scrollbars at 100% zoom) */
@media (min-width: 820px) and (min-height: 700px) {
  .admin-page {
    height: 100vh;
    padding: 20px !important;
    overflow: hidden !important;
    align-items: center;
    justify-content: center;
  }

  .admin-page .card-wrapper {
    height: 100%;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
  }

  .admin-page #dashboard-panel {
    height: 100%;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
  }

  .admin-page #dashboard-panel > #dashboard-grid {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .admin-page .dashboard-col-left {
    height: 100%;
    overflow-y: auto;
    padding-right: 8px;
  }

  .admin-page .dashboard-col-right {
    height: 100%;
    overflow: hidden !important; /* Prevent double scrollbar in column */
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .admin-page .dashboard-col-right > .admin-section:first-child {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .admin-page #admin-links-list {
    max-height: none !important; /* Let flexbox control height instead of inline 480px */
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 8px;
  }
}

/* Custom scrollbars for the admin columns and links list */
.dashboard-col-left::-webkit-scrollbar,
.dashboard-col-right::-webkit-scrollbar,
#admin-links-list::-webkit-scrollbar {
  width: 6px;
}

.dashboard-col-left::-webkit-scrollbar-track,
.dashboard-col-right::-webkit-scrollbar-track,
#admin-links-list::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard-col-left::-webkit-scrollbar-thumb,
.dashboard-col-right::-webkit-scrollbar-thumb,
#admin-links-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  transition: var(--transition-smooth);
}

.dashboard-col-left::-webkit-scrollbar-thumb:hover,
.dashboard-col-right::-webkit-scrollbar-thumb:hover,
#admin-links-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

[data-theme="glassmorphic-light"] .dashboard-col-left::-webkit-scrollbar-thumb,
[data-theme="glassmorphic-light"] .dashboard-col-right::-webkit-scrollbar-thumb,
[data-theme="glassmorphic-light"] #admin-links-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.08);
}

