/* ═══ ResumeForge AI — App Builder Styles ═══ */
@import './variables.css';

/* ═══ App Layout ═══ */
.app-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px var(--space-lg) var(--space-3xl);
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: var(--space-xl);
  min-height: calc(100vh - 120px);
}

@media (max-width: 1024px) {
  .app-layout { grid-template-columns: 1fr; }
}

/* ═══ Panel ═══ */
.app-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.app-form-panel {
  overflow-y: auto;
  max-height: calc(100vh - 120px);
  padding: var(--space-xl);
}

.app-preview-panel {
  position: sticky;
  top: 84px;
  align-self: start;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 140px);
}

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

.panel-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-heading);
}

/* ═══ Form Sections ═══ */
.form-section {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-light);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ═══ Experience Entry ═══ */
.exp-entry {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  position: relative;
}

.exp-entry .remove-exp {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
  font-size: 18px;
  padding: var(--space-xs);
  line-height: 1;
  border-radius: var(--radius-sm);
}

.exp-entry .remove-exp:hover {
  background: var(--error-bg);
}

/* ═══ Template Selector ═══ */
.template-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-sm);
}

.template-option {
  padding: var(--space-md);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--bg-input);
  font-family: var(--font-sans);
}

.template-option:hover {
  border-color: var(--primary-light);
}

.template-option.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.template-preview {
  margin-bottom: var(--space-sm);
}

.template-thumb {
  width: 40px;
  height: 52px;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.template-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.template-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.template-loading {
  grid-column: 1/-1;
  text-align: center;
}

.template-pro .template-thumb {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
}

/* ═══ Preview Panel ═══ */
.preview-loading,
.preview-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-2xl);
  text-align: center;
  color: var(--text-muted);
}

.preview-loading p {
  margin-top: var(--space-sm);
}

.resume-preview-content {
  flex: 1;
  overflow-y: auto;
  background: #fff;
  color: #1e293b;
  min-height: 400px;
}

/* ═══ Responsive ═══ */
@media (max-width: 1024px) {
  .app-preview-panel {
    position: static;
    min-height: 500px;
  }
}
