/* Add this at the very top of style.css */
html, body {
    max-width: 100%;
    overflow-x: hidden; /* This stops the left-to-right shaking */
    margin: 0;
    padding: 0;
    position: relative;
}

.app-shell {
    width: 100%;
    overflow-x: hidden; /* Double shield */
}


/* =====================================================
   GLOBAL BOX MODEL FIX
   Forces all elements to respect their container width
===================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}
/* =====================================================
   DESIGN TOKENS — SINGLE SOURCE OF TRUTH
===================================================== */

:root {
  /* Brand */
  --brand-blue: #0f172a;        /* deep premium navy */
  --brand-blue-soft: #1e293b;  /* hover / panels */

  /* Backgrounds */
  --app-bg: #e5e7eb;           /* light canvas */
  --panel-bg: #ffffff;

  /* Text */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-inverse: #ffffff;

  /* Borders */
  --border-soft: #cbd5e1;
}

/* =====================================================
   BASE PAGE
===================================================== */

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--app-bg);
  color: var(--text-main);
}

/* =====================================================
   APP SHELL
===================================================== */

.app-shell {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  background: #0f172a; 
  min-height: 100vh;
}

/* =====================================================
   MAIN CONTAINER
===================================================== */

.index-container {
  width: 95%;
  max-width: 950px;
  background: var(--panel-bg);
  border-radius: 15px;
  padding: 3rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* =====================================================
   Card Header
===================================================== */

header h1 {
  font-size: 2.5rem;
  color: var(--brand-blue);
  margin-bottom: 0.3rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
}

.tagline {
  color: var(--brand-blue);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}

.form-section h2 {
  font-size: 1.15rem;
  color: var(--brand-blue);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* =====================================================
   FORM INPUTS — HARD LOCK BACKGROUND COLOR
===================================================== */

.form-section input,
.form-section textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;

  background: var(--brand-blue);
  color: #ffffff;

  border: 1px solid var(--brand-blue-soft);
  border-radius: 10px;

  font-size: 0.95rem;

  transition: border-color 0.2s ease;
}

/* Focus state — NO color change */
.form-section input:focus,
.form-section textarea:focus {
  background: var(--brand-blue);
  color: #ffffff;

  border-color: var(--brand-blue-soft);
  outline: none;
}

/* When text is typed (Chrome behavior) */
.form-section input:not(:placeholder-shown),
.form-section textarea:not(:placeholder-shown) {
  background: var(--brand-blue);
  color: #ffffff;
}

/* Chrome autofill override (VERY IMPORTANT) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--brand-blue) inset;
  -webkit-text-fill-color: #ffffff;
  caret-color: #ffffff;
}


/* =====================================================
   BUTTONS
===================================================== */

.delete-btn {
  background: #ef4444 !important;
  border-radius: 4px !important;
  padding: 0.5rem 0.8rem !important;
  font-size: 0.8rem;
  font-weight: 500;
  color: #ffffff;
  border: none;
  cursor: pointer;

  /* ADD THESE TWO LINES FOR THE SPACE */
  display: inline-block; 
  margin-left: 12px; 
  margin-bottom: 12px;
}

.card-header .delete-btn {
  margin-top: 0.75rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
   display: inline-block; 
  margin-left: 12px; 
  margin-bottom: 12px;
}


.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

button {
  background: var(--brand-blue);
  color: var(--text-inverse);

  border: none;
  border-radius: 8px;

  padding: 0.6rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;

  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

button:hover {
  background: var(--brand-blue-soft);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

/* Small action buttons (Add Skill, Add Education) */
button.small {
  padding: 0.7rem 1.4rem;
  font-size: 0.95rem;
}

/* =====================================================
   SECTION SPACING
===================================================== */

.form-section {
  margin-bottom: 2.5rem;
}

.live-preview {
  margin-top: 3rem;
}

/* Remove ALL background from the skill/work/education header */
.card-header {
  display: flex;
  align-items: center;
  gap: 12px;

  background: none;
  padding: 0;
  border-radius: 0;
}

/* Skill level (Beginner / Intermediate / Professional) */
.rating label {
  display: block;
  margin: 6px 0;
  cursor: pointer;
}

/* FORCING the dark theme on the skill dropdown */
select[name="skillLevel"] {
    width: 100%;
    background-color: #0f172a !important; /* Force Navy */
    color: #0f172a !important;            /* Force White Text */
    border: 1px solid #1e293b !important;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
    
    /* This removes the default browser "white" styling */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none; 
}

/* Hover effect: Keeping your glow but ensuring background stays dark */
select[name="skillLevel"]:hover {
  border-color: #00d4ff;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
  background: #0f172a;
}

.index-container input {
  width: 100%;
  background: #0f172a;   /* dark blue */
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

/* FINAL SUMMARY HELPER & SPACING FIX */

/* Desktop spacing */
.summary-helper-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

/* =====================================================
(gate 1 and 2 before dowload) for user agreement and phone no input */

.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: white;
    width: 90%; 
    max-width: 400px;
    padding: 25px;
    border-radius: 12px; /* Rounded corners for premium feel */
    text-align: center;
    color: #000 !important; /* Force black text */
}
.agreement-scroll-box {
    height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
    text-align: left;
    padding: 10px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    line-height: 1.4;
}
.modal-btn {
    width: 100%; padding: 12px;
    background: #ccc; color: white;
    border: none; font-weight: bold;
    cursor: not-allowed;
}
.modal-btn.active {
    background: #000; cursor: pointer;
}
.modal-btn.green-btn {
    background: #28a745; cursor: pointer;
}

.input-group {
    display: flex; 
    border: 1px solid #cbd5e1;
    border-radius: 8px; /* Added rounding */
    margin: 20px 0; 
    overflow: hidden; /* Merges prefix and input */
}

.prefix { 
    padding: 10px 15px; 
    background: #f1f5f9; 
    font-weight: bold; 
    border-right: 1px solid #cbd5e1;
}

#mpesaNumber { 
    border: none; 
    padding: 10px; 
    width: 100%; 
    font-size: 1.1rem; 
    outline: none; 
    background: white !important; /* Prevent it from being dark blue like the builder */
    color: black !important;
}

/* Final Polish for the Modal Cancel Link */
.cancel-link {
    display: block !important;    /* Moves it to its own line so margin-top works */
    margin-top: 25px !important;  /* Creates the space on top */
    color: #dc3545 !important;    /* Makes it a professional red */
    text-align: center !important;
    font-weight: 600 !important;
    text-decoration: underline !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    width: 100% !important;       /* Centers it within the modal content */
}

.cancel-link:hover {
    color: #a71d2a !important;    /* Darkens the red slightly when hovering */
}

/* Makes the skill drawer look like a clean mobile app */
#skillSuggestions {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* Internet Explorer 10+ */
    -webkit-overflow-scrolling: touch;
}

#skillSuggestions::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

select {
    background: #0f172a;
    color: white;
    border: 1px solid #0f172a;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
}

/* ==========================================
   SUMMARY HELPER — MOBILE COMPACT SAFE
========================================== */

.summary-helper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;              /* space between buttons */
}

