/* ===== ALT AI ADMIN — UX & Design Improvements ===== */
/* Appended to existing admin.css — all original classes preserved */

/* --- CSS Variables for Admin Theme --- */
:root {
  --admin-bg: #0d1f1a;
  --admin-surface: #132821;
  --admin-surface-hover: #1a2e26;
  --admin-border: #1f3a30;
  --admin-border-focus: var(--green-light);
  --admin-text: #e8f0ec;
  --admin-text-muted: #9bb3a8;
  --admin-success: var(--green-light);
  --admin-warning: var(--gold);
  --admin-error: #d47373;
  --admin-radius-sm: 6px;
  --admin-radius: 10px;
  --admin-radius-lg: 14px;
  --admin-shadow: 0 4px 20px rgba(0,0,0,.3);
  --admin-transition: 200ms ease;
}

/* --- Scrollbar --- */
.admin-content::-webkit-scrollbar,
.admin-overlay::-webkit-scrollbar { width: 6px; height: 6px; }
.admin-content::-webkit-scrollbar-track,
.admin-overlay::-webkit-scrollbar-track { background: transparent; }
.admin-content::-webkit-scrollbar-thumb,
.admin-overlay::-webkit-scrollbar-thumb { background: rgba(82,183,136,.2); border-radius: 3px; }
.admin-content::-webkit-scrollbar-thumb:hover,
.admin-overlay::-webkit-scrollbar-thumb:hover { background: rgba(82,183,136,.4); }
.admin-tabs::-webkit-scrollbar { width: 3px; }
.admin-tabs::-webkit-scrollbar-thumb { background: rgba(82,183,136,.15); border-radius: 2px; }

