/* Resume Fraud Detector - Dashboard Styles */

:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #4338ca;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #1e1b4b;
  --bg-sidebar-hover: #312e81;
  --text: #1e293b;
  --text-light: #64748b;
  --text-sidebar: #c7d2fe;
  --text-sidebar-active: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --green: #10b981;
  --green-bg: #ecfdf5;
  --yellow: #f59e0b;
  --yellow-bg: #fffbeb;
  --orange: #f97316;
  --orange-bg: #fff7ed;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.sidebar-header p {
  font-size: 12px;
  color: var(--text-sidebar);
  margin-top: 4px;
  opacity: 0.7;
}

.sidebar-nav {
  padding: 12px 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--text-sidebar);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  user-select: none;
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-sidebar-active);
}

.nav-item.active {
  background: var(--primary);
  color: var(--text-sidebar-active);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Main Content */
.main {
  margin-left: 240px;
  flex: 1;
  min-height: 100vh;
}

.page-header {
  padding: 24px 32px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.page-header h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-header p {
  font-size: 14px;
  color: var(--text-light);
  margin-top: 4px;
}

.page-content {
  padding: 24px 32px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 20px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: -0.02em;
}

.stat-value.green { color: var(--green); }
.stat-value.yellow { color: var(--yellow); }
.stat-value.orange { color: var(--orange); }
.stat-value.red { color: var(--red); }

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--primary);
  background: #eef2ff;
}

.drop-zone svg {
  width: 48px;
  height: 48px;
  color: var(--text-light);
  margin-bottom: 12px;
}

.drop-zone h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.drop-zone p {
  font-size: 13px;
  color: var(--text-light);
}

.drop-zone input[type="file"] {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:disabled {
  background: #a5b4fc;
  cursor: not-allowed;
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-ghost {
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
}

/* Text Preview */
.text-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  max-height: 300px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  font-family: 'SF Mono', 'Fira Code', monospace;
  white-space: pre-wrap;
  margin-top: 12px;
}

/* Score Gauge */
.score-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
}

.gauge-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 8px solid;
  margin-bottom: 12px;
}

.gauge-circle.low { border-color: var(--green); }
.gauge-circle.medium { border-color: var(--yellow); }
.gauge-circle.high { border-color: var(--orange); }
.gauge-circle.very-high { border-color: var(--red); }

.gauge-score {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.gauge-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.gauge-circle.low .gauge-score,
.gauge-circle.low .gauge-label { color: var(--green); }
.gauge-circle.medium .gauge-score,
.gauge-circle.medium .gauge-label { color: var(--yellow); }
.gauge-circle.high .gauge-score,
.gauge-circle.high .gauge-label { color: var(--orange); }
.gauge-circle.very-high .gauge-score,
.gauge-circle.very-high .gauge-label { color: var(--red); }

/* Risk Badge */
.risk-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.risk-badge.low { background: var(--green-bg); color: var(--green); }
.risk-badge.medium { background: var(--yellow-bg); color: var(--yellow); }
.risk-badge.high { background: var(--orange-bg); color: var(--orange); }
.risk-badge.very-high { background: var(--red-bg); color: var(--red); }

/* Similarity Bars */
.similarity-breakdown {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.sim-row {
  display: grid;
  grid-template-columns: 140px 1fr 50px;
  align-items: center;
  gap: 12px;
}

.sim-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
}

.sim-bar-track {
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.sim-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.sim-bar-fill.low { background: var(--green); }
.sim-bar-fill.medium { background: var(--yellow); }
.sim-bar-fill.high { background: var(--orange); }
.sim-bar-fill.very-high { background: var(--red); }

.sim-value {
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}

tr:hover td {
  background: var(--bg);
}

tr.clickable {
  cursor: pointer;
}

/* Input & Form */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}

/* View Sections */
.view {
  display: none;
}

.view.active {
  display: block;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px 48px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.loading-box .spinner {
  width: 32px;
  height: 32px;
  border-color: rgba(79, 70, 229, 0.2);
  border-top-color: var(--primary);
  margin-bottom: 12px;
}

.loading-box p {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
}

/* Claude Analysis Card */
.claude-card {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
}

.claude-card h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.claude-card p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  background: #fff;
  border: 1px solid #c7d2fe;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
}

/* Comparison Card */
.comparison-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.comparison-card-header {
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.comparison-card-header h4 {
  font-size: 14px;
  font-weight: 600;
}

.comparison-card-body {
  padding: 16px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-light);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 16px;
  margin-bottom: 4px;
  color: var(--text);
}

.empty-state p {
  font-size: 13px;
}

/* Responsive */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }
  .sidebar-header h1,
  .sidebar-header p,
  .nav-item span {
    display: none;
  }
  .nav-item {
    justify-content: center;
    padding: 12px;
  }
  .main {
    margin-left: 60px;
  }
  .page-content {
    padding: 16px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 2000;
  animation: slideUp 0.3s ease;
}

.toast.error {
  background: var(--red);
}

.toast.success {
  background: var(--green);
}

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

/* Result detail back button */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
}

.back-link:hover {
  text-decoration: underline;
}

/* Extracted text file info bar */
.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 16px;
}

.file-info .file-name {
  font-size: 14px;
  font-weight: 600;
}

.file-info .file-meta {
  font-size: 12px;
  color: var(--text-light);
}

/* Result analysis panel */
.result-panel {
  margin-top: 24px;
}

.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
