/* ============================================================
   Executive CV Analyzer - Premium Styles
   Sanajim Technologies © 2026
   ============================================================ */

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --accent-1: #6366f1;
  --accent-2: #8b5cf6;
  --accent-3: #06b6d4;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --radius: 16px;
  --radius-sm: 12px;
}

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

body {
  font-family: 'IBM Plex Sans Arabic', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ============================================================
   Background Effects
   ============================================================ */
.bg-gradient {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
              radial-gradient(ellipse at bottom, rgba(6, 182, 212, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 20s ease-in-out infinite;
}

.bg-orb-1 {
  width: 600px;
  height: 600px;
  background: rgba(99, 102, 241, 0.04);
  top: -200px;
  right: -200px;
  animation-delay: 0s;
}

.bg-orb-2 {
  width: 400px;
  height: 400px;
  background: rgba(139, 92, 246, 0.04);
  bottom: -100px;
  left: -100px;
  animation-delay: -7s;
}

.bg-orb-3 {
  width: 300px;
  height: 300px;
  background: rgba(6, 182, 212, 0.03);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ============================================================
   Glass Components
   ============================================================ */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--glass-shadow);
  transition: all 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.glass-card-sm {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  transition: all 0.3s ease;
}

.glass-card-sm:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

/* ============================================================
   Navigation
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.8rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-icon {
  font-size: 1.4rem;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: white;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* ============================================================
   Container & Pages
   ============================================================ */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 6rem 1.5rem 3rem;
  position: relative;
  z-index: 1;
}

.page {
  display: none;
  animation: fadeIn 0.4s ease;
}

.page.active {
  display: block;
}

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

/* ============================================================
   Hero
   ============================================================ */
.hero-section {
  text-align: center;
  padding: 3rem 0 2rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.2rem;
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--accent-3);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ============================================================
   Upload Section
   ============================================================ */
.upload-section {
  margin: 2rem 0;
}

.upload-area {
  text-align: center;
  padding: 3rem 2rem;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--accent-1);
  background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
  font-size: 3.5rem;
  color: var(--accent-1);
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.upload-area h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

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

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: white;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  border: none;
}

.upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.upload-formats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.upload-formats span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Upload Progress */
.upload-progress {
  padding: 2rem;
}

.progress-bar-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-3));
  width: 0%;
  animation: progressFill 3s ease-in-out;
  border-radius: 2px;
}

@keyframes progressFill {
  0% { width: 0%; }
  30% { width: 30%; }
  60% { width: 60%; }
  90% { width: 90%; }
  100% { width: 100%; }
}

/* ============================================================
   Loading Section
   ============================================================ */
.loading-section {
  text-align: center;
  padding: 3rem;
}

.loading-spinner {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.loading-section h3 {
  margin-bottom: 0.5rem;
}

.loading-section p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.loading-steps {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.loading-step.active {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--accent-1);
}

.loading-step.completed {
  background: rgba(76, 175, 80, 0.1);
  border-color: rgba(76, 175, 80, 0.3);
  color: #4caf50;
}

/* ============================================================
   Error Section
   ============================================================ */
.error-section {
  text-align: center;
  padding: 3rem;
}

.error-icon {
  font-size: 3rem;
  color: #f44336;
  margin-bottom: 1rem;
}

.error-section h3 {
  margin-bottom: 0.5rem;
  color: #f44336;
}

.error-section p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* ============================================================
   Results
   ============================================================ */
.results-card {
  margin-bottom: 1.5rem;
}

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

.results-header h2 {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  border: 2px solid;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.result-stat {
  text-align: center;
  animation: fadeIn 0.4s ease forwards;
}

.result-stat:nth-child(2) { animation-delay: 0.1s; }
.result-stat:nth-child(3) { animation-delay: 0.2s; }
.result-stat:nth-child(4) { animation-delay: 0.3s; }

.result-stat i {
  font-size: 1.5rem;
  color: var(--accent-1);
  margin-bottom: 0.5rem;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.stat-value {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
}

/* Two Column Layout */
.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.column h4 {
  margin-bottom: 1rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.insight-list {
  list-style: none;
}

.insight-list li {
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  position: relative;
  padding-right: 1rem;
}

.insight-list li::before {
  content: '';
  position: absolute;
  right: -0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  border-radius: 2px;
}

#strengthsList li::before {
  background: #4caf50;
}

#gapsList li::before {
  background: #ff9800;
}

/* Fit Scores */
.fit-scores {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fit-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  transition: all 0.3s ease;
}

.fit-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
}

.fit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.fit-title {
  font-weight: 600;
  font-size: 1rem;
}

.fit-score {
  font-weight: 700;
  font-size: 1.3rem;
}

.fit-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.fit-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}

