/* ============================================================
   Resume Builder Page Styles
   Enhanced UI with modern design patterns
   ============================================================ */

/* ============================================================
   Page Layout & Header
   ============================================================ */

.resume-builder-page {
  max-width: 1200px;
  margin: 0 auto;
}

.resume-builder-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  gap: 20px;
}

.resume-builder-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.resume-builder-title h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.resume-builder-title h1::before {
  content: '';
  display: inline-flex;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  border-radius: var(--radius-md);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3C/svg%3E");
  mask-size: 20px;
  -webkit-mask-size: 20px;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-position: center;
}

.resume-builder-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0;
}

/* ============================================================
   Upload Drop Zone - Enhanced with gradient and badges
   ============================================================ */

.resume-upload-area {
  position: relative;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  background: linear-gradient(180deg, var(--color-bg-page) 0%, rgba(15, 118, 110, 0.02) 100%);
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 32px;
  overflow: hidden;
}

.resume-upload-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.03) 0%, transparent 50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.resume-upload-area:hover {
  border-color: var(--color-primary);
  background: linear-gradient(180deg, var(--color-primary-bg) 0%, rgba(15, 118, 110, 0.05) 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.resume-upload-area:hover::before {
  opacity: 1;
}

.resume-upload-area.drag-over {
  border-color: var(--color-primary);
  border-style: solid;
  background: var(--color-primary-bg);
  transform: scale(1.01);
}

.resume-upload-area .upload-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  border-radius: 50%;
  color: white;
  transition: transform 0.25s ease;
}

.resume-upload-area:hover .upload-icon {
  transform: scale(1.05);
}

.resume-upload-area .upload-icon svg {
  width: 32px;
  height: 32px;
}

.resume-upload-area .upload-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 8px;
}

.resume-upload-area .upload-subtext {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0 0 20px;
}

/* Format Badges */
.upload-formats {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.format-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all 0.15s ease;
}

.format-badge svg {
  width: 14px;
  height: 14px;
  color: var(--color-primary);
}

.resume-upload-area:hover .format-badge {
  border-color: var(--color-primary-light);
  background: var(--color-primary-bg);
}

/* Upload Progress */
.upload-progress {
  margin-top: 24px;
  padding: 0 20px;
}

/* Hide default upload elements when uploading */
.resume-upload-area.uploading .upload-icon,
.resume-upload-area.uploading .upload-text,
.resume-upload-area.uploading .upload-subtext,
.resume-upload-area.uploading .upload-formats {
  display: none;
}

.resume-upload-area.uploading {
  padding: 40px 20px;
}

/* Progress Steps */
.upload-progress-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  position: relative;
}

/* Connection line between steps */
.upload-progress-steps::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 40px;
  right: 40px;
  height: 2px;
  background: var(--color-border);
  z-index: 0;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 1;
  position: relative;
}

.progress-step .step-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-bg-elevated);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.progress-step .step-icon svg {
  color: var(--color-text-muted);
  transition: all 0.3s ease;
}

.progress-step span {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.3s ease;
}

/* Active step */
.progress-step.active .step-icon {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
  animation: stepPulse 1.5s ease-in-out infinite;
}

.progress-step.active .step-icon svg {
  color: var(--color-primary);
}

.progress-step.active span {
  color: var(--color-primary);
}

@keyframes stepPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.3);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(79, 70, 229, 0);
  }
}

/* Completed step */
.progress-step.completed .step-icon {
  border-color: var(--color-success);
  background: var(--color-success);
}

.progress-step.completed .step-icon svg {
  color: white;
}

.progress-step.completed span {
  color: var(--color-success);
}

/* Progress Bar */
.upload-progress .progress-bar {
  height: 6px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 8px;
}

.upload-progress .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  width: 0%;
  transition: width 0.5s ease;
}

/* Progress Text */
.upload-progress .progress-text {
  margin-top: 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  text-align: center;
}

.upload-progress .progress-subtext {
  margin-top: 4px;
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
}

/* Mobile: Stack steps vertically or simplify */
@media (max-width: 480px) {
  .upload-progress-steps {
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
  }

  .upload-progress-steps::before {
    display: none;
  }

  .progress-step {
    flex: 0 0 auto;
  }

  .progress-step .step-icon {
    width: 32px;
    height: 32px;
  }

  .progress-step .step-icon svg {
    width: 16px;
    height: 16px;
  }

  .progress-step span {
    font-size: 11px;
  }
}

