/**
 * /assets/css/group-quests.css
 *
 * Purpose:  Group Quest Board Styling
 *           Quest-Cards, Objectives, Progress, Status-Filter
 * Deps:     app.css (variables), group-timeline.css (participant styles)
 * Load:     index.php
 * Version:  3.0.0 – Quest-Ketten: Locked-Card Styling
 */

/* ============================================================================
   QUEST CARD
   ============================================================================ */
.quest-card {
  position: relative;
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  border: 1px solid rgba(255,255,255,.08);
  border-left: 3px solid var(--quest-color, rgba(77,163,255,.35));
  border-radius: .75rem;
  padding: 1rem;
  margin-bottom: .75rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.quest-card:hover {
  border-color: var(--quest-color, rgba(77,163,255,.5));
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
}
.quest-card-completed {
  opacity: .7;
  border-left-color: rgba(255,211,107,.3);
}
.quest-card-failed {
  opacity: .6;
  border-left-color: rgba(255,107,107,.3);
}

/* ============================================================================
   QUEST CARD HEADER
   ============================================================================ */
.quest-card-header {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.quest-card-icon {
  width: 40px;
  height: 40px;
  border-radius: .6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}
.quest-card-title-wrap {
  flex: 1;
  min-width: 0;
}
.quest-card-title {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
  color: rgba(255,255,255,.95);
  margin-bottom: .25rem;
}
.quest-card-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.quest-card-meta .badge {
  font-size: .65rem;
  font-weight: 500;
}
.quest-status-badge {
  font-size: .6rem !important;
}
.quest-card-actions {
  display: flex;
  gap: .35rem;
  flex-shrink: 0;
}
.quest-card-actions .btn {
  padding: .25rem .5rem;
  font-size: .75rem;
  border-radius: .5rem;
}

/* ============================================================================
   QUEST CARD BODY
   ============================================================================ */
.quest-card-body {
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid rgba(255,255,255,.06);
}
.quest-giver {
  font-size: .8rem;
  color: rgba(255,255,255,.5);
  margin-bottom: .5rem;
}
.quest-giver i {
  color: rgba(255,255,255,.3);
}
.quest-description {
  font-size: .85rem;
  color: rgba(255,255,255,.7);
  line-height: 1.5;
  margin-bottom: .5rem;
}
.quest-reward {
  font-size: .8rem;
  color: var(--gold, #ffd36b);
  display: flex;
  align-items: center;
  gap: .25rem;
  padding: .35rem .6rem;
  background: rgba(255,211,107,.08);
  border-radius: .4rem;
  border: 1px solid rgba(255,211,107,.15);
  display: inline-flex;
}
.quest-reward i {
  font-size: .7rem;
}

/* ============================================================================
   OBJECTIVES
   ============================================================================ */
.quest-objectives {
  margin-top: .75rem;
  padding-top: .5rem;
  border-top: 1px solid rgba(255,255,255,.06);
}
.quest-objectives-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .5rem;
}
.quest-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,.08);
  border-radius: 2px;
  overflow: hidden;
}
.quest-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .3s ease;
}
.quest-objective-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.quest-objective {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .3rem 0;
  font-size: .85rem;
  color: rgba(255,255,255,.8);
}
.quest-objective-done {
  color: rgba(255,255,255,.4);
}
.quest-objective-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,.4);
  padding: 0;
  cursor: pointer;
  font-size: .9rem;
  line-height: 1;
  transition: color .2s ease, transform .15s ease;
  flex-shrink: 0;
  margin-top: .1rem;
}
.quest-objective-toggle:hover {
  color: var(--accent, #5dd6c9);
  transform: scale(1.15);
}
.quest-objective-done .quest-objective-toggle {
  color: var(--accent, #5dd6c9);
}
.quest-objective-check {
  color: rgba(255,255,255,.25);
  font-size: .9rem;
  flex-shrink: 0;
  margin-top: .1rem;
}
.quest-objective-done .quest-objective-check {
  color: var(--accent, #5dd6c9);
}
.quest-objective-text {
  flex: 1;
  line-height: 1.4;
}

/* ============================================================================
   SUBSTEPS
   ============================================================================ */
.quest-substep {
  padding-left: 1.5rem !important;
  font-size: .82rem;
}
.quest-substep .quest-objective-toggle,
.quest-substep-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,.35);
  padding: 0;
  cursor: pointer;
  font-size: .8rem;
  line-height: 1;
  transition: color .2s ease, transform .15s ease;
  flex-shrink: 0;
  margin-top: .1rem;
}
.quest-substep-toggle:hover {
  color: var(--accent, #5dd6c9);
  transform: scale(1.15);
}
.quest-objective-done .quest-substep-toggle {
  color: var(--accent, #5dd6c9);
}
.quest-substep-add-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.2);
  padding: 0 .25rem;
  cursor: pointer;
  font-size: .65rem;
  transition: color .2s;
  flex-shrink: 0;
  margin-left: auto;
}
.quest-substep-add-btn:hover {
  color: var(--accent, #5dd6c9);
}

/* ============================================================================
   NOTES
   ============================================================================ */
.quest-notes-text {
  font-size: .82rem;
  color: rgba(255,255,255,.6);
  line-height: 1.5;
  padding: .4rem .6rem;
  background: rgba(255,255,255,.03);
  border-radius: .35rem;
  border: 1px solid rgba(255,255,255,.06);
}
.quest-notes-edit-btn {
  font-size: .7rem;
  padding: .2rem .5rem;
}

/* ============================================================================
   QUEST ITEMS
   ============================================================================ */
.quest-items .badge {
  font-size: .7rem;
  font-weight: 500;
}

/* ============================================================================
   PARTICIPANTS & COMPLETED INFO
   ============================================================================ */
.quest-participants {
  margin-top: .75rem;
  padding-top: .5rem;
  border-top: 1px solid rgba(255,255,255,.06);
}
.quest-completed-info {
  margin-top: .5rem;
  font-size: .75rem;
  color: rgba(255,255,255,.4);
  padding-top: .5rem;
  border-top: 1px solid rgba(255,255,255,.04);
}

/* ============================================================================
   FILTER BUTTONS
   ============================================================================ */
.quest-status-filter-btn.active,
.quest-cat-filter-btn.active {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.25);
  color: #fff;
}
.quest-cat-filter-btn.active {
  border-color: var(--cat-color);
  color: var(--cat-color);
  background: color-mix(in srgb, var(--cat-color) 12%, transparent);
}
.quest-cat-filter-btn:hover,
.quest-status-filter-btn:hover {
  background: rgba(255,255,255,.08);
}

/* ============================================================================
   FORM STYLING
   ============================================================================ */
#grpQuestAddForm .form-control,
#grpQuestAddForm .form-select {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.9);
  transition: all .3s ease;
}
#grpQuestAddForm .form-control:focus,
#grpQuestAddForm .form-select:focus {
  background: rgba(255,255,255,.08);
  border-color: rgba(93,214,201,.4);
  box-shadow: 0 0 0 .2rem rgba(93,214,201,.15);
  color: rgba(255,255,255,1);
}
#grpQuestAddForm .form-control::placeholder {
  color: rgba(255,255,255,.3);
}
#grpQuestAddForm textarea {
  resize: vertical;
  min-height: 60px;
}
#grpQuestAddForm .input-group-text {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.5);
}

