/**
 * Dashboard V18 - Ultra-modern Bento Grid & Glassmorphism Theme
 * Designed for AVS Conference Management & Peer-Review System
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  
  /* Canvas & Cards */
  --v18-bg: #f4f6fb;
  --v18-card-bg: #ffffff;
  --v18-card-glass: rgba(255, 255, 255, 0.88);
  --v18-card-border: rgba(226, 232, 240, 0.8);
  --v18-card-radius: 22px;
  --v18-card-radius-sm: 16px;
  --v18-card-radius-lg: 28px;
  
  /* Modern Shadows */
  --v18-shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.04), 0 1px 4px -1px rgba(15, 23, 42, 0.02);
  --v18-shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.02);
  --v18-shadow-lg: 0 20px 35px -10px rgba(99, 102, 241, 0.09), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
  --v18-shadow-hover: 0 22px 40px -10px rgba(99, 102, 241, 0.16), 0 6px 16px -2px rgba(15, 23, 42, 0.04);
  
  /* Accents & Gradients */
  --v18-purple-primary: #7c3aed;
  --v18-purple-light: #8b5cf6;
  --v18-purple-soft: #f5f3ff;
  --v18-purple-border: #ddd6fe;
  
  --v18-hero-gradient: linear-gradient(135deg, #e9d5ff 0%, #ede9fe 40%, #fae8ff 100%);
  --v18-hero-dark: #1e1b4b;
  
  --v18-emerald: #10b981;
  --v18-emerald-soft: #ecfdf5;
  --v18-emerald-border: #a7f3d0;
  
  --v18-amber: #f59e0b;
  --v18-amber-soft: #fffbeb;
  --v18-amber-border: #fde68a;
  
  --v18-rose: #f43f5e;
  --v18-rose-soft: #fff1f2;
  --v18-rose-border: #fecdd3;
  
  --v18-sky: #0284c7;
  --v18-sky-soft: #f0f9ff;
  --v18-sky-border: #bae6fd;
  
  /* Chỉ animate các thuộc tính rẻ (không dùng "all") để tránh giật lag */
  --v18-transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, box-shadow 0.25s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Global Reset & Typography */
body {
  font-family: var(--font-main) !important;
  background-color: var(--v18-bg) !important;
  color: #1e293b !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .card-title, .bento-title {
  font-family: var(--font-heading) !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.02em;
}

/* Top Header */
.header {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05) !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
  height: 68px !important;
  padding: 0 28px !important;
}

.header .logo img {
  max-height: 42px !important;
}

/* Capsule Avatar & Role Badge in Header */
.user-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  padding: 6px 14px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.875rem;
  color: #334155;
  border: 1px solid #e2e8f0;
  transition: var(--v18-transition);
}

.user-pill-badge:hover {
  background: #e2e8f0;
}

.avatar-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.25);
}

/* Modern Sidebar */
.sidebar {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(14px) !important;
  border-right: 1px solid rgba(226, 232, 240, 0.8) !important;
  box-shadow: 2px 0 20px rgba(15, 23, 42, 0.03) !important;
  padding: 24px 16px !important;
  top: 68px !important;
}

.sidebar-nav .nav-heading {
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: #94a3b8 !important;
  padding: 12px 14px 6px !important;
}

.sidebar-nav .nav-link {
  font-size: 0.925rem !important;
  font-weight: 600 !important;
  color: #475569 !important;
  background: transparent !important;
  border-radius: 14px !important;
  padding: 11px 16px !important;
  margin-bottom: 4px !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  transition: var(--v18-transition) !important;
}

.sidebar-nav .nav-link i {
  font-size: 1.15rem !important;
  color: #64748b !important;
  transition: var(--v18-transition) !important;
}

.sidebar-nav .nav-link:hover {
  color: #7c3aed !important;
  background: #f5f3ff !important;
  transform: translateX(4px);
}

.sidebar-nav .nav-link:hover i {
  color: #7c3aed !important;
}

.sidebar-nav .nav-link.active-page,
.sidebar-nav .nav-link:not(.collapsed) {
  color: #7c3aed !important;
  background: #f5f3ff !important;
  font-weight: 700 !important;
  box-shadow: inset 0 0 0 1px #ddd6fe;
}