/* ↓ PASTE THIS INTO style.css ↓ */

.support-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
    position: relative;
}

.support-bubble {
    background: #0f172a;
    color: white;
    border: 1px solid #1e293b;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.support-card {
    position: absolute;
    top: 45px;
    right: 0;
    width: 290px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 9999;
    border: 1px solid #cbd5e1;
}

.support-card.hidden { 
    display: none; 
}

.support-card h3 { 
    color: #0f172a; 
    margin: 0; 
    font-size: 1rem; 
}

.support-card p { 
    font-size: 0.75rem; 
    color: #64748b; 
    margin: 5px 0 10px 0; 
}

.support-card input, 
.support-card textarea {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f8fafc !important;
    color: black !important;
}

.support-card .send-btn {
    width: 100%;
    background: #0f172a;
    color: white;
    border: none;
    padding: 12px;
    margin-top: 10px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.support-card .close-btn {
    width: 100%;
    background: none;
    border: none;
    color: #ef4444;
    margin-top: 5px;
    cursor: pointer;
    font-size: 0.8rem;
}

/* EXECUTIVE PREVIEW BUTTON HOVER */
.preview-btn:hover {
    background: #0f172a !important;
    color: #ffffff !important;
    transform: translateY(-3px);
    box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.3);
}

.preview-btn:active {
    transform: translateY(0);
}

