/* Global Styles */

/* Prevent horizontal scrolling and ensure proper box-sizing */
* {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f9fafb;
  width: 100%;
}

/* App Container */
.app-container {
  min-height: 100vh;
  background-color: #f9fafb;
  overflow-x: hidden;
  width: 100%;
}

/* Top Navigation */
.top-navigation {
  background-color: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 0;
}

.nav-container {
  width: 1200px; /* Match results dashboard width */
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-tabs {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 0;
  cursor: pointer;
  font-size: 16px;
  color: #6b7280;
  transition: all 0.2s ease;
}

.nav-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.nav-tab:hover {
  color: #2563eb;
}

.nav-icon {
  font-size: 16px;
}

.nav-text {
  font-weight: 400;
  letter-spacing: -0.3px;
}

.account-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 6px 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.account-button:hover {
  background-color: #f9fafb;
}

.account-text {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  letter-spacing: -0.15px;
}

.account-icon {
  font-size: 16px;
}

.account-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  min-width: 120px;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #dc2626;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background-color: #fef2f2;
  color: #b91c1c;
}

/* Main Card Container */
.main-card-container {
  width: 1200px; /* Fixed width matching results dashboard */
  margin: 0 auto;
  padding: 24px 20px;
}

.main-card {
  background-color: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  padding: 25px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-title h1 {
  font-size: 20px;
  font-weight: 500;
  color: #111827;
  margin: 0 0 30px 0;
  letter-spacing: -0.45px;
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Results Section */
#resultSection {
  width: 100%;
  min-height: 100vh;
  background-color: #f9fafb;
  padding: 24px 0;
  overflow-x: hidden;
}

/* Results Dashboard */
.results-dashboard {
  width: 1200px; /* Fixed width to accommodate expanded view (400px + 24px + 720px + margins) */
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ====== GLOBAL SPINNER OVERLAY ====== */
.spinner-overlay{position:fixed;inset:0;display:flex;flex-direction:column;gap:12px;align-items:center;justify-content:center;background:rgba(255,255,255,.75);backdrop-filter:blur(2px);z-index:2000}
.spinner-overlay[hidden]{display:none}
.spinner{width:42px;height:42px;border:3px solid #d1d5db;border-top-color:#3b82f6;border-radius:9999px;animation:spin .9s linear infinite}
.spinner-text{font-size:14px;color:#374151}
@keyframes spin{to{transform:rotate(360deg)}}

/* Button loading state (used on analyze) */
.button.loading{pointer-events:none;opacity:.85}
.button.loading::after{content:'';display:inline-block;width:14px;height:14px;margin-left:8px;border:2px solid currentColor;border-right-color:transparent;border-radius:9999px;animation:spin .8s linear infinite;vertical-align:-2px}

/* Coverage Section */
.coverage-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.coverage-header {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  padding: 5px 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 36px;
}

.coverage-header h3 {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #4a5565;
  margin: 0;
  line-height: 16px;
}

.info-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* Coverage Stats */
.coverage-stats {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  padding: 5px 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.coverage-row {
  display: grid;
  grid-template-columns: 1fr 30px 10px 30px 50px;
  align-items: center;
  height: 20px;
  padding: 0;
  gap: 4px;
  border-bottom: 1px solid #e5e7eb;
}

.coverage-row:last-child {
  border-bottom: none;
}

.coverage-pill-name {
  font-size: 12px;
  color: #1e2939;
  font-weight: 400;
  line-height: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coverage-passed {
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  text-align: right;
  color: #1e2939;
  font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
}

.coverage-slash {
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  text-align: center;
  color: #1e2939;
  font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
}

.coverage-total {
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  text-align: right;
  color: #1e2939;
  font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
}

.coverage-percentage {
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  text-align: right;
  color: #1e2939;
  font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
}

/* Resume List Section */
.resume-list-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.list-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 36px;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-controls label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #4a5565;
  line-height: 16px;
}

.sort-dropdown {
  background: #f3f3f5;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 13px;
  height: 36px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #111827;
  cursor: pointer;
  min-width: 144px;
}

.sort-dropdown:focus {
  outline: none;
  border-color: #2563eb;
}

.export-btn {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 6px 11px;
  height: 28px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #111827;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.export-btn:hover {
  background: #f9fafb;
  border-color: rgba(0, 0, 0, 0.15);
}

/* Candidate Cards */
.candidate-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.candidate-card {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.candidate-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  height: 40px;
}

.candidate-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.candidate-avatar {
  width: 40px;
  height: 40px;
  background: #e5e7eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #6b7280;
}

.candidate-details {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

.candidate-name {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #101828;
  line-height: 28px;
  letter-spacing: -0.44px;
  margin: 0;
}

.candidate-scores {
  display: flex;
  gap: 16px;
  margin-left: auto;
  margin-right: 24px;
}

.score-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.score-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #4a5565;
  line-height: 16px;
}

.score-value {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #101828;
  line-height: 20px;
  letter-spacing: -0.15px;
}

.candidate-actions {
  display: flex;
  gap: 4px;
}

.action-btn {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  width: 38px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: #f9fafb;
  border-color: rgba(0, 0, 0, 0.15);
}

.action-btn:last-child {
  flex: 1;
}

/* Candidate Requirements Section */
.candidate-requirements {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.requirements-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 24px;
}

.requirements-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-btn {
  background: none;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  color: #6a7282;
}

.nav-btn:hover:not(:disabled) {
  background: #f3f4f6;
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  color: #9ca3af;
}

.requirements-counter {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #6a7282;
  line-height: 16px;
}

.requirements-stats {
  display: flex;
  gap: 16px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-icon-small {
  width: 16px;
  height: 16px;
  font-size: 12px;
}

.stat-value {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: -0.15px;
}

.stat-value.positive {
  color: #00a63e;
}

.stat-value.negative {
  color: #fb2c36;
}

.requirements-content {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 13px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.requirement-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.requirement-title {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #101828;
  line-height: 20px;
  letter-spacing: -0.15px;
  margin: 0;
}

.requirement-quote {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-style: italic;
  color: #364153;
  line-height: 20px;
  letter-spacing: -0.15px;
  margin: 0;
}

.requirement-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

.score-badge {
  background: #f0fdf4;
  border-radius: 4px;
  padding: 4px 8px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #008236;
  line-height: 16px;
}

.view-all-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #6a7282;
  cursor: pointer;
  padding: 2px 0;
}

.view-all-btn:hover {
  color: #374151;
}