.sidebar-nav .nav-link.active-page i,
.sidebar-nav .nav-link:not(.collapsed) i {
  color: #7c3aed !important;
}

.sidebar-nav .nav-content a {
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: #64748b !important;
  border-radius: 10px !important;
  padding: 8px 14px 8px 36px !important;
  transition: var(--v18-transition) !important;
}

.sidebar-nav .nav-content a:hover,
.sidebar-nav .nav-content a.active {
  color: #7c3aed !important;
  background: #faf5ff !important;
}

/* Bento Cards System */
.bento-card {
  background: var(--v18-card-bg);
  border: var(--v18-card-border);
  border-radius: var(--v18-card-radius);
  box-shadow: var(--v18-shadow-md);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--v18-transition);
}

.bento-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--v18-shadow-hover);
}

.bento-card.no-lift {
  overflow: visible;
}

.bento-card.no-lift:hover {
  transform: none;
  box-shadow: var(--v18-shadow-md);
}

/* Hero Banner (Lavender V18 Style) */
.hero-v18 {
  background: var(--v18-hero-gradient);
  border-radius: var(--v18-card-radius-lg);
  padding: 32px 36px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 35px -8px rgba(147, 51, 234, 0.14);
  border: 1px solid rgba(233, 213, 255, 0.9);
  margin-bottom: 24px;
}

.hero-v18::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.35) 0%, rgba(216, 180, 254, 0) 70%);
  filter: blur(25px);
  pointer-events: none;
}

.hero-v18::after {
  content: '';
  position: absolute;
  bottom: -50px;
  right: 120px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.25) 0%, rgba(244, 114, 182, 0) 70%);
  filter: blur(25px);
  pointer-events: none;
}

.hero-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: #1e1b4b;
  margin-bottom: 8px;
  line-height: 1.25;
}

.hero-desc {
  font-size: 0.95rem;
  color: #581c87;
  max-width: 680px;
  line-height: 1.55;
  margin-bottom: 20px;
}

