/**
 * RegenCHOICE Question Manager - Styles
 * Last updated: 2026-02-13T14:30
 * Clean, simple design with clear distinction between navigation and actions
 */

/* =============================================================================
   BASE STYLES
   ============================================================================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 30px;
}

/* =============================================================================
   HEADER
   ============================================================================= */

header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #2d5a2d;
}

header h1 {
  color: #2d5a2d;
  font-size: 2em;
  margin-bottom: 5px;
}

header .subtitle {
  color: #666;
  font-size: 1em;
}

/* =============================================================================
   NAVIGATION (Link-style, not buttons)
   ============================================================================= */

nav {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid #ddd;
}

nav .nav-link {
  padding: 12px 24px;
  text-decoration: none;
  color: #666;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  display: inline-block;
}

nav .nav-link:hover {
  color: #2d5a2d;
  background-color: #f9f9f9;
}

nav .nav-link.active {
  color: #2d5a2d;
  border-bottom-color: #2d5a2d;
  font-weight: 600;
}

/* =============================================================================
   ACTION BAR (Buttons for data-changing actions)
   ============================================================================= */

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 6px;
}

.btn-action {
  padding: 10px 20px;
  background-color: #00a5a0;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 0.95em;
  cursor: pointer;
  transition: background-color 0.2s;
  font-weight: 500;
}

.btn-action:hover {
  background-color: #008f8b;
}

/* =============================================================================
   STATUS BAR
   ============================================================================= */

.status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 12px 15px;
  background-color: #f0f0f0;
  border-radius: 5px;
  margin-bottom: 20px;
  font-size: 0.9em;
}

.status-bar strong {
  color: #2d5a2d;
}

.unsaved-indicator {
  color: #d9534f;
  font-weight: bold;
}

.status-message {
  color: #5cb85c;
  font-weight: 500;
}

/* =============================================================================
   VIEWS
   ============================================================================= */

.view {
  display: none;
}

.view.active {
  display: block;
}

.view h2 {
  color: #2d5a2d;
  margin-bottom: 20px;
}

.empty-message {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 1.1em;
}

/* =============================================================================
   QUESTION CARDS
   ============================================================================= */

.question-card {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 15px;
  background-color: #fff;
  transition: box-shadow 0.2s;
}

.question-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.question-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.question-type {
  background-color: #2d5a2d;
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: bold;
}

.question-id {
  color: #666;
  font-size: 0.9em;
}

.question-card h3 {
  color: #333;
  margin: 10px 0;
}

.question-desc {
  color: #666;
  margin: 10px 0;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 15px 0;
  font-size: 0.9em;
  color: #666;
}

.lang-tag {
  background-color: #00a5a0;
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.85em;
  font-weight: 600;
}

.question-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

/* =============================================================================
   BUTTONS
   ============================================================================= */

button {
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background-color: #2d5a2d;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 1em;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: #234523;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 1em;
  transition: background-color 0.2s;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.btn-danger {
  background-color: #d9534f;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.9em;
  transition: background-color 0.2s;
}

.btn-danger:hover {
  background-color: #c9302c;
}

.btn-add {
  background-color: #5cb85c;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.9em;
  transition: background-color 0.2s;
}

.btn-add:hover {
  background-color: #4cae4c;
}

.btn-add-lang {
  background-color: #00a5a0;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85em;
}

.btn-remove-lang {
  background-color: #d9534f;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: bold;
}

/* =============================================================================
   FORMS
   ============================================================================= */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #333;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1em;
  font-family: inherit;
}

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

.form-group small {
  display: block;
  margin-top: 5px;
  color: #666;
  font-size: 0.85em;
}

.form-section {
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 6px;
  margin: 20px 0;
}

.form-section h3 {
  color: #2d5a2d;
  margin-bottom: 15px;
  font-size: 1.1em;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
}

.info-text {
  background-color: #e8f4f8;
  padding: 15px;
  border-radius: 5px;
  border-left: 4px solid #00a5a0;
  color: #333;
}

/* =============================================================================
   LANGUAGE FIELDS
   ============================================================================= */

.lang-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.lang-label {
  min-width: 40px;
  font-weight: bold;
  color: #2d5a2d;
  font-size: 0.9em;
}

.lang-input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.95em;
}

.lang-selector {
  min-width: 200px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9em;
}

.add-lang-row {
  background-color: #f9f9f9;
  padding: 10px;
  border-radius: 4px;
  margin-top: 10px;
}

/* =============================================================================
   ITEM MANAGEMENT
   ============================================================================= */

.items-section {
  margin-top: 20px;
}

.items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.items-header h4 {
  color: #2d5a2d;
}

.item-box {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
  background-color: #fafafa;
}

.item-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

.item-box-header span {
  font-weight: bold;
  color: #2d5a2d;
}

/* =============================================================================
   VALIDATION
   ============================================================================= */

.validation-summary {
  background-color: #e8f4f8;
  padding: 20px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.validation-summary h3 {
  color: #2d5a2d;
  margin-bottom: 10px;
}

.validation-result {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
}

.validation-result.valid {
  border-left: 4px solid #5cb85c;
  background-color: #f4fdf4;
}

.validation-result.invalid {
  border-left: 4px solid #d9534f;
  background-color: #fef5f5;
}

.validation-header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.validation-status {
  margin-left: auto;
  font-weight: bold;
}

.validation-result.valid .validation-status {
  color: #5cb85c;
}

.validation-result.invalid .validation-status {
  color: #d9534f;
}

.error-list {
  list-style: none;
  padding-left: 0;
  margin-top: 10px;
}

.error-list li {
  padding: 5px 0;
  color: #d9534f;
}

.error-list li::before {
  content: "• ";
  font-weight: bold;
}

.validation-success h3 {
  color: #5cb85c;
}

.validation-errors h3 {
  color: #d9534f;
}

/* =============================================================================
   MODALS
   ============================================================================= */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  padding: 30px;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #ddd;
}

.modal-header h2 {
  color: #2d5a2d;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2em;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
}

.modal-close:hover {
  color: #333;
}

.startup-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.startup-option {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 20px;
  text-align: center;
}

.startup-option h3 {
  color: #2d5a2d;
  margin-bottom: 10px;
}

.startup-option p {
  color: #666;
  margin-bottom: 15px;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 15px;
  }

  header h1 {
    font-size: 1.5em;
  }

  nav {
    flex-direction: column;
  }

  .action-bar {
    flex-direction: column;
  }

  .btn-action {
    width: 100%;
  }

  .question-actions {
    flex-direction: column;
  }

  .question-actions button {
    width: 100%;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions button {
    width: 100%;
  }

  .startup-options {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */

.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}
