/* =========================================
   ResumeAI Pro — Component Styles
   ========================================= */

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition: all var(--transition-base);
  border: 1.5px solid transparent;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn i, .btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-danger {
  background: linear-gradient(135deg, #F43F5E, #E11D48);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.25);
}

.btn-danger:hover { box-shadow: 0 4px 16px rgba(244, 63, 94, 0.35); transform: translateY(-1px); }

.btn-emerald {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dark)) !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25) !important;
}

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-full { width: 100%; }

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

/* Spinner inside button */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm { width: 14px; height: 14px; border-width: 2px; }

/* === INPUTS === */
.input, .textarea, .select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition-base);
  appearance: none;
  -webkit-appearance: none;
}

.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .input { padding-left: 40px; }
.input-with-icon .input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  width: 16px;
  height: 16px;
  pointer-events: none;
  flex-shrink: 0;
}
.input-with-icon .input-icon-right {
  position: absolute;
  right: 12px;
  color: var(--text-muted);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.form-hint { font-size: 11px; color: var(--text-muted); }

.required { color: var(--rose); margin-left: 2px; }

/* Checkbox custom -->
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] { display: none; }

.checkbox-custom {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.checkbox-group input:checked + .checkbox-custom {
  background: var(--blue);
  border-color: var(--blue);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition-base);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: transform var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider { background: var(--blue); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

/* === CARDS === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.card-p { padding: 20px; }

.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* Glass card */
.card-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

/* === BADGE === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.badge i, .badge svg { width: 11px; height: 11px; }

.badge-blue { background: rgba(37,99,235,0.1); color: var(--blue); }
.badge-emerald { background: rgba(16,185,129,0.1); color: var(--emerald); }
.badge-amber { background: rgba(245,158,11,0.1); color: var(--amber); }
.badge-rose { background: rgba(244,63,94,0.1); color: var(--rose); }
.badge-violet { background: rgba(124,58,237,0.1); color: var(--violet); }
.badge-gray { background: var(--bg-tertiary); color: var(--text-secondary); }

/* === CHIPS === */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: default;
  transition: all var(--transition-fast);
}

.chip i, .chip svg { width: 12px; height: 12px; }

.chip-blue { background: rgba(37,99,235,0.08); color: var(--blue); border-color: rgba(37,99,235,0.2); }
.chip-emerald { background: rgba(16,185,129,0.08); color: var(--emerald); border-color: rgba(16,185,129,0.2); }

.chip-removable { padding-right: 6px; }
.chip-remove {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: currentColor;
  opacity: 0.5;
  transition: all var(--transition-fast);
}
.chip-remove:hover { opacity: 1; background: rgba(0,0,0,0.1); }

/* === TABS === */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 4px;
  width: fit-content;
}

.tab-btn {
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.tab-btn i, .tab-btn svg { width: 14px; height: 14px; }

.tab-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.tab-btn:hover:not(.active) { color: var(--text-primary); background: rgba(0,0,0,0.04); }

/* === PROGRESS BAR === */
.progress-bar {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  overflow: hidden;
}

.progress-thin { height: 5px; }

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-blue { background: linear-gradient(90deg, var(--blue), var(--blue-light)); }
.progress-emerald { background: linear-gradient(90deg, var(--emerald-dark), var(--emerald-light)); }
.progress-amber { background: linear-gradient(90deg, #D97706, var(--amber)); }
.progress-violet { background: linear-gradient(90deg, #6D28D9, var(--violet)); }

/* === SECTION HEADERS === */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* === STAT CARD === */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

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

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon i, .stat-icon svg { width: 18px; height: 18px; }

.stat-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.stat-trend.up { background: rgba(16,185,129,0.1); color: var(--emerald); }
.stat-trend.down { background: rgba(244,63,94,0.1); color: var(--rose); }
.stat-trend i { width: 12px; height: 12px; }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* === ACTIVITY ITEMS === */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

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

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon i, .activity-icon svg { width: 15px; height: 15px; }

.activity-content { flex: 1; min-width: 0; }
.activity-title { font-size: 13px; font-weight: 600; }
.activity-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.activity-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* === EMPTY STATE === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  gap: 8px;
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.empty-icon i { width: 28px; height: 28px; }

.empty-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.empty-desc { font-size: 13px; color: var(--text-secondary); max-width: 320px; line-height: 1.5; }

/* === TOAST === */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  transform: translateX(120%);
  opacity: 0;
  transition: all var(--transition-slow);
  min-width: 280px;
}

.toast.show { transform: translateX(0); opacity: 1; }
.toast.hide { transform: translateX(120%); opacity: 0; }

.toast-success { border-left: 3px solid var(--emerald); }
.toast-error { border-left: 3px solid var(--rose); }
.toast-warning { border-left: 3px solid var(--amber); }
.toast-info { border-left: 3px solid var(--blue); }

.toast-icon { margin-top: 1px; flex-shrink: 0; }
.toast-icon i { width: 18px; height: 18px; }

.toast-body { flex: 1; }
.toast-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.toast-message { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.toast-close {
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}
.toast-close:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.toast-close i { width: 12px; height: 12px; }

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.modal-overlay.active { opacity: 1; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(16px);
  transition: all var(--transition-slow);
}

.modal.active { transform: scale(1) translateY(0); }
.modal.modal-lg { max-width: 680px; }
.modal.modal-xl { max-width: 860px; }

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

.modal-title { font-size: 17px; font-weight: 700; }

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
}
.modal-close-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.modal-close-btn i { width: 16px; height: 16px; }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* === SEARCH BAR === */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  transition: all var(--transition-base);
}

.search-bar:focus-within {
  border-color: var(--blue);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.search-bar i { color: var(--text-muted); width: 16px; height: 16px; flex-shrink: 0; }

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 13px;
  min-width: 0;
}

/* === FILE UPLOAD === */
.file-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--bg-card);
}

.file-upload:hover, .file-upload.drag-over {
  border-color: var(--blue);
  background: rgba(37,99,235,0.02);
}

.file-upload-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(16,185,129,0.1));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: var(--blue);
}
.file-upload-icon i { width: 24px; height: 24px; }

.file-upload-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.file-upload-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.file-upload-types { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }

/* === DATA TABLE === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  color: var(--text-secondary);
}

.data-table tr:hover td { background: var(--bg-secondary); }
.data-table tr:last-child td { border-bottom: none; }

/* === SKILL INPUT === */
.skill-input-area {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  min-height: 48px;
  align-items: center;
  transition: border-color var(--transition-base);
  cursor: text;
}
.skill-input-area:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.skill-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  max-height: 200px;
  overflow-y: auto;
}

.skill-suggestion-item {
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.skill-suggestion-item:hover { background: var(--bg-secondary); color: var(--blue); }

/* === DIVIDER === */
.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.divider-text::before, .divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* === GRID HELPERS === */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

/* === AI GENERATE BUTTON === */
.ai-generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: linear-gradient(135deg, rgba(124,58,237,0.08), rgba(37,99,235,0.08));
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--violet);
  cursor: pointer;
  transition: all var(--transition-base);
}
.ai-generate-btn:hover {
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(37,99,235,0.1));
  border-color: var(--violet);
}
.ai-generate-btn i { width: 13px; height: 13px; }

/* === ACTION CARD === */
.action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: left;
  width: 100%;
}
.action-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.action-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.action-card-icon i { width: 16px; height: 16px; }
.action-card-title { font-size: 13px; font-weight: 700; }
.action-card-desc { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }
