/* ==========================================================================
   VietUPLOAD Design System — "Ngộ nghĩnh · Hiện đại · Chuyên nghiệp · Mượt mà"
   ========================================================================== */

:root {
  /* Brand palette */
  --brand-50:  #EFF6FF;
  --brand-100: #DBEAFE;
  --brand-200: #BFDBFE;
  --brand-500: #3B82F6;
  --brand-600: #2563EB;
  --brand-700: #1D4ED8;

  /* Playful & Modern Accents */
  --accent-coral:  #FF6B6B;
  --accent-mint:   #2EC4B6;
  --accent-sun:    #FFB703;
  --accent-violet: #8B5CF6;
  --accent-pink:   #EC4899;

  /* Light Theme Canvas & Surface */
  --bg-canvas: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-hover: #F1F5F9;
  --bg-surface-subtle: #F8FAFC;
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --text-tertiary: #94A3B8;
  --border-subtle: #E2E8F0;

  /* Radius tokens */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  /* Elevation / Shadows */
  --shadow-soft: 0 2px 10px rgba(15, 23, 42, 0.05);
  --shadow-float: 0 14px 28px -6px rgba(15, 23, 42, 0.12), 0 6px 12px -3px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.25);

  /* Animation Easing */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 120ms;
  --dur-base: 220ms;
  --dur-slow: 360ms;
}

/* Dark Theme Variables */
[data-bs-theme="dark"], [data-theme="dark"] {
  --bg-canvas: #0B1120;
  --bg-surface: #131B2E;
  --bg-surface-hover: #1C2740;
  --bg-surface-subtle: #182238;
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-tertiary: #64748B;
  --border-subtle: #1E293B;

  --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-float: 0 14px 28px -6px rgba(0, 0, 0, 0.5);
}

/* Base Body Styling */
body {
  background-color: var(--bg-canvas) !important;
  color: var(--text-primary) !important;
  transition: background-color var(--dur-base) var(--ease-smooth), color var(--dur-base) var(--ease-smooth);
}

/* Cards & Surfaces */
.card, .modal-content, .dropdown-menu, .sidebar {
  background-color: var(--bg-surface) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-primary) !important;
}

.table {
  color: var(--text-primary) !important;
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--border-subtle);
}

.table-light {
  --bs-table-bg: var(--bg-surface-subtle) !important;
  color: var(--text-secondary) !important;
}

.table-hover tbody tr:hover {
  background-color: var(--bg-surface-hover) !important;
}

/* Playful Keyframe Animations */
@keyframes bounce-soft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes pulse-gentle {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shimmer-progress {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes float-cloud {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(1.5deg); }
}

@keyframes pop-success {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

/* Interactive Card & Button Polish */
.card-playful {
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-soft);
  transition: transform var(--dur-base) var(--ease-bounce), box-shadow var(--dur-base) var(--ease-smooth);
}

.card-playful:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-float);
}

.icon-bounce:hover {
  animation: bounce-soft 0.5s var(--ease-bounce);
}

.float-illustration {
  animation: float-cloud 4s ease-in-out infinite;
}

/* Upload Dropzone Polish */
.dropzone-playful {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  background-color: var(--bg-surface-subtle);
  transition: all var(--dur-base) var(--ease-smooth);
}

.dropzone-playful.dragging {
  border-color: var(--brand-600);
  background-color: var(--brand-50);
  transform: scale(1.01);
}

.dropzone-playful.dragging .upload-icon-circle {
  animation: bounce-soft 0.6s var(--ease-bounce) infinite;
  background-color: var(--brand-600) !important;
  color: #fff !important;
}

/* Shimmer Progress Bar */
.progress-shimmer {
  background: linear-gradient(90deg, var(--brand-600) 0%, #60A5FA 50%, var(--brand-600) 100%);
  background-size: 200% 100%;
  animation: shimmer-progress 1.5s linear infinite;
  border-radius: var(--radius-pill);
}

/* Success Check Pop */
.check-pop {
  animation: pop-success 0.4s var(--ease-bounce);
  color: var(--accent-mint) !important;
}

/* Favorite Star Button */
.star-btn {
  color: var(--text-tertiary);
  transition: color var(--dur-fast) var(--ease-smooth), transform var(--dur-fast) var(--ease-bounce);
}

.star-btn:hover {
  transform: scale(1.2);
  color: var(--accent-sun) !important;
}

.star-btn.active {
  color: var(--accent-sun) !important;
}

/* Tag Badges */
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  transition: transform var(--dur-fast) var(--ease-smooth);
}