/* ============================================================
   Resume Cards Grid
   ============================================================ */

.resume-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* ============================================================
   Resume Card - Enhanced with accent bar and hover effects
   ============================================================ */

.resume-card {
  position: relative;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
}

/* Top accent bar - appears on hover */
.resume-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.resume-card:hover::before {
  transform: scaleX(1);
}

.resume-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

/* Default resume styling */
.resume-card.is-default {
  border-color: var(--color-primary);
  background: linear-gradient(180deg, var(--color-primary-bg) 0%, var(--color-bg-card) 100%);
}

.resume-card.is-default::before {
  transform: scaleX(1);
}

.resume-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

.resume-card-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  line-height: 1.3;
}

.resume-default-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.resume-card-role {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0 0 4px;
}

.resume-card-name-sub {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0 0 8px;
}

.resume-card-updated {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 0 0 4px;
}

.resume-card-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--color-text-muted);
  margin: 0;
}

.resume-card-source svg {
  width: 12px;
  height: 12px;
}

/* Card Actions - Icon buttons with dropdown */
.resume-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-light);
  position: relative;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-bg);
}

.btn-icon.btn-icon-danger:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
  background: #FEF2F2;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
}

/* Icon spans using CSS masks */
.btn-icon span[class^="icon-"] {
  display: block;
  width: 18px;
  height: 18px;
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.icon-edit {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E");
}

.icon-download {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E");
}

.icon-star {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/%3E%3C/svg%3E");
}

.icon-trash {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3C/svg%3E");
}

/* Dropdown Menu */
.resume-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
}

.resume-dropdown-menu button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  text-align: left;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s ease;
}

.resume-dropdown-menu button:hover {
  background: var(--color-bg-hover);
}

.resume-dropdown-menu button.danger {
  color: var(--color-danger);
}

.resume-dropdown-menu button.danger:hover {
  background: #FEF2F2;
}

/* ============================================================
   Empty State
   ============================================================ */

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: var(--color-bg-card);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
}

.empty-state svg {
  color: var(--color-text-muted);
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 8px;
}

.empty-state p {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   Resume Editor Page
   ============================================================ */

.resume-editor-page {
  max-width: 900px;
  margin: 0 auto;
}

.resume-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: var(--color-bg-page);
  z-index: 10;
  padding-top: 4px;
  margin-top: -4px;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  border-radius: var(--radius);
}

.btn-back:hover {
  color: var(--color-primary);
  background: var(--color-primary-bg);
}

.resume-editor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.default-badge-large {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
}

/* ============================================================
   Resume Sections - Collapsible Accordion Style
   ============================================================ */

.resume-section {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.resume-section:hover {
  border-color: var(--color-primary-light);
}

.resume-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}

.resume-section-header:hover {
  background: var(--color-bg-hover);
}

.resume-section-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

/* Section Icons */
.section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--color-primary-bg);
  border-radius: var(--radius);
  color: var(--color-primary);
  flex-shrink: 0;
}

.section-icon svg {
  width: 16px;
  height: 16px;
}

/* Item Count Badge */
.section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--color-bg-page);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* Section Toggle Chevron */
.section-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--color-text-muted);
  transition: transform 0.25s ease;
}

.resume-section.collapsed .section-toggle {
  transform: rotate(-90deg);
}

/* Section Content */
.resume-section-content {
  padding: 0 20px 20px;
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.25s ease;
  opacity: 1;
}

.resume-section.collapsed .resume-section-content {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

/* Section Header Actions */
.section-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-elevated);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-add:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-bg);
}

.btn-add svg {
  width: 14px;
  height: 14px;
}

/* ============================================================
   Form Styling
   ============================================================ */

.resume-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-group {
  margin-bottom: 0;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  background: var(--color-bg);
  color: var(--color-text);
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-muted);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

/* Checkbox group */
.checkbox-group {
  display: flex;
  align-items: center;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-text);
  cursor: pointer;
  margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

/* ============================================================
   Resume Items (Experience, Education, etc.)
   ============================================================ */

