/* ReviewEarn Admin Panel - Base Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+Bengali:wght@400;500;600;700&display=swap');

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

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-primary);
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-normal);
  display: flex;
  flex-direction: column;
}
.main-content.collapsed { margin-left: var(--sidebar-collapsed); }

.page-content { padding: var(--space-lg); flex: 1; }

/* Header */
.top-header {
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.header-left { display: flex; align-items: center; gap: var(--space-md); }
.header-right { display: flex; align-items: center; gap: var(--space-md); }
.header-title { font-size: var(--text-lg); font-weight: var(--font-semibold); }

.toggle-sidebar-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.toggle-sidebar-btn:hover { background: var(--border-light); color: var(--text-primary); }

/* Page Header */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
}
.page-header h1 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-header-actions { display: flex; gap: var(--space-sm); }

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: var(--text-base); font-weight: var(--font-semibold); }
.card-body { padding: var(--space-lg); }
.card-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-light);
  display: flex; gap: var(--space-sm); justify-content: flex-end;
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: var(--space-md);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.primary::before { background: var(--primary-gradient); }
.stat-card.success::before { background: var(--success-color); }
.stat-card.warning::before { background: var(--warning-color); }
.stat-card.info::before { background: var(--info-color); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.primary { background: #eef2ff; color: var(--primary-color); }
.stat-icon.success { background: var(--success-light); color: var(--success-color); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning-color); }
.stat-icon.info { background: var(--info-light); color: var(--info-color); }

.stat-info { flex: 1; }
.stat-label { font-size: var(--text-sm); color: var(--text-secondary); margin-bottom: 2px; }
.stat-value { font-size: var(--text-2xl); font-weight: var(--font-bold); line-height: 1.2; }
.stat-change { font-size: var(--text-xs); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.stat-change.up { color: var(--success-color); }
.stat-change.down { color: var(--error-color); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: all var(--transition-fast);
  white-space: nowrap;
  line-height: 1.4;
}
.btn-primary { background: var(--primary-gradient); color: #fff; box-shadow: 0 2px 8px rgba(102,126,234,0.35); }
.btn-primary:hover { box-shadow: 0 4px 14px rgba(102,126,234,0.5); transform: translateY(-1px); }
.btn-success { background: var(--success-color); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--error-color); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline {
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--surface);
}
.btn-outline:hover { border-color: var(--primary-color); color: var(--primary-color); }
.btn-sm { padding: 6px 14px; font-size: var(--text-xs); }
.btn-lg { padding: 14px 28px; font-size: var(--text-base); }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-md); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* Form Elements */
.form-group { margin-bottom: var(--space-md); }
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-hint { font-size: var(--text-xs); color: var(--text-muted); margin-top: 4px; }

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-flex; align-items: center; gap: var(--space-sm); cursor: pointer; }
.toggle-switch input { display: none; }
.toggle-slider {
  width: 44px; height: 24px;
  background: var(--border);
  border-radius: var(--radius-full);
  position: relative;
  transition: background var(--transition-fast);
}
.toggle-slider::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.toggle-switch input:checked + .toggle-slider { background: var(--success-color); }
.toggle-switch input:checked + .toggle-slider::after { transform: translateX(20px); }

/* Tables */
.table-container {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-toolbar {
  padding: var(--space-md) var(--space-lg);
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  gap: var(--space-md);
  flex-wrap: wrap;
}
.table-search {
  display: flex; align-items: center;
  background: var(--background);
  border-radius: var(--radius-md);
  padding: 0 var(--space-md);
  border: 1px solid var(--border);
  transition: border-color var(--transition-fast);
}
.table-search:focus-within { border-color: var(--primary-color); }
.table-search input {
  border: none; background: transparent; padding: 8px; outline: none;
  font-size: var(--text-sm); color: var(--text-primary); min-width: 200px;
}
.table-search .icon { color: var(--text-muted); }

table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 12px var(--space-lg);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: var(--background);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 14px var(--space-lg);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
tbody tr { transition: background var(--transition-fast); }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: none; }

.table-pagination {
  padding: var(--space-md) var(--space-lg);
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border-light);
  font-size: var(--text-sm); color: var(--text-secondary);
}

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}
.badge-success { background: var(--success-light); color: #065f46; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-danger { background: var(--error-light); color: #991b1b; }
.badge-info { background: var(--info-light); color: #1e40af; }
.badge-primary { background: #eef2ff; color: #3730a3; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; }
.badge-success .badge-dot { background: var(--success-color); }
.badge-warning .badge-dot { background: var(--warning-color); }
.badge-danger .badge-dot { background: var(--error-color); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; visibility: hidden;
  transition: all var(--transition-normal);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  width: 90%; max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(0.95);
  transition: transform var(--transition-normal);
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: var(--text-lg); font-weight: var(--font-semibold); }
.modal-body { padding: var(--space-lg); }
.modal-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-light);
  display: flex; gap: var(--space-sm); justify-content: flex-end;
}

/* Toast */
.toast-container { position: fixed; top: var(--space-lg); right: var(--space-lg); z-index: 2000; display: flex; flex-direction: column; gap: var(--space-sm); }
.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: var(--space-sm);
  font-size: var(--text-sm);
  min-width: 300px;
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 3.5s forwards;
}
.toast.success { border-left: 4px solid var(--success-color); }
.toast.error { border-left: 4px solid var(--error-color); }
.toast.warning { border-left: 4px solid var(--warning-color); }

@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(50px); } }

/* Empty State */
.empty-state { text-align: center; padding: var(--space-2xl); }
.empty-state .icon { font-size: 3rem; margin-bottom: var(--space-md); opacity: 0.4; }
.empty-state h3 { margin-bottom: var(--space-sm); color: var(--text-secondary); }
.empty-state p { color: var(--text-muted); font-size: var(--text-sm); }

/* Loading */
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary-color); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { position: absolute; inset: 0; background: rgba(255,255,255,0.8); display: flex; align-items: center; justify-content: center; z-index: 10; border-radius: inherit; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border-light); margin-bottom: var(--space-lg); }
.tab-btn {
  padding: 10px 20px;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Filter Chips */
.filter-chips { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.filter-chip {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  background: var(--background);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
}
.filter-chip:hover { border-color: var(--primary-color); color: var(--primary-color); }
.filter-chip.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }

/* User Avatar */
.avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: var(--text-xs); }
.avatar-lg { width: 48px; height: 48px; font-size: var(--text-lg); }

/* Responsive */
@media (max-width: 1024px) {
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-content { padding: var(--space-md); }
  .table-toolbar { flex-direction: column; align-items: stretch; }
}