/* --- Fade / Slide Animations --- */
@keyframes adminFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes adminSlideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes adminSlideDown { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes adminPulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes adminSpin { to { transform: rotate(360deg); } }
@keyframes adminShimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.admin-section.active { animation: adminFadeIn .25s ease; }
.admin-dialog-backdrop { animation: adminFadeIn .2s ease; }
.admin-dialog { animation: adminSlideUp .25s ease; }

/* --- Skeleton Loader --- */
.admin-skeleton {
  background: linear-gradient(90deg, #152521 0%, #1f3329 50%, #152521 100%);
  background-size: 200% 100%;
  animation: adminShimmer 1.5s infinite;
  border-radius: var(--admin-radius-sm);
}
.admin-skeleton-text { height: 14px; margin-bottom: 8px; width: 60%; }
.admin-skeleton-title { height: 20px; margin-bottom: 12px; width: 40%; }
.admin-skeleton-card { height: 80px; margin-bottom: 8px; border-radius: var(--admin-radius); }
.admin-skeleton-stats { height: 60px; border-radius: var(--admin-radius); margin-bottom: 16px; }

/* --- Enhanced Toast --- */
.admin-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 10001;
  padding: 12px 20px; border-radius: var(--admin-radius);
  font-size: .85rem; font-weight: 600;
  animation: adminSlideUp .3s ease;
  box-shadow: var(--admin-shadow);
  max-width: 360px;
  display: flex; align-items: center; gap: 10px;
  line-height: 1.4;
}
.admin-toast.admin-toast--success { background: #1b4332; color: var(--green-light); border: 1px solid rgba(82,183,136,.3); }
.admin-toast.admin-toast--error { background: #3b1a1a; color: var(--admin-error); border: 1px solid rgba(212,115,115,.3); }
.admin-toast.admin-toast--warning { background: #3b2e1a; color: var(--gold); border: 1px solid rgba(212,163,115,.3); }
.admin-toast.admin-toast--info { background: #1a2b3b; color: #73a3d4; border: 1px solid rgba(115,163,212,.3); }

/* --- Custom Confirm Dialog --- */
.admin-confirm { max-width: 380px; text-align: center; }
.admin-confirm-icon { font-size: 2rem; margin-bottom: 8px; }
.admin-confirm h3 { font-size: 1rem; margin-bottom: 6px; }
.admin-confirm p { font-size: .82rem; color: var(--admin-text-muted); margin-bottom: 16px; line-height: 1.5; }
.admin-confirm .admin-dialog-actions { justify-content: center; }

/* --- Keyboard Shortcut Hint --- */
.admin-kbd {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  background: #1f3329; border: 1px solid #2a3d34;
  font-size: .7rem; font-family: inherit; color: var(--admin-text-muted);
  line-height: 1.5;
}

/* --- Auto-save Indicator --- */
.admin-save-indicator {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .72rem; color: var(--admin-text-muted);
  padding: 4px 10px; border-radius: 6px;
  background: #152521;
  transition: all .3s;
}
.admin-save-indicator--saving { color: var(--gold); }
.admin-save-indicator--saved { color: var(--green-light); }
.admin-save-indicator--error { color: var(--admin-error); }
.admin-save-indicator .admin-spinner { width: 12px; height: 12px; }

/* --- Spinner --- */
.admin-spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid #304539;
  border-top-color: var(--green-light);
  border-radius: 50%;
  animation: adminSpin .6s linear infinite;
}
.admin-spinner--sm { width: 12px; height: 12px; border-width: 1.5px; }
.admin-spinner--lg { width: 32px; height: 32px; border-width: 3px; }
.admin-loading { display: flex; align-items: center; justify-content: center; padding: 40px; gap: 12px; color: var(--admin-text-muted); font-size: .85rem; }

/* --- Card Hover Effects --- */
.admin-route-card {
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.admin-route-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0,0,0,.25);
}
.admin-bg-item {
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.admin-bg-item:hover {
  transform: scale(1.02);
}
.admin-item {
  transition: transform .15s ease, background .15s ease;
}
.admin-item:hover {
  transform: translateX(2px);
}

/* --- Form Validation --- */
.admin-input--error { border-color: var(--admin-error) !important; box-shadow: 0 0 0 1px rgba(212,115,115,.2); }
.admin-input--success { border-color: var(--green-light) !important; }
.admin-field-error { font-size: .72rem; color: var(--admin-error); margin-top: 3px; display: none; }
.admin-field-error.visible { display: block; animation: adminSlideDown .2s ease; }

/* --- Drag & Drop --- */
.admin-draggable { cursor: grab; }
.admin-draggable:active { cursor: grabbing; }
.admin-dragging { opacity: .5; }
.admin-drag-over { border-color: var(--green-light) !important; background: rgba(82,183,136,.08) !important; }
.admin-drag-ghost {
  opacity: .4; transform: scale(.95);
  border: 2px dashed var(--green-light) !important;
}

/* --- Photo Grid Enhancements --- */
.admin-photo-grid-item { position: relative; transition: transform .2s; }
.admin-photo-grid-item:hover { transform: scale(1.03); z-index: 1; }
.admin-photo-grid-item img { transition: filter .2s; }
.admin-photo-grid-item:hover img { filter: brightness(1.1); }
.admin-photo-item { position: relative; }
.admin-photo-item .admin-btn-xs { position: absolute; top: 4px; right: 4px; opacity: 0; transition: opacity .2s; z-index: 1; }
.admin-photo-item:hover .admin-btn-xs { opacity: 1; }
.admin-photo-deleted { opacity: .4; filter: grayscale(1); }

/* --- Tab Hover Enhancement --- */
.admin-tab { position: relative; }
.admin-tab::before {
  content: ''; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 2px; height: 0;
  background: var(--green-light);
  transition: height .2s ease;
  border-radius: 1px;
}
.admin-tab:hover::before { height: 16px; }
.admin-tab.active::before { height: 24px; }

/* --- Progress Bar (for backup) --- */
.admin-progress {
  width: 100%; height: 6px;
  background: #1a2e26;
  border-radius: 3px; overflow: hidden;
}
.admin-progress-bar {
  height: 100%; background: var(--green-light);
  border-radius: 3px;
  transition: width .3s ease;
  min-width: 2px;
}
.admin-progress-label { font-size: .75rem; color: var(--admin-text-muted); margin-top: 6px; text-align: center; }

/* --- Tag/Filter Chips --- */
.filter-chip {
  padding: 4px 12px; border-radius: 6px;
  font-size: .78rem; font-weight: 600;
  border: 1px solid #233830;
  background: transparent; color: var(--admin-text-muted);
  cursor: pointer; transition: all .15s;
  font-family: inherit;
}
.filter-chip:hover { border-color: var(--green-light); color: var(--text); background: rgba(82,183,136,.06); }
.filter-chip.active { background: rgba(82,183,136,.15); color: var(--green-light); border-color: var(--green-light); }

/* --- Bulk Action Bar --- */
.admin-bulk-bar {
  position: sticky; bottom: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--admin-bg);
  border-top: 1px solid rgba(82,183,136,.15);
  animation: adminSlideUp .2s ease;
  z-index: 5;
  flex-wrap: wrap;
}

/* --- Tag Input (for place tags) --- */
.admin-tag-input {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 6px 8px;
  background: #1a2e26; border: 1px solid #233830;
  border-radius: var(--admin-radius-sm);
  min-height: 36px;
  align-items: center;
  cursor: text;
  transition: border-color .2s;
}
.admin-tag-input:focus-within { border-color: var(--green-light); }
.admin-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px;
  font-size: .75rem; font-weight: 600;
  background: rgba(82,183,136,.15); color: var(--green-light);
}
.admin-tag-remove {
  cursor: pointer; opacity: .6; font-size: .85rem; line-height: 1;
  transition: opacity .15s;
}
.admin-tag-remove:hover { opacity: 1; }
.admin-tag-input input {
  flex: 1; min-width: 60px;
  border: none; background: none;
  color: var(--text); font-size: .82rem;
  outline: none; font-family: inherit;
  padding: 2px 0;
}

/* --- Responsive mobile optimization --- */
@media (max-width: 768px) {
  .admin-toast { bottom: 70px; left: 12px; right: 12px; max-width: none; }
  .admin-kbd { display: none; }
  .admin-save-indicator { font-size: .65rem; padding: 2px 6px; }
}
@media (max-width: 480px) {
  .admin-bulk-bar { padding: 8px 10px; }
  .admin-bulk-bar .admin-btn { flex: 1; min-width: 0; font-size: .72rem; }
  .admin-dialog .admin-dialog-actions button { min-height: 44px; }
}

/* --- SVG Button Styles --- */
.admin-btn svg, .admin-toggle svg, .admin-item svg {
  width: 14px; height: 14px; fill: currentColor; stroke: currentColor;
  vertical-align: middle; flex-shrink: 0;
}
.admin-btn--icon {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 6px;
  background: var(--admin-surface); border: 1px solid var(--admin-border);
  color: var(--admin-text); font-size: .8rem; cursor: pointer;
  transition: background 150ms, border-color 150ms;
}
.admin-btn--icon:hover {
  background: var(--admin-surface-hover); border-color: var(--green-light);
}
.admin-btn--danger:hover {
  background: #3b1a1a; border-color: #d47373; color: #f87171;
}
.admin-role-badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 4px; font-size: .7rem; font-weight: 600;
}
.admin-role-badge--superadmin { background: #3b2e1a; color: var(--gold); }
.admin-role-badge--admin { background: #1b4332; color: var(--green-light); }
.admin-role-badge--editor { background: #1a2b3b; color: #73a3d4; }
.admin-role-badge--user { background: #2a2a2a; color: #aaa; }