/* ============================================================================
   LIGHT MODE
   ============================================================================ */
[data-bs-theme="light"] .quest-card {
  background: rgba(255,255,255,.7);
  border-color: rgba(0,0,0,.08);
}
[data-bs-theme="light"] .quest-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
[data-bs-theme="light"] .quest-card-title {
  color: #212529;
}
[data-bs-theme="light"] .quest-description {
  color: rgba(0,0,0,.65);
}
[data-bs-theme="light"] .quest-objective {
  color: rgba(0,0,0,.75);
}
[data-bs-theme="light"] .quest-objective-toggle {
  color: rgba(0,0,0,.3);
}
[data-bs-theme="light"] .quest-objective-done .quest-objective-toggle {
  color: #5dd6c9;
}
[data-bs-theme="light"] .quest-giver {
  color: rgba(0,0,0,.5);
}
[data-bs-theme="light"] .quest-completed-info {
  color: rgba(0,0,0,.4);
}
[data-bs-theme="light"] #grpQuestAddForm .form-control,
[data-bs-theme="light"] #grpQuestAddForm .form-select {
  background: rgba(0,0,0,.02);
  border-color: rgba(0,0,0,.1);
  color: #212529;
}
[data-bs-theme="light"] #grpQuestAddForm .form-control:focus,
[data-bs-theme="light"] #grpQuestAddForm .form-select:focus {
  background: #fff;
  border-color: #5dd6c9;
}
[data-bs-theme="light"] #grpQuestAddForm .form-control::placeholder {
  color: rgba(0,0,0,.35);
}
[data-bs-theme="light"] #grpQuestAddForm .input-group-text {
  background: rgba(0,0,0,.03);
  border-color: rgba(0,0,0,.1);
  color: rgba(0,0,0,.5);
}
[data-bs-theme="light"] .quest-status-filter-btn.active,
[data-bs-theme="light"] .quest-cat-filter-btn.active {
  background: rgba(0,0,0,.06);
}
[data-bs-theme="light"] .quest-progress-bar {
  background: rgba(0,0,0,.08);
}
[data-bs-theme="light"] .quest-card-body {
  border-top-color: rgba(0,0,0,.06);
}
[data-bs-theme="light"] .quest-objectives {
  border-top-color: rgba(0,0,0,.06);
}
[data-bs-theme="light"] .quest-reward {
  background: rgba(255,211,107,.12);
  border-color: rgba(255,211,107,.25);
}
[data-bs-theme="light"] .quest-notes-text {
  background: rgba(0,0,0,.02);
  border-color: rgba(0,0,0,.06);
  color: rgba(0,0,0,.55);
}
[data-bs-theme="light"] .quest-substep-add-btn {
  color: rgba(0,0,0,.2);
}
[data-bs-theme="light"] .quest-substep-toggle {
  color: rgba(0,0,0,.25);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 576px) {
  .quest-card {
    padding: .75rem;
  }
  .quest-card-icon {
    width: 34px;
    height: 34px;
    font-size: .9rem;
  }
  .quest-card-title {
    font-size: .9rem;
  }
  .quest-card-actions .btn {
    padding: .2rem .4rem;
    font-size: .7rem;
  }
  .quest-card-header {
    gap: .5rem;
  }
}

/* ============================================================================
   PRINT
   ============================================================================ */
@media print {
  #grpQuestAddForm,
  .quest-card-actions { display: none !important; }
  .quest-card { break-inside: avoid; }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */
/* ============================================================================
   LOCKED QUEST CARD
   ============================================================================ */
.quest-card--locked {
  opacity: .55;
  border-left-color: rgba(255,193,7,.3) !important;
}
.quest-card--locked .quest-card-body,
.quest-card--locked .quest-objectives {
  filter: saturate(.5);
}
.quest-card--locked .quest-card-actions .btn[disabled] {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  .quest-card,
  .quest-progress-fill,
  .quest-objective-toggle {
    transition: none !important;
  }
}