/* ↑ PASTE END ↑ */

/* Phones */
@media (max-width: 600px) {

  .summary-helper::-webkit-scrollbar {
    display: none;
  }

}

/* =====================================================
   MOBILE RESPONSIVENESS
===================================================== */

@media (max-width: 600px) {

  .index-container {
      width: 100%;
      max-width: 100%;
      margin: 0;
      padding: 1rem;
      border-radius: 0;
      min-height: 100vh;
  }

}

  .hero {
      padding: 0.8rem 0 1rem 0;
  }

  .hero h1 {
      font-size: 1.8rem;
      margin-bottom: 0.6rem;
  }

  .hero-box {
      padding: 0.9rem;
      border-radius: 14px;
      font-size: 0.95rem;
      line-height: 1.4;
  }

  @media (max-width: 600px) {
  .index-container {
      width: 100%;
      max-width: 100%;
      margin: 0;
      padding: 1.5rem 1rem;
      border-radius: 14px;
  }

  .form-section {
      margin-top: 1.5rem;
  }

  .form-section h2 {
      margin-bottom: 0.8rem;
  }

  .preview-actions-buttons {
      flex-direction: column;
      gap: 10px;
  }

  .action-btn {
      width: 100%;
      padding: 18px 20px !important;
      font-size: 1.1rem !important;
  }

  button.small {
      padding: 0.7rem 1.3rem !important;
      font-size: 0.92rem !important;
  }

  .app-shell {
      padding: 0 !important;
      align-items: flex-start !important;
  }
}

/* Work helper chips — match skills pills style */
.chip {
    background: #0f172a;
    color: #ffffff;
    border: 1px solid #475569;
    padding: 11px 18px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s ease;
}

.chip:hover {
    background: #334155;
    border-color: #0d9488;
    transform: none;
}

.chip:active {
    background: #0d9488;
    border-color: #0d9488;
    transform: scale(0.95);
}

/* =====================================================
   HERO BANNER
===================================================== */

.hero-banner {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
    margin-bottom: 0;
}

.hero-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.5px;
}

.hero-sub {
    color: #475569;
    font-size: 0.9rem;
    margin: 0 0 1.5rem 0;
}

.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1.5rem;
}

.hero-stat-number {
    font-size: 1.3rem;
    font-weight: 800;
    color: #0f172a;
}

.hero-stat-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 2px;
}

.hero-divider {
    width: 1px;
    height: 35px;
    background: #e2e8f0;
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 1.3rem;
    }
    .hero-stat {
        padding: 0 1rem;
    }
    .hero-stat-number {
        font-size: 1.1rem;
    }
}

/* =====================================================
   COLLAPSIBLE SECTIONS
===================================================== */

.collapsible-section {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: visible;
    margin-bottom: 1.5rem;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    background: #0f172a;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.collapsible-header:hover {
    background: #1e293b;
}

