/* ---------------------------------------------------
   🌈 Animated Background (Same as Home Page)
--------------------------------------------------- */
.animated-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  background: radial-gradient(circle at 20% 30%, #1c1c33, #0e0e1f);
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.6;
  animation: floatOrbs 10s ease-in-out infinite alternate;
}

.orb-1 { width: 500px; height: 500px; top: 10%; left: 5%; background: radial-gradient(circle, #8e2de2, #4a00e0); animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; top: 40%; left: 60%; background: radial-gradient(circle, #00c9ff, #92fe9d); animation-delay: 2s; }
.orb-3 { width: 350px; height: 350px; top: 70%; left: 30%; background: radial-gradient(circle, #ff6a00, #ee0979); animation-delay: 4s; }

@keyframes floatOrbs {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-50px) translateX(20px); }
}

/* 🌌 Floating particles */
.particles {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: floatParticles 10s linear infinite;
}

@keyframes floatParticles {
  0% { transform: translateY(0) scale(1); opacity: 0.8; }
  50% { opacity: 1; }
  100% { transform: translateY(-100vh) scale(0.5); opacity: 0; }
}

/* ---------------------------------------------------
   ✨ Text Styling (Figma Fonts + Title + Tagline)
--------------------------------------------------- */
.main-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 52px;
  text-align: center;
  margin-top: 60px;
  color: #fff;
  margin-bottom: 15px;
  letter-spacing: 1px;
  text-shadow: 0 3px 8px rgba(0,0,0,0.5);
}

.tagline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  color: #cfcfcf;
  text-align: center;
  margin-bottom: 40px;
  letter-spacing: 0.5px;
}

.wide-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 40px;
  text-align: center;
  color: #fff;
  margin-top: 70px;
  margin-bottom: 30px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* keep other styles below unchanged */
.sidebar, .template-area, .popup {
  position: relative;
  z-index: 2;
}

/* Body: Make full page scrollable (merged with later overrides) */
body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background-image: url('../images/bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: block;
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background-attachment: fixed;
}

/* Sidebar (merged with later width variable) */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-w, 230px);
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
  padding: 30px 20px;
  box-sizing: border-box;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

/* Main content scrolls (merged with later overrides) */
.template-area {
  margin-left: var(--sidebar-w, 220px);
  padding: 40px;
  box-sizing: border-box;
  width: calc(100% - var(--sidebar-w, 220px));
  background: transparent;
  z-index: 2;
  position: relative;
}

/* Resume Grid Area */
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 10px;
  justify-items: center;
}

/* Resume Box */
.template-box {
  background: white;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  transition: transform 0.3s ease;
  width: 100%;
  max-width: 250px;
}

.template-box:hover {
  transform: scale(1.08);
}

.template-box img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.select-btn {
  margin-top: 10px;
  padding: 8px 16px;
  background-color: #28a745;
  color: white;
  border: none;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.select-btn:hover {
  background-color: #218838;
}

/* Scroll Message at the bottom */
.scroll-message {
  text-align: center;
  color: white;
  font-size: 18px;
  font-family: 'Merriweather', serif;
  margin-top: 60px;
  margin-bottom: 40px;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

/* ---------- FINAL POPUP DESIGN ---------- */
.popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup.open {
  display: flex;
  animation: fadeIn 0.25s ease;
}

.popup-content {
  background: #fff;
  border-radius: 12px;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 70%;
  max-width: 850px;
  min-height: 480px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

.popup-left {
  flex: 0 0 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f9f9f9;
  border-right: 1px solid #ddd;
  padding: 10px;
  box-sizing: border-box;
}

.popup-left img {
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: contain;
  border-radius: 8px;
}

.popup-right {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 25px;
  box-sizing: border-box;
  position: relative;
}

.popup-right h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 15px;
  color: #333;
  border-bottom: 2px solid #28a745;
  padding-bottom: 6px;
}

#popup-fields {
  list-style: none;
  padding: 0;
  margin: 0 0 70px 0;
  overflow-y: auto;
  max-height: 330px;
}

#popup-fields li {
  font-size: 16px;
  color: #444;
  margin-bottom: 10px;
  padding-left: 10px;
  border-left: 3px solid #28a745;
}

