/* ===================================================
   CommentsCollector - Sharpeye Design System & Styles
   =================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  
  --bg-main: #f8fafc;
  --surface: #ffffff;
  --surface-secondary: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --info: #0ea5e9;
  --info-light: #f0f9ff;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.08);

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Background subtle aura */
.bg-decor {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.bg-decor-circle-1 {
  position: absolute;
  top: -100px;
  right: -80px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, rgba(37, 99, 235, 0) 70%);
  border-radius: 50%;
}
.bg-decor-circle-2 {
  position: absolute;
  bottom: -150px;
  left: -100px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.08) 0%, rgba(14, 165, 233, 0) 70%);
  border-radius: 50%;
}

/* Container */
.form-container {
  max-width: 640px;
  margin: 40px auto;
  padding: 0 20px 60px;
}

/* Header */
.form-header {
  text-align: center;
  margin-bottom: 28px;
}
.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
}
.form-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 8px;
}
.form-header p {
  font-size: 15px;
  color: var(--text-muted);
}

/* Card */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  backdrop-filter: blur(16px);
}

/* Form Groups */
.form-group {
  margin-bottom: 22px;
}
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}
.form-label .required {
  color: var(--danger);
  margin-left: 3px;
}
.form-label .sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 6px;
}

/* Category Chips */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.category-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.category-chip:hover {
  border-color: #93c5fd;
  background: #f8fafc;
}
.category-chip input[type="radio"] {
  display: none;
}
.category-chip.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--primary);
}

/* Star Rating */
.star-rating-box {
  display: flex;
  align-items: center;
  gap: 8px;
}
.star-btn {
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: #cbd5e1;
  transition: var(--transition);
  line-height: 1;
  padding: 4px;
}
.star-btn:hover,
.star-btn.active {
  color: #fbbf24;
  transform: scale(1.12);
}
.rating-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 6px;
}

/* Inputs & Textareas */
.form-input,
.form-textarea {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
  font-family: inherit;
}
.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.form-textarea {
  resize: vertical;
  min-height: 110px;
}

/* Upload Area with Paste Support */
.upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-icon {
  font-size: 28px;
  color: #64748b;
  margin-bottom: 6px;
}
.upload-text {
  font-size: 13.5px;
  color: var(--text-main);
  font-weight: 500;
}
.upload-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.upload-dropzone input[type="file"] {
  display: none;
}

/* Image Preview */
.preview-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #f1f5f9;
  border-radius: var(--radius-md);
  margin-top: 10px;
}
.preview-img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.preview-info {
  flex: 1;
  overflow: hidden;
}
.preview-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.preview-size {
  font-size: 11px;
  color: var(--text-muted);
}
.btn-remove-preview {
  background: #fee2e2;
  border: none;
  color: #dc2626;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}
.btn-remove-preview:hover {
  background: #fecaca;
}

/* Submit Button */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: var(--transition);
}
.btn-submit:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}
.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Success Card */
.success-card {
  display: none;
  text-align: center;
  padding: 40px 20px;
}
.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success-light);
  color: var(--success);
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.success-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}
.success-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

/* ===================================================
   Admin Dashboard Styles
   =================================================== */

.admin-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
}
.admin-logo span.tag {
  background: #e0e7ff;
  color: #4338ca;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.admin-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary:hover {
  background: var(--primary-hover);
}

/* Main Dashboard Body */
.admin-main {
  flex: 1;
  padding: 28px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.stat-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
}
.stat-card.pending .stat-value { color: #f59e0b; }
.stat-card.processing .stat-value { color: #3b82f6; }
.stat-card.resolved .stat-value { color: #10b981; }

/* Filter & Action Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  background: #ffffff;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-select {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: #ffffff;
  color: var(--text-main);
}
.search-input {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  min-width: 220px;
}

/* Table Card */
.table-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.table-responsive {
  width: 100%;
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}
.data-table th {
  background: #f8fafc;
  padding: 12px 16px;
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.data-table tr:hover {
  background-color: #fbfcfe;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-bug { background: #fee2e2; color: #dc2626; }
.badge-feature { background: #e0e7ff; color: #4338ca; }
.badge-content { background: #fef3c7; color: #d97706; }
.badge-ui_ux { background: #e0f2fe; color: #0284c7; }
.badge-other { background: #f1f5f9; color: #475569; }

.status-pending { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.status-processing { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.status-resolved { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.status-archived { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }

/* Thumbnail */
.table-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: transform 0.2s;
}
.table-thumb:hover {
  transform: scale(1.15);
}

/* Modal / Lightbox */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active {
  display: flex;
}
.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  padding: 24px;
  position: relative;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.page-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  cursor: pointer;
}
.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 100000;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 640px) {
  .form-card {
    padding: 20px 16px;
  }
  .category-grid {
    grid-template-columns: 1fr 1fr;
  }
  .admin-main {
    padding: 14px;
  }
}
