/* ============================================================
   SHEMVARA APP STYLES
   Extends the landing page design language
   ============================================================ */

/* --- App Shell --- */
.app-nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(248, 246, 241, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(200, 168, 78, 0.2);
}

.app-nav .logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.app-nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.app-nav-links a, .app-nav-links button {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.2s;
}

.app-nav-links a:hover, .app-nav-links button:hover {
  color: var(--ink);
  background: var(--paper-warm);
}

.app-nav-links a.active, .app-nav-links button.active {
  color: var(--ink);
  background: var(--paper-warm);
  font-weight: 600;
}

/* --- App Container --- */
.app-container {
  padding: 5.5rem 2rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
  min-height: 100vh;
}

.app-container.wide {
  max-width: 1300px;
}

/* --- Page Header --- */
.page-header {
  margin-bottom: 2.5rem;
}

.page-header .breadcrumb {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.page-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.page-header p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 600px;
}

/* --- Cards --- */
.card {
  background: #fff;
  border: 1px solid rgba(200, 168, 78, 0.15);
  border-radius: 10px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.form-group .hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(200, 168, 78, 0.25);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 168, 78, 0.12);
}

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

.form-group select {
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* --- Dynamic List Fields --- */
.list-field {
  margin-top: 0.5rem;
}

.list-field-item {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: flex-start;
}

.list-field-item input,
.list-field-item textarea {
  flex: 1;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(200, 168, 78, 0.2);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.list-field-item input:focus,
.list-field-item textarea:focus {
  border-color: var(--gold);
}

.list-field-item textarea {
  min-height: 60px;
  resize: vertical;
}

.btn-remove-item {
  padding: 0.5rem;
  border: none;
  background: none;
  color: #ccc;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 0.3rem;
}

.btn-remove-item:hover {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.06);
}

.btn-add-item {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gold);
  background: none;
  border: 1px dashed rgba(200, 168, 78, 0.4);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: center;
}

.btn-add-item:hover {
  background: rgba(200, 168, 78, 0.06);
  border-color: var(--gold);
}

/* --- Buttons --- */
.btn {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  background: var(--ink-muted);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-gold {
  background: var(--gold);
  color: #fff;
}

.btn-gold:hover {
  background: #b89a43;
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(200, 168, 78, 0.3);
}

.btn-outline:hover {
  border-color: var(--gold);
  background: rgba(200, 168, 78, 0.05);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
}

.btn-lg {
  font-size: 1rem;
  padding: 1rem 2.5rem;
}

/* --- Steps Indicator --- */
.steps {
  display: flex;
  gap: 0;
  margin-bottom: 2.5rem;
  position: relative;
}

.step-indicator {
  flex: 1;
  text-align: center;
  position: relative;
  padding-bottom: 1.5rem;
}

.step-indicator::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--paper-warm);
  border-radius: 2px;
}

.step-indicator.active::after {
  background: var(--gold);
}

.step-indicator.completed::after {
  background: var(--ink);
}

.step-number-badge {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.step-indicator.active .step-number-badge {
  color: var(--gold);
}

.step-indicator.completed .step-number-badge {
  color: var(--ink);
}

.step-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.step-indicator.active .step-label {
  color: var(--ink);
  font-weight: 600;
}

.step-indicator.completed .step-label {
  color: var(--ink);
}

/* --- Form Actions --- */
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(200, 168, 78, 0.12);
}

/* --- Dashboard Grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #fff;
  border: 1px solid rgba(200, 168, 78, 0.15);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
}

.stat-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --- Filters Bar --- */
.filters-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filters-bar select {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(200, 168, 78, 0.25);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  outline: none;
}

.filters-bar select:focus {
  border-color: var(--gold);
}

.filter-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* --- Match Cards --- */
.match-card {
  background: #fff;
  border: 1px solid rgba(200, 168, 78, 0.15);
  border-radius: 10px;
  padding: 1.5rem 2rem;
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
  transition: all 0.2s;
  cursor: pointer;
}

.match-card:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 20px rgba(200, 168, 78, 0.08);
}

.match-card.ineligible {
  opacity: 0.6;
}

.match-score {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  flex-shrink: 0;
}

.score-high {
  background: rgba(46, 204, 113, 0.1);
  color: #27ae60;
  border: 2px solid rgba(46, 204, 113, 0.3);
}

.score-medium {
  background: rgba(200, 168, 78, 0.1);
  color: #b89a43;
  border: 2px solid rgba(200, 168, 78, 0.3);
}

.score-low {
  background: rgba(231, 76, 60, 0.08);
  color: #c0392b;
  border: 2px solid rgba(231, 76, 60, 0.2);
}

.match-info h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.match-org {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.match-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.match-tag {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background: var(--paper-warm);
  color: var(--text-muted);
}

.match-tag.prestige-top {
  background: rgba(200, 168, 78, 0.12);
  color: var(--gold);
  font-weight: 600;
}

.match-tag.prestige-high {
  background: rgba(200, 168, 78, 0.08);
  color: #b89a43;
}

.match-tag.eligible {
  background: rgba(46, 204, 113, 0.1);
  color: #27ae60;
}

.match-tag.ineligible {
  background: rgba(231, 76, 60, 0.08);
  color: #c0392b;
}

.match-arrow {
  color: var(--gold);
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* --- Match Detail Modal --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 13, 13, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-content {
  background: var(--paper);
  border-radius: 14px;
  padding: 2.5rem;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.5rem;
  border-radius: 6px;
}

.modal-close:hover {
  background: var(--paper-warm);
  color: var(--ink);
}

/* --- Score Breakdown --- */
.score-breakdown {
  margin-top: 1.5rem;
}

.breakdown-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.breakdown-label {
  font-size: 0.85rem;
  color: var(--text);
  min-width: 140px;
}

.breakdown-bar {
  flex: 1;
  height: 8px;
  background: var(--paper-warm);
  border-radius: 4px;
  overflow: hidden;
}

.breakdown-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.breakdown-fill.high { background: #27ae60; }
.breakdown-fill.medium { background: var(--gold); }
.breakdown-fill.low { background: #e74c3c; }

.breakdown-score {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  min-width: 35px;
  text-align: right;
}

/* --- Profile List --- */
.profile-list {
  display: grid;
  gap: 1rem;
}

.profile-card {
  background: #fff;
  border: 1px solid rgba(200, 168, 78, 0.15);
  border-radius: 10px;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.profile-card:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 20px rgba(200, 168, 78, 0.08);
}

.profile-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.profile-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-card-actions {
  display: flex;
  gap: 0.5rem;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.empty-state p {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Loading --- */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--paper-warm);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Toast Notifications --- */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--ink);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  z-index: 300;
  animation: slideIn 0.3s ease;
}

.toast.success {
  border-left: 3px solid #27ae60;
}

.toast.error {
  border-left: 3px solid #e74c3c;
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
  .app-container { padding: 5rem 1.25rem 2rem; }
  .form-row { grid-template-columns: 1fr; }
  .match-card { grid-template-columns: auto 1fr; }
  .match-arrow { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .filters-bar { flex-direction: column; align-items: stretch; }
  .steps { gap: 0; }
  .step-label { font-size: 0.75rem; }
  .modal-content { padding: 1.5rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .match-card { grid-template-columns: 1fr; text-align: center; }
  .match-score { margin: 0 auto; }
}