.final-select-btn {
  position: absolute;
  bottom: 25px;
  left: 25px;
  right: 25px;
  padding: 12px 0;
  font-size: 16px;
  font-weight: bold;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.final-select-btn:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.55);
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

/* 🌟 Wider Resume Boxes Section (2 per row, centered nicely) - merged with later overrides */
.wide-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 60px;
  justify-content: center;
  align-items: start;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  max-width: calc(100% - 80px);
  transform: translateX(20px);
}

/* ✅ Make each resume box wider and balanced - merged with later styling and !important overrides */
.wide-box {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  padding: 15px;
  text-align: center;
  width: 100%;
  max-width: 490px;
  box-sizing: border-box;
  margin: 0 auto;
}

.wide-box:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 35px rgba(102, 126, 234, 0.4);
}

.wide-box img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #bbb;
}

/* ✅ Green select button under each resume - merged with later gradient button style and important overrides */
.wide-box .select-btn {
  margin-top: 12px;
  padding: 8px 22px;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  position: relative;
  overflow: hidden;
}

.wide-box .select-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.wide-box .select-btn:hover::before {
  left: 100%;
}

.wide-box .select-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.6);
}

/* -------------------- 🌟 HEADER TITLES -------------------- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&display=swap');

/* main-title already defined above, but later overrides are merged into the first occurrence (already has larger font-size etc) */
/* wide-title already defined above */

/* -------------------- 🌟 SIDEBAR BUTTONS -------------------- */
.sidebar ul {
  list-style: none;
  padding: 0;
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar li {
  width: 100%;
}

/* Menu button - merged with later purple gradient and effects (first green version replaced) */
.menu-btn {
  width: 100%;
  padding: 14px 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 18px rgba(102, 126, 234, 0.35);
  position: relative;
  overflow: hidden;
}

.menu-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: left 0.5s ease;
}

.menu-btn:hover::before {
  left: 100%;
}

.menu-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.55);
}

.menu-btn:active {
  transform: translateY(1px);
  box-shadow: 0 3px 12px rgba(102, 126, 234, 0.4);
}

/* Template box styling (unified) already applied above via .template-box and .wide-box */
/* Select button styling (global) */
.select-btn {
  padding: 12px 28px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  position: relative;
  overflow: hidden;
}

.select-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.select-btn:hover::before {
  left: 100%;
}

.select-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.6);
}

/* ====== TARGETED LAYOUT FIXES ====== */
:root {
  --sidebar-w: 230px;
}

html, body {
  height: auto;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Footer */
.site-footer {
  position: relative;
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  box-sizing: border-box;
  margin-top: 60px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.7);
}

body > *:last-child {
  margin-top: 0;
}

.section-divider,
.template-grid,
.wide-grid,
.template-box,
.wide-box {
  background: transparent;
}

/* Jobs button */
#jobsBtn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

#jobsBtn:hover {
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.55);
}

/* ================================
   MOBILE OFF-CANVAS SIDEBAR FIX (all mobile overrides merged into single @media block)
   ================================ */
@media (max-width: 768px) {
  .template-area {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 18px 12px 28px !important;
    box-sizing: border-box;
  }

  .site-footer {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .mobile-menu-toggle {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    left: max(14px, env(safe-area-inset-left));
    z-index: 1101;
    width: 46px;
    height: 46px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.35);
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-menu-toggle span {
    width: 22px;
    height: 2.5px;
    border-radius: 2px;
    background: #fff;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

.mobile-menu-toggle.active span:nth-child(1),
.mobile-menu-toggle.active span:nth-child(2),
.mobile-menu-toggle.active span:nth-child(3) {
  transform: none;
  opacity: 1;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.65);
}

  .sidebar-overlay.active {
    display: block;
  }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: min(82vw, 280px);
  height: 100vh;
  padding: 30px 20px;
  background: rgba(10, 10, 25, 0.96);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.45);

  display: flex;
  flex-direction: column;
  align-items: center;

  overflow-y: auto;

  z-index: 1200;

  transform: translateX(-105%);
  transition: transform 0.35s ease;
}