.fit-reason {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Recommendations */
.recommendations-list {
  list-style: none;
}

.recommendations-list li {
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recommendations-list li i {
  color: var(--accent-3);
}

/* Template Selector */
.template-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.template-option {
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.3s ease;
}

.template-option:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.template-option.active {
  border-color: var(--accent-1);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}

.template-option i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--accent-1);
}

.template-option span {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.template-option small {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* CV Result */
.cv-result {
  text-align: center;
  padding: 1.5rem;
  margin-top: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(76, 175, 80, 0.05);
  border: 1px solid rgba(76, 175, 80, 0.2);
}

.cv-result p {
  margin: 0.5rem 0 1rem;
}

/* Jobs Grid */
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.job-card {
  padding: 1.25rem;
}

.job-card:hover {
  transform: translateY(-3px);
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.8rem;
}

.job-header h4 {
  font-size: 1rem;
  font-weight: 600;
}

.job-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-1);
}

.job-company,
.job-location {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.job-company i,
.job-location i {
  width: 1rem;
  margin-left: 0.3rem;
}

.job-reasoning {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0.8rem 0;
  line-height: 1.5;
}

.job-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0.5rem 0;
  line-height: 1.5;
  padding: 0.5rem;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  border-right: 3px solid var(--accent-1);
}

.job-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--accent-3);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}

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

/* ============================================================
   Analyses History Page
   ============================================================ */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.8rem;
}

.analyses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.analysis-card {
  cursor: pointer;
}

.analysis-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.analysis-level {
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-1);
}

.analysis-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.analysis-card h4 {
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  color: var(--text-primary);
}

.analysis-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
}

.analysis-footer {
  display: flex;
  justify-content: flex-end;
}

.analysis-fit {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-3);
}

/* ============================================================
   Best Practices Page
   ============================================================ */
.practices-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.practice-card h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-1);
}

.practice-item {
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.practice-item:last-child {
  border-bottom: none;
}

.practice-item h4 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.practice-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.practice-card ul {
  list-style: none;
}

.practice-card ul li {
  padding: 0.6rem 0;
  padding-right: 1.2rem;
  position: relative;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.practice-card ul li::before {
  content: '•';
  position: absolute;
  right: 0;
  color: var(--accent-1);
}

.practice-example {
  padding: 0.8rem;
  margin-bottom: 0.8rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.example-before {
  font-size: 0.85rem;
  color: #f44336;
  margin-bottom: 0.3rem;
  padding: 0.3rem 0.5rem;
  border-right: 3px solid #f44336;
}

.example-after {
  font-size: 0.85rem;
  color: #4caf50;
  padding: 0.3rem 0.5rem;
  border-right: 3px solid #4caf50;
}

.keywords-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.keyword-tag {
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.8rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--accent-1);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.btn-outline:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
}

.section-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  font-size: 0.9rem;
  z-index: 9999;
  transition: all 0.4s ease;
  opacity: 0;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: rgba(76, 175, 80, 0.9);
  color: white;
  box-shadow: 0 8px 30px rgba(76, 175, 80, 0.3);
}

.toast.error {
  background: rgba(244, 67, 54, 0.9);
  color: white;
  box-shadow: 0 8px 30px rgba(244, 67, 54, 0.3);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-column {
    grid-template-columns: 1fr;
  }

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

  .nav-links {
    gap: 0.2rem;
  }

  .nav-link span {
    display: none;
  }

  .loading-steps {
    flex-direction: column;
    align-items: center;
  }
}