.tag-pill:hover {
  transform: translateY(-1px);
}

/* Toast Progress Auto-dismiss Indicator */
.toast-bar-container {
  position: relative;
  overflow: hidden;
}

.toast-progress-line {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.4);
  transform-origin: left;
  animation: toast-dismiss 4s linear forwards;
}

@keyframes toast-dismiss {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Theme Switcher Button */
.theme-switch-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  transition: background var(--dur-fast) var(--ease-smooth), transform var(--dur-fast) var(--ease-bounce);
}

.theme-switch-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(15deg);
}

/* Multi-select Floating Action Bar */
.bulk-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1050;
  transition: transform var(--dur-base) var(--ease-bounce);
}

.bulk-bar.show {
  transform: translateX(-50%) translateY(0);
}


/* ==================== Admin Components ==================== */

.admin-sidebar {
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-surface-subtle) 100%);
  border-right: 1px solid var(--border-subtle);
}

.admin-sidebar .nav-link {
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  transition: all var(--dur-fast) var(--ease-smooth);
}

.admin-sidebar .nav-link:hover {
  background-color: var(--bg-surface-hover);
  color: var(--brand-600);
}

.admin-sidebar .nav-link.active {
  background-color: var(--brand-50);
  color: var(--brand-700);
  font-weight: 600;
}

[data-bs-theme=dark] .admin-sidebar .nav-link.active {
  background-color: rgba(37, 99, 235, 0.2);
  color: #60A5FA;
}

.admin-sidebar .sidebar-badge {
  font-size: 0.75rem;
  padding: 0.25em 0.6em;
  border-radius: var(--radius-pill);
}

.stat-card-admin {
  border-left: 4px solid var(--brand-500);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  background-color: var(--bg-surface);
  transition: transform var(--dur-fast) var(--ease-smooth), box-shadow var(--dur-fast) var(--ease-smooth);
}

.stat-card-admin:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-float);
}

.timeline-widget {
  position: relative;
  padding-left: 1.5rem;
}

.timeline-widget::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 7px;
  width: 2px;
  background-color: var(--border-subtle);
}

.timeline-widget .timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline-widget .timeline-dot {
  position: absolute;
  left: -1.5rem;
  top: 0.25rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--brand-500);
  border: 3px solid var(--bg-surface);
}

.filter-panel {
  transition: max-height var(--dur-base) var(--ease-smooth), opacity var(--dur-base) var(--ease-smooth);
  overflow: hidden;
  max-height: 500px;
  opacity: 1;
}

.filter-panel.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-top: none !important;
  border-bottom: none !important;
}

.data-table-enhanced {
  width: 100%;
}

.data-table-enhanced th {
  position: sticky;
  top: 0;
  background-color: var(--bg-surface-subtle);
  z-index: 10;
  border-bottom: 2px solid var(--border-subtle);
}

.data-table-enhanced tr {
  transition: background-color var(--dur-fast) var(--ease-smooth);
}

.data-table-enhanced tr:hover {
  background-color: var(--bg-surface-hover);
}

.user-detail-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background-color: var(--bg-surface);
}

.quota-bar {
  height: 8px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--brand-500) 0%, var(--brand-400) 100%);
}

.quota-bar.warning {
  background: linear-gradient(90deg, var(--accent-sun) 0%, #FFD166 100%);
}

.quota-bar.danger {
  background: linear-gradient(90deg, var(--accent-coral) 0%, #FF8A8A 100%);
}

.badge-pulse {
  position: relative;
}

.badge-pulse::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  background-color: inherit;
  animation: badge-pulse 2s infinite;
  z-index: -1;
}

@keyframes badge-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2); opacity: 0; }
}

.password-strength {
  height: 6px;
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.password-strength .strength-bar {
  flex: 1;
  border-radius: var(--radius-pill);
  background-color: var(--border-subtle);
  transition: background-color var(--dur-base) var(--ease-smooth);
}

.confirm-modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.confirm-modal-icon.danger {
  background-color: rgba(255, 107, 107, 0.1);
  color: var(--accent-coral);
}

.confirm-modal-icon.warning {
  background-color: rgba(255, 183, 3, 0.1);
  color: var(--accent-sun);
}

.confirm-modal-icon.info {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--brand-500);
}

.quick-actions .btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.admin-file-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface-subtle);
}
