/* ============================================================
   ResumeAI - Smart Resume Analyzer
   Single stylesheet for all pages (beginner-friendly)
   ============================================================ */

/* ---------- CSS Variables (Light & Dark themes) ---------- */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #818cf8;
  --secondary: #06b6d4;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-hero: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 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);
  --nav-height: 70px;
  --radius: 12px;
  --transition: 0.3s ease;
}

/* Dark mode overrides */
body.dark-mode {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth; /* smooth scrolling for anchor links */
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition), color var(--transition);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
}

/* ---------- Navigation Bar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  height: var(--nav-height);
  transition: background var(--transition);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  color: var(--secondary);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.25rem;
  align-items: center;
}

.nav-links a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.35rem 0;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Hamburger menu (mobile) */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text);
  border-radius: 3px;
  transition: var(--transition);
}

/* Theme toggle button */
.theme-toggle {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.theme-toggle:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  opacity: 0.9;
  color: white;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

/* ---------- Main Content Wrapper ---------- */
main {
  flex: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.section-subtitle {
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Hero Section (Home page) ---------- */
.hero {
  background: var(--bg-hero);
  color: white;
  padding: 5rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.hero-content {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  animation: fadeInUp 0.8s ease;
}

.hero p {
  font-size: 1.15rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.4s both;
}

.hero .btn-outline {
  border-color: white;
  color: white;
}

.hero .btn-outline:hover {
  background: white;
  color: var(--primary);
}

/* ---------- Feature Cards ---------- */
.features {
  padding: 4rem 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---------- Generic Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* ---------- Page Header (inner pages) ---------- */
.page-header {
  background: var(--bg-hero);
  color: white;
  padding: 3rem 1.5rem;
  text-align: center;
}

.page-header h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

textarea.form-control {
  min-height: 200px;
  resize: vertical;
  font-family: inherit;
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.35rem;
  display: none;
}

.form-error.show {
  display: block;
}

/* Login box */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - var(--nav-height) - 200px);
  padding: 2rem 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
}

.login-card h2 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.login-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.demo-credentials {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.demo-credentials strong {
  color: var(--text);
}

/* ---------- Dashboard Stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- Progress Bars ---------- */
.progress-section {
  margin-bottom: 1.5rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.progress-bar-bg {
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 6px;
  width: 0%;
  transition: width 1s ease;
}

/* Overall score circle */
.score-display {
  text-align: center;
  margin: 2rem 0;
}

.score-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) var(--score-deg, 0deg), var(--border) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  position: relative;
}

.score-circle::before {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  background: var(--bg-card);
  border-radius: 50%;
}

.score-number {
  position: relative;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
}

/* Suggestions list */
.suggestions-list {
  list-style: none;
}

.suggestions-list li {
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  background: var(--bg);
  border-left: 4px solid var(--primary);
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
}

.suggestions-list li.warning {
  border-left-color: var(--warning);
}

.suggestions-list li.success {
  border-left-color: var(--success);
}

/* ---------- Job Match Cards ---------- */
.company-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
}

.company-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}

.company-logo {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.company-card h3 {
  margin-bottom: 0.25rem;
}

.company-card .match-percent {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0.5rem 0;
}

.match-high { color: var(--success) !important; }
.match-medium { color: var(--warning) !important; }
.match-low { color: var(--danger) !important; }

/* ---------- Tips Page Cards ---------- */
.tip-category {
  margin-bottom: 3rem;
}

.tip-category h2 {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--primary);
  display: inline-block;
}

.tip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: var(--transition);
}

.tip-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
}

.tip-number {
  background: var(--primary);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.tip-card h4 {
  margin-bottom: 0.35rem;
}

.tip-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---------- FAQ Section ---------- */
.faq-section {
  padding: 4rem 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: none;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.faq-question:hover {
  background: var(--bg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  background: var(--bg);
}

.faq-answer p {
  padding: 1rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.faq-item.open .faq-answer {
  max-height: 200px;
}

.faq-icon {
  font-size: 1.2rem;
  transition: transform var(--transition);
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

/* ---------- About Page ---------- */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.about-content img,
.about-placeholder {
  border-radius: var(--radius);
  background: var(--border);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.team-card {
  text-align: center;
  padding: 1.5rem;
}

.team-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1rem;
}

/* ---------- Feedback ---------- */
.feedback-list {
  margin-top: 2rem;
}

.feedback-item {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  background: var(--bg);
}

.feedback-item .meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: none;
}

.alert.show {
  display: block;
  animation: fadeInUp 0.4s ease;
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--success);
  color: var(--success);
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--danger);
  color: var(--danger);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: auto;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer h4 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.footer ul {
  list-style: none;
}

.footer ul li {
  margin-bottom: 0.5rem;
}

.footer ul a {
  color: var(--text-muted);
}

.footer ul a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* ---------- Scroll to Top Button ---------- */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  background: var(--primary-dark);
  transform: translateY(-4px);
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Two-column layout for analyzer */
.analyzer-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.analyzer-input,
.analyzer-results {
  min-width: 0;
}

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.upload-area:hover {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
}

.upload-area input {
  display: none;
}

.hidden {
  display: none !important;
}

/* ---------- Responsive Design ---------- */
@media (max-width: 992px) {
  .analyzer-layout,
  .about-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-card);
    flex-direction: column;
    padding: 1.5rem;
    gap: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links li {
    width: 100%;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .hero h1 {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.6rem;
  }
}

@media (max-width: 480px) {
  .hero-buttons {
    flex-direction: column;
  }

  .hero-buttons .btn {
    width: 100%;
  }
}