.collapsible-header h3 {
    color: #ffffff;
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.collapsible-header .section-icon {
    font-size: 1rem;
}

.collapsible-arrow {
    color: #94a3b8;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.collapsible-section.open .collapsible-arrow {
    transform: rotate(180deg);
}

.collapsible-body {
    display: none;
    padding: 1.2rem;
    background: #ffffff;
}

.collapsible-section.open .collapsible-body {
    display: block;
}

.collapsible-header .section-tip {
    color: #94a3b8;
    font-size: 0.75rem;
    margin: 2px 0 0 0;
    font-weight: 400;
}

/* =====================================================
   COLLAPSIBLE BODY — DARK INPUTS FIX
===================================================== */

.collapsible-body {
    display: none;
    padding: 1.2rem;
    background: #f8fafc;
}

.collapsible-section.open .collapsible-body {
    display: block;
}

.collapsible-body textarea,
.collapsible-body input[type="text"],
.collapsible-body input[type="email"] {
    background: #0f172a !important;
    color: #ffffff !important;
    border: 1px solid #1e293b !important;
    border-radius: 10px;
    width: 100%;
    padding: 1rem !important;
    margin-bottom: 1rem;
    font-size: 1rem !important;
    box-sizing: border-box;
    display: block;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.collapsible-body textarea {
    min-height: 180px !important;
    resize: vertical;
    line-height: 1.6;
}

.collapsible-body textarea::placeholder,
.collapsible-body input::placeholder {
    color: #64748b !important;
}

.collapsible-body textarea:focus,
.collapsible-body input:focus {
    outline: none !important;
    border-color: #334155 !important;
    background: #0f172a !important;
}

/* ==========================================
   GHOST TEXT SUGGESTION SYSTEM
   ========================================== */

.ghost-wrapper {
    position: relative;
    width: 100%;
}

.ghost-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    color: transparent;
    pointer-events: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: hidden;
    border-radius: 10px;
    box-sizing: border-box;
}

.ghost-overlay .ghost-typed {
    color: transparent;
}

.ghost-overlay .ghost-suggestion {
    color: #475569;
    opacity: 0.5;
}

.ghost-textarea {
    position: relative;
    z-index: 1;
    background: transparent !important;
    caret-color: #ffffff;
}


/* =====================================================
   WIZARD STEP INPUTS — dark styling outside collapsible
===================================================== */

.wizard-step textarea,
.wizard-step input[type="text"],
.wizard-step input[type="email"],
.wizard-step input[type="tel"] {
    background: #0f172a !important;
    color: #ffffff !important;
    border: 1px solid #1e293b !important;
    border-radius: 10px;
    width: 100%;
    padding: 1rem !important;
    margin-bottom: 1rem;
    font-size: 1rem !important;
    box-sizing: border-box;
    display: block;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.wizard-step textarea {
    min-height: 180px !important;
    resize: vertical;
    line-height: 1.6;
}

.wizard-step textarea::placeholder,
.wizard-step input::placeholder {
    color: #64748b !important;
}

.wizard-step textarea:focus,
.wizard-step input:focus {
    outline: none !important;
    border-color: #334155 !important;
    background: #0f172a !important;
}

.wizard-step label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}

/* ADD ITEM BUTTON */
.add-btn {
    background: #1e293b;
    color: #94a3b8;
    border: 1px dashed #334155;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    text-align: center;
    margin-top: 8px;
    transition: all 0.2s;
}

.add-btn:hover {
    background: #334155;
    color: #f8fafc;
    border-color: #475569;
    transform: none;
}

/* ITEM ENTRIES (work, skill, edu etc) */
.item {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}

.item input,
.item textarea,
.item select {
    background: #1e293b !important;
    color: #ffffff !important;
    border: 1px solid #334155 !important;
    border-radius: 8px;
    width: 100%;
    padding: 0.75rem 1rem !important;
    margin-bottom: 8px;
    font-size: 0.9rem !important;
    box-sizing: border-box;
    display: block;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.item input::placeholder,
.item textarea::placeholder {
    color: #475569 !important;
}

.item input:focus,
.item textarea:focus {
    outline: none !important;
    border-color: #475569 !important;
}

.item textarea.desc-field,
.item textarea.project-desc,
.item textarea.extra-desc-field {
    height: 180px !important;
    min-height: 180px !important;
    max-height: 180px !important;
    overflow-y: auto !important;
    resize: none !important;
}

.extra-description-block {
    margin-bottom: 10px;
}

.add-extra-description-btn {
    display: block !important;
    margin-top: 18px !important;
    margin-bottom: 14px !important;
}

.extra-description-delete {
    display: block !important;
    margin: 0 0 12px 0 !important;
    width: fit-content !important;
}

.section-tip {
    font-size: 0.75rem;
    color: #64748b;
    margin: 0;
}