/* Stat Cards (V18 Bento Stats) */
.stat-card-v18 {
  background: #ffffff;
  border-radius: var(--v18-card-radius);
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 22px 24px;
  box-shadow: var(--v18-shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  transition: var(--v18-transition);
}

.stat-card-v18:hover {
  transform: translateY(-5px);
  box-shadow: var(--v18-shadow-hover);
  border-color: rgba(168, 85, 247, 0.4);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.stat-icon.purple {
  background: #f5f3ff;
  color: #7c3aed;
  border: 1px solid #ddd6fe;
}

.stat-icon.amber {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.stat-icon.emerald {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.stat-icon.rose {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

.stat-icon.sky {
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.stat-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stat-label {
  font-size: 0.825rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  font-family: var(--font-heading);
}

.stat-footer {
  margin-top: 14px;
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Modern Pills & Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-status.accepted {
  background: var(--v18-emerald-soft);
  color: #047857;
  border: 1px solid var(--v18-emerald-border);
}

.badge-status.reviewing {
  background: var(--v18-amber-soft);
  color: #b45309;
  border: 1px solid var(--v18-amber-border);
}

.badge-status.rejected {
  background: var(--v18-rose-soft);
  color: #be123c;
  border: 1px solid var(--v18-rose-border);
}

.badge-status.revision-minor {
  background: var(--v18-sky-soft);
  color: #0369a1;
  border: 1px solid var(--v18-sky-border);
}

.badge-status.revision-major {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.badge-status.new-sub {
  background: var(--v18-purple-soft);
  color: var(--v18-purple-primary);
  border: 1px solid var(--v18-purple-border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.badge-status.accepted .status-dot { background: #10b981; }
.badge-status.reviewing .status-dot { background: #f59e0b; }
.badge-status.rejected .status-dot { background: #f43f5e; }
.badge-status.revision-minor .status-dot { background: #0284c7; }
.badge-status.revision-major .status-dot { background: #ea580c; }
.badge-status.new-sub .status-dot { background: #7c3aed; }

/* Buttons V18 */
.btn-v18-primary {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #ffffff !important;
  border: none;
  border-radius: 9999px;
  padding: 10px 22px;
  font-weight: 700;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
  transition: var(--v18-transition);
}

.btn-v18-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
  color: #ffffff;
}

.btn-v18-secondary {
  background: #ffffff;
  color: #334155 !important;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  padding: 9px 20px;
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--v18-transition);
}

.btn-v18-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a !important;
  transform: translateY(-2px);
}

.btn-v18-pill-sm {
  padding: 6px 14px !important;
  font-size: 0.8rem !important;
  border-radius: 9999px !important;
  font-weight: 600 !important;
}

/* Stepper Component */
.v18-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin: 20px 0;
  padding: 0 10px;
}

.v18-stepper::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 30px;
  right: 30px;
  height: 3px;
  background: #e2e8f0;
  z-index: 1;
}

.v18-step-item {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.v18-step-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #64748b;
  transition: var(--v18-transition);
}

.v18-step-item.completed .v18-step-icon {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
  box-shadow: 0 0 0 4px #d1fae5;
}

.v18-step-item.active .v18-step-icon {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #ffffff;
  box-shadow: 0 0 0 4px #ede9fe;
}

.v18-step-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  max-width: 90px;
  line-height: 1.25;
}

.v18-step-item.active .v18-step-label {
  color: #7c3aed;
}

.v18-step-item.completed .v18-step-label {
  color: #0f172a;
}

/* Modern DataTables Enhancements */
.dataTables_wrapper,
.dt-container {
  padding: 6px 0 !important;
  max-width: 100%;
}

.dt-layout-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

table.dataTable {
  border-collapse: separate !important;
  border-spacing: 0 8px !important;
  width: 100% !important;
  max-width: 100% !important;
}

table.dataTable thead th {
  background: #f8fafc !important;
  color: #475569 !important;
  font-size: 0.74rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  border: none !important;
  padding: 12px 12px !important;
  white-space: nowrap;
}

table.dataTable thead th:first-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

table.dataTable thead th:last-child {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

table.dataTable tbody tr {
  background: #ffffff !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02) !important;
  transition: var(--v18-transition) !important;
}

table.dataTable tbody tr:hover {
  background: #faf5ff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.06) !important;
}

table.dataTable tbody td {
  padding: 12px !important;
  vertical-align: middle !important;
  border-top: 1px solid #f1f5f9 !important;
  border-bottom: 1px solid #f1f5f9 !important;
  font-size: 0.875rem !important;
  color: #334155 !important;
}

table.dataTable tbody td:first-child {
  border-left: 1px solid #f1f5f9 !important;
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
}

table.dataTable tbody td:last-child {
  border-right: 1px solid #f1f5f9 !important;
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
}

.dt-search input, .dataTables_filter input {
  border-radius: 9999px !important;
  border: 1px solid #cbd5e1 !important;
  padding: 8px 18px !important;
  font-size: 0.875rem !important;
  outline: none !important;
  transition: var(--v18-transition) !important;
  background-color: #ffffff !important;
}

.dt-search input:focus, .dataTables_filter input:focus {
  border-color: #7c3aed !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15) !important;
}

/* File Upload Drag & Drop Area */
.v18-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 20px;
  padding: 32px 20px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: var(--v18-transition);
  position: relative;
}

.v18-dropzone:hover, .v18-dropzone.dragover {
  border-color: #7c3aed;
  background: #f5f3ff;
}

.v18-dropzone input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.v18-dropzone-icon {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  background: #ede9fe;
  color: #7c3aed;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 12px;
}

/* Modal styling */
.modal-content {
  border-radius: 24px !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25) !important;
  overflow: hidden;
}

.modal-header {
  border-bottom: 1px solid #f1f5f9 !important;
  padding: 20px 24px !important;
  background: #f8fafc;
}

.modal-footer {
  border-top: 1px solid #f1f5f9 !important;
  padding: 16px 24px !important;
  background: #f8fafc;
}

/* Smooth fade-in animation */
.animate-fade-in {
  animation: v18FadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: opacity, transform;
}

/* Tôn trọng người dùng tắt hiệu ứng, và giảm tải trên điện thoại */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
@media (max-width: 991px) {
  /* backdrop-filter rất nặng trên mobile: dùng nền đặc */
  #header, .sidebar {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background-color: rgba(255, 255, 255, 0.98) !important;
  }
}

/* Trạng thái đang gửi form */
form.is-submitting button[type="submit"] {
  pointer-events: none;
  opacity: 0.65;
}

@keyframes v18FadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
