/* Tools layout — shared across cover letter, LinkedIn, interview, tracker */

.tools-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.tools-narrow {
  max-width: 760px;
}

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

.tools-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.tools-sub {
  color: var(--fg-muted);
  font-size: 1rem;
}

.back-link {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.875rem;
  display: inline-block;
  margin-bottom: 12px;
  transition: color 0.2s;
}
.back-link:hover { color: #fff; }

/* Pro gate */
.pro-gate {
  text-align: center;
  padding: 80px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.pro-gate-icon { font-size: 3rem; margin-bottom: 20px; }
.pro-gate h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: #fff;
}
.pro-gate p {
  color: var(--fg-muted);
  max-width: 480px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.empty-icon { font-size: 2.5rem; margin-bottom: 16px; }
.empty-state h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: #fff;
}
.empty-state p { color: var(--fg-muted); margin-bottom: 24px; }

/* Items grid (cover letters list) */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.item-card:hover { border-color: rgba(255,255,255,0.12); }
.item-card-body { padding: 20px; }
.item-card-body h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #fff;
}
.item-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.item-tag {
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 10px;
}
.item-date { color: var(--fg-muted); font-size: 0.8rem; }
.item-card-actions {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid var(--border);
}

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary.btn-full { width: 100%; text-align: center; padding: 14px; font-size: 1rem; }

.btn-secondary {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  padding: 9px 18px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn-secondary:hover { color: #fff; border-color: rgba(255,255,255,0.15); }

.btn-pro {
  background: linear-gradient(135deg, #2c5282, #38a169);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
}

.btn-edit {
  background: rgba(255,255,255,0.06);
  color: var(--fg-muted);
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.btn-edit:hover { background: rgba(255,255,255,0.1); color: #fff; }

.btn-delete {
  background: transparent;
  color: #fc8181;
  border: 1px solid rgba(252,129,129,0.3);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-delete:hover { background: rgba(252,129,129,0.1); }

.btn-danger {
  background: rgba(252,129,129,0.15);
  color: #fc8181;
  border: 1px solid rgba(252,129,129,0.3);
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-display);
}

.btn-delete-outline {
  background: transparent;
  color: #fc8181;
  border: 1px solid rgba(252,129,129,0.3);
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: var(--font-display);
  cursor: pointer;
}

/* Generate form card */
.generate-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  margin-bottom: 8px;
  font-family: var(--font-display);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: rgba(255,255,255,0.2);
}
.form-group select option { background: var(--bg-section); }
.form-group textarea { resize: vertical; min-height: 100px; }

/* Result section */
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.result-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: #fff;
}
.result-text {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  white-space: pre-wrap;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--fg);
}
.result-tips {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(56,161,105,0.1);
  border: 1px solid rgba(56,161,105,0.2);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--fg-muted);
}

/* Cover letter editor */
.cl-name-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  padding: 0 0 12px 0;
  margin-bottom: 20px;
  outline: none;
}
.cl-content-editor {
  width: 100%;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.7;
  resize: vertical;
  outline: none;
}
.cl-editor-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

/* Danger zone */
.danger-zone {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid rgba(252,129,129,0.2);
  border-radius: 8px;
}

/* History */
.history-section {
  margin-top: 40px;
}
.history-section h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.75rem;
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.history-link {
  text-decoration: none;
  transition: border-color 0.2s;
  display: block;
}
.history-link:hover { border-color: rgba(255,255,255,0.12); }
.history-date {
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-bottom: 4px;
}
.history-preview {
  font-size: 0.875rem;
  color: var(--fg);
}

/* Interview questions */
.questions-section {
  margin-top: 32px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: #fff;
}
.question-card {
  display: flex;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 16px;
}
.question-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent);
  min-width: 32px;
}
.question-body { flex: 1; }
.question-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
  font-family: var(--font-display);
}
.question-why {
  font-size: 0.875rem;
  color: var(--fg-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}
.question-answer summary {
  font-size: 0.875rem;
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
  user-select: none;
}
.question-answer[open] summary { margin-bottom: 14px; }
.answer-content {
  font-size: 0.9rem;
  color: var(--fg);
  line-height: 1.6;
  white-space: pre-wrap;
  background: var(--bg-section);
  border-radius: 8px;
  padding: 16px;
}
.answer-tips {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--fg-muted);
}
.answer-tips ul { margin-left: 16px; margin-top: 6px; }
.answer-tips li { margin-bottom: 4px; }

/* Loading state */
.loading-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--fg-muted);
}
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Header actions */
.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}
.modal-box {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: #fff;
}
.modal-close {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Result actions */
.result-actions {
  display: flex;
  gap: 8px;
}

@media (max-width: 768px) {
  .tools-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .tools-header h1 { font-size: 1.5rem; }
  .generate-form-card { padding: 20px; }
  .question-card { flex-direction: column; gap: 8px; }
}
