/* apply.css - Specific UI enhancements for Majlis Forms Hub */

#apply-page-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 6rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.apply-header {
  margin-bottom: 2rem;
}

.back-link-btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background-color: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  margin-bottom: 2rem;
}

.back-link-btn:hover {
  background-color: rgba(200, 150, 12, 0.05);
  color: var(--text-primary);
  border-color: rgba(200, 150, 12, 0.2);
}

.apply-header-desc {
  max-width: 600px;
  margin: 0.5rem auto 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Tabs Bar styling */
.form-tabs-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  background-color: var(--surface-1);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.form-tab-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 1rem 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
}

.form-tab-btn:hover {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}

.form-tab-btn.active {
  background: linear-gradient(135deg, var(--emerald-medium) 0%, var(--emerald-dark) 100%);
  color: var(--text-primary);
  border: 1px solid rgba(16, 185, 129, 0.2);
  box-shadow: var(--shadow-premium);
}

.form-tab-btn .tab-icon {
  font-size: 1.5rem;
}

.form-tab-btn .tab-label {
  font-size: 0.85rem;
}

/* Form Panel Toggling */
.form-content-panel {
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.form-content-panel.active {
  display: block;
}

.panel-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.2rem;
  margin-bottom: 1.5rem;
}

.panel-header h3 {
  font-size: 1.4rem;
  color: var(--gold-primary);
}

.form-section-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold-primary);
  margin: 1.8rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(200, 150, 12, 0.15);
  font-weight: 700;
}

.form-section-title:first-of-type {
  margin-top: 0;
}

.form-actions-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 2.5rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
}

.submit-form-btn {
  margin-top: 0;
  width: auto;
  min-width: 200px;
  padding: 0.8rem 2rem;
  font-size: 0.95rem;
}

/* Form Layout Grids */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.form-group {
  margin-bottom: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  #apply-page-container {
    padding: 1rem 1rem 4rem;
  }
  
  .form-tabs-container {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  
  .form-tab-btn {
    flex-direction: row;
    padding: 0.8rem 1.2rem;
    gap: 1rem;
    justify-content: flex-start;
  }
  
  .form-tab-btn .tab-icon {
    font-size: 1.2rem;
  }
  
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  
  .submit-form-btn {
    width: 100%;
  }
}

/* Lookup and Autofill Badges */
.lookup-badge-container {
  display: block;
  font-size: 0.82rem;
  margin-top: 0.3rem;
  font-family: 'Amiri', serif;
  font-weight: bold;
}
.lookup-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  line-height: 1.4;
}
.lookup-badge-green {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.lookup-badge-orange {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.lookup-badge-blue {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.autofill-badge-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.autofill-indicator {
  display: inline-block;
  font-size: 0.72rem;
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  margin-left: 0.5rem;
  font-family: 'Outfit', sans-serif;
  direction: ltr;
}
.edit-info-btn {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  cursor: pointer;
  margin-left: auto;
  transition: var(--transition-smooth);
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
}
.edit-info-btn:hover {
  background-color: rgba(200, 150, 12, 0.05);
  color: var(--text-primary);
  border-color: rgba(200, 150, 12, 0.2);
}

/* Ensure receipt modal card itself is scrollable on small viewports so buttons are accessible */
#receipt-modal .receipt-card {
  max-height: 90vh;
  overflow-y: auto !important;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

#receipt-modal .receipt-card::-webkit-scrollbar {
  width: 6px;
}

#receipt-modal .receipt-card::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}