.resume-item {
  position: relative;
  padding: 16px;
  background: var(--color-bg-page);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.resume-item:last-child {
  margin-bottom: 0;
}

.resume-item:hover {
  border-color: var(--color-primary-light);
  background: var(--color-bg-elevated);
}

.resume-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.resume-item-info {
  flex: 1;
  min-width: 0;
}

.resume-item-info strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.resume-item-info span {
  display: block;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.resume-item-date {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 8px 0 0;
}

.resume-item-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 8px 0 0;
  line-height: 1.5;
}

.resume-item-bullets {
  margin: 12px 0 0;
  padding-left: 18px;
}

.resume-item-bullets li {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 4px;
}

/* Item Actions - Fade in on hover */
.resume-item-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.resume-item:hover .resume-item-actions {
  opacity: 1;
}

/* Empty section text */
.empty-section-text {
  font-size: 14px;
  color: var(--color-text-muted);
  font-style: italic;
  margin: 0;
  padding: 20px;
  text-align: center;
  background: var(--color-bg-page);
  border-radius: var(--radius-md);
}

/* ============================================================
   Modal - Enhanced with backdrop blur and animations
   ============================================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--color-bg-page);
  border-radius: var(--radius);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-close:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.modal-body {
  padding: 24px;
}

.modal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-page);
}

/* ============================================================
   Toast Notifications
   ============================================================ */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  background: var(--color-text);
  color: white;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  transition: transform 0.3s ease;
}

.toast.show {
  transform: translateX(0);
}

.toast-success {
  background: var(--color-success);
}

.toast-error {
  background: var(--color-danger);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-hover) 0%, var(--color-primary) 100%);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
  transform: translateY(-1px);
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--color-bg-elevated);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-bg);
}

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

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--color-bg-elevated);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-danger:hover {
  background: var(--color-danger);
  color: white;
}

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

/* ============================================================
   Mobile Responsive
   ============================================================ */

@media (max-width: 768px) {
  .resume-builder-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .resume-builder-title h1 {
    font-size: 22px;
  }

  .resume-builder-title h1::before {
    width: 28px;
    height: 28px;
  }

  .resume-builder-header .btn-primary {
    width: 100%;
    justify-content: center;
    min-height: var(--touch-target-min);
  }

  .resume-upload-area {
    padding: 32px 20px;
    margin-bottom: 24px;
  }

  .resume-upload-area .upload-icon {
    width: 60px;
    height: 60px;
  }

  .resume-upload-area .upload-icon svg {
    width: 28px;
    height: 28px;
  }

  .resume-cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .resume-card {
    padding: 16px;
  }

  .resume-card-actions {
    flex-wrap: wrap;
  }

  .btn-icon {
    width: var(--touch-target-min);
    height: var(--touch-target-min);
  }

  /* Editor */
  .resume-editor-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    position: relative;
    padding-top: 0;
    margin-top: 0;
  }

  .resume-editor-actions {
    flex-wrap: wrap;
  }

  .resume-editor-actions .btn-primary,
  .resume-editor-actions .btn-secondary {
    flex: 1;
    min-width: calc(50% - 5px);
    justify-content: center;
    min-height: var(--touch-target-min);
  }

  .btn-back {
    align-self: flex-start;
  }

  .resume-section {
    margin-bottom: 12px;
  }

  .resume-section-header {
    padding: 14px 16px;
  }

  .resume-section-content {
    padding: 0 16px 16px;
  }

  .resume-form-grid,
  .modal-form-grid {
    grid-template-columns: 1fr;
  }

  .form-group.full-width {
    grid-column: span 1;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    min-height: var(--touch-target-min);
    font-size: 16px; /* Prevent iOS zoom */
  }

  .resume-item {
    padding: 14px;
  }

  .resume-item-header {
    flex-direction: column;
    gap: 10px;
  }

  .resume-item-actions {
    opacity: 1;
    justify-content: flex-end;
    width: 100%;
  }

  /* Modal - Bottom sheet style */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-content {
    max-height: 90vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-width: 100%;
    animation: modalSlideUp 0.3s ease;
  }

  @keyframes modalSlideUp {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  .modal-body {
    padding: 20px;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer button {
    width: 100%;
    min-height: var(--touch-target-min);
  }

  /* Toast */
  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .resume-builder-title h1 {
    font-size: 20px;
  }

  .resume-card-name {
    font-size: 15px;
  }

  .format-badge {
    font-size: 11px;
    padding: 4px 8px;
  }

  .section-icon {
    width: 24px;
    height: 24px;
  }

  .section-icon svg {
    width: 14px;
    height: 14px;
  }

  .resume-section-header h3 {
    font-size: 14px;
  }

  .btn-add {
    padding: 6px 10px;
    font-size: 12px;
  }
}
