:root {
  --primary: #4f46e5;
  --primary-light: #818cf8;
  --primary-dark: #4338ca;
  --secondary: #f43f5e;
  --secondary-light: #fb7185;
  --accent: #0ea5e9;
  --accent-light: #38bdf8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --background: #f8fafc;
  --background-light: #ffffff; 
  --surface: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

body {
  background: var(--background);
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
}

.cv-reviewer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8rem 1.5rem 4rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: #f9fafb;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

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

.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.875rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  width: 100%;
  margin-top: 1rem;
  font-size: 1rem;
}

.submit-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow-sm);
}

.hero-section {
  text-align: center;
  margin-bottom: 3rem;
}

.main-heading {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.sub-heading {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

.upload-section {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 2rem;
  margin-bottom: 3rem;
  border: 1px solid var(--border);
}

.upload-area {
  border: 2px dashed var(--primary-light);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(79, 70, 229, 0.03);
}

.upload-area:hover, .upload-area.dragover {
  background: rgba(79, 70, 229, 0.07);
  border-color: var(--primary);
}

.upload-icon {
  width: 56px;
  height: 56px;
  color: var(--primary);
  margin: 0 auto 1rem;
  stroke-width: 1.5;
}

.upload-area h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.upload-area p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.file-input {
  display: none;
}

.upload-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.upload-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.preview-area {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: var(--background);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.file-icon {
  width: 36px;
  height: 36px;
  color: var(--primary);
  flex-shrink: 0;
}

.file-details h4 {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.1rem;
  font-size: 0.95rem;
  word-break: break-all;
}

.file-details p {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.preview-thumbnail {
  width: 100%;
  max-height: 300px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--border);
  padding: 0.5rem;
}

.preview-thumbnail img,
.preview-thumbnail canvas {
  max-height: 290px;
  max-width: 100%;
  object-fit: contain;
  box-shadow: var(--shadow-sm);
}

.preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 0.5rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  font-size: 0.9rem;
}

.action-btn svg {
  width: 18px;
  height: 18px;
}

.delete-btn {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

.analyze-btn {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}
.analyze-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.analyze-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow-sm);
}

.loading-section {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 3rem 2rem;
  margin-bottom: 3rem;
  text-align: center;
  border: 1px solid var(--border);
}

.loading-content {
  max-width: 500px;
  margin: 0 auto;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(79, 70, 229, 0.2);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

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

.loading-section h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.loading-section p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  min-height: 2.5em; 
}

.results-section {
  background: transparent; 
  padding: 0; 
  margin-bottom: 3rem;
  border: none;
  box-shadow: none;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.score-card {
  display: flex;
  align-items: center;
  justify-content: center; 
  gap: 1rem; 
  padding: 0; 
  background: none; 
  border-radius: 0;
  border: none;
}

.score-circle {
  width: 80px;
  height: 80px;
  position: relative;
}

.score-chart {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-bg {
  fill: none;
  stroke: var(--border); 
  stroke-width: 4; 
}

.score-progress {
  fill: none;
  stroke: url(#scoreGradient);
  stroke-width: 4; 
  stroke-linecap: round;
  transition: stroke-dasharray 1s ease-out; 
}

.score-text {
  font-size: 12px;
  letter-spacing: -0.2px;
  font-weight: 700;
  fill: var(--primary);
  transform: rotate(90deg);
  transform-origin: 18px 18px;
  text-anchor: middle;
  dominant-baseline: middle;
}

.results-breakdown {
  margin-bottom: 1.5rem; 
}

.breakdown-categories {
  display: grid;
  gap: 0.75rem; 
}

.category-item {
  border: none; 
  border-radius: 8px; 
  padding: 0; 
  background: none; 
  transition: none;
}
.category-item:hover {
  box-shadow: none;
  border-color: none;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.3rem; 
}

.category-header h4 {
  font-weight: 500;
  font-size: 0.9rem; 
  color: var(--text-secondary); 
}

.points {
  font-weight: 500; 
  font-size: 0.85rem; 
  color: var(--text-secondary);
}

.category-bar {
  height: 6px;
  background: var(--border); 
  border-radius: 3px;
  overflow: hidden;
}

.category-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary)); 
  transition: width 1s ease-out;
  border-radius: 3px;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.primary-btn, .secondary-btn {
  display: inline-flex; 
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem; 
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid transparent; 
  font-size: 0.95rem;
}

.primary-btn svg, .secondary-btn svg {
  width: 18px;
  height: 18px;
}

.primary-btn {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
}

.primary-btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.secondary-btn {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--primary-light); 
  box-shadow: var(--shadow-sm);
}

.secondary-btn:hover {
  background: rgba(79, 70, 229, 0.05);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tips-section {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 2rem;
  margin-top: 3rem; 
  border: 1px solid var(--border);
}

.tips-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.tip-card {
  background: var(--background);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.tip-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.tip-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.tip-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}

.tip-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.tip-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  flex-grow: 1; 
}

.report-preview{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.4);z-index:1200}
.report-preview-card{background:#fff;border:1px solid var(--border);border-radius:12px;width:min(900px,90vw);height:80vh;display:flex;flex-direction:column;box-shadow:var(--shadow-lg)}
.report-preview-header{padding:1rem;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center}
.report-preview-body{padding:1rem;overflow:auto;background:#f8fafc}
.report-preview-body h1,.report-preview-body h2{color:var(--primary)}
.html2pdf__page-break{height:0;page-break-after:always}

@media (max-width: 768px) {
  .cv-reviewer-container {
    padding: 6rem 1rem 3rem;
  }

  .main-heading {
    font-size: 2rem;
  }

  .sub-heading {
    font-size: 1.1rem;
  }

  .upload-section, .loading-section, .tips-section {
    padding: 1.5rem;
  }

  .upload-area {
    padding: 2rem 1rem;
  }

  .results-header {
    flex-direction: column;
    align-items: center; 
     text-align: center;
  }
  .results-header h2 { font-size: 1.3rem; }

  .tips-grid {
    grid-template-columns: 1fr;
  }

  .tip-card {
    padding: 1.25rem;
  }

   .preview-actions {
       flex-direction: column;
       gap: 0.75rem;
   }
   .action-btn {
       width: 100%;
       justify-content: center;
   }
   .action-buttons {
     flex-direction: column;
   }
   .primary-btn, .secondary-btn {
     width: 100%;
   }
}

@media (max-width: 480px) {
  .main-heading {
    font-size: 1.75rem;
  }

  .form-group {
    margin-bottom: 1rem;
  }

  .form-group input, .form-group select {
    padding: 0.6rem 0.8rem;
    font-size: 0.95rem;
  }

  .submit-btn {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }
  .upload-icon { width: 48px; height: 48px; }
  .upload-area h3 { font-size: 1.1rem; }
  .upload-area p { font-size: 0.9rem; }
  .file-icon { width: 32px; height: 32px; }
  .file-details h4 { font-size: 0.9rem; }
  .action-btn { padding: 0.6rem 1rem; font-size: 0.85rem; }
  .loading-section h3 { font-size: 1.3rem; }
  .tip-card { padding: 1rem; }
  .tip-card h3 { font-size: 0.95rem; }
  .tip-card p { font-size: 0.85rem; }
  .score-text { font-size: 11px; }
}