.sidebar.open {
  transform: translateX(0);
}

  .sidebar ul {
    width: 100%;
    gap: 10px;
    padding: 0;
    margin: 0;
  }

  .sidebar li {
    width: 100%;
  }

.menu-btn {
  width: 100%;
  min-height: 46px;
  padding: 12px;
  font-size: 0.95rem;
  border-radius: 12px;
  box-sizing: border-box;

  color: #ffffff !important;
  opacity: 1 !important;

  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

  .main-title {
    font-size: 28px;
    margin-bottom: 10px;
  }

  .wide-title {
    font-size: 22px;
    margin-top: 28px;
    margin-bottom: 12px;
  }

  .tagline {
    font-size: 14px;
    margin-bottom: 18px;
  }

  .template-area > .main-title + .tagline {
    display: none;
    margin: 0;
  }

  .template-area > .main-title {
    margin-bottom: 34px;
  }

  .template-area > .section-divider:first-of-type {
    margin-top: 40px;
    margin-bottom: 30px;
  }

  .ats-grid {
    display: flex;
    justify-content: center;
    overflow: visible;
    padding: 8px 0 18px;
    margin-bottom: 60px;
  }

  .ats-grid .template-box {
    flex: 0 0 68vw;
    min-width: 68vw;
    max-width: 68vw;
    box-sizing: border-box;
  }

  .ats-grid .template-box img {
    width: 100%;
    height: clamp(320px, 110vw, 420px);
    object-fit: cover;
  }

  .professional-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 14px;
    padding: 8px 4px 18px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 60px;
  }

  .professional-grid::-webkit-scrollbar {
    display: none;
  }

  .professional-grid .template-box {
    flex: 0 0 72vw;
    min-width: 72vw;
    max-width: 72vw;
    scroll-snap-align: start;
    box-sizing: border-box;
  }

  .professional-grid .template-box img {
    width: 100%;
    height: clamp(320px, 110vw, 420px);
    object-fit: cover;
  }

  .ats-grid .select-btn,
  .professional-grid .select-btn {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    margin-top: 10px;
  }

  .ats-grid + .section-divider {
    margin-top: 60px;
    margin-bottom: 30px;
  }

  .professional-grid + .section-divider {
    margin-top: 60px;
    margin-bottom: 30px;
  }

  .section-divider + .wide-title {
    margin-top: 40px;
  }

  .template-box {
    flex: 0 0 72vw;
    max-width: 72vw;
    min-width: 72vw;
  }

  .template-box img {
    height: 300px;
    object-fit: cover;
  }

  .wide-box {
    flex: 0 0 90vw;
    max-width: 90vw;
    min-width: 90vw;
  }

  .wide-box img {
    height: 240px;
    object-fit: cover;
  }

  .template-grid {
    margin-bottom: 10px;
  }

  .wide-grid {
    margin-top: 10px;
  }

  .popup-content {
    flex-direction: column;
    width: 92vw;
    max-width: 420px;
    min-height: auto;
  }

  .popup-left {
    width: 100%;
    flex: none;
    border-right: none;
    border-bottom: 1px solid #ddd;
    padding: 10px;
  }

  .popup-left img {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
  }

  .popup-right {
    width: 100%;
    flex: none;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .popup-right h2,
  #popup-fields,
  .popup-right ul,
  .popup-right li {
    display: none;
  }

  .popup-right .final-select-btn {
    display: block;
    position: static;
    width: 100%;
    margin-top: 0;
  }



  .sidebar.open ~ .mobile-overlay {
    pointer-events: auto;
  }
}