/**
 * /assets/css/character-events.css
 *
 * Purpose:  Character Events Tab – Live Decisions & Quests from Group
 * Deps:     app.css (variables)
 * Load:     index.php
 * Version:  1.0.0
 */

/* ============================================================================
   EVENT CARD (Decision)
   ============================================================================ */
.char-event-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 rgba(255,193,7,.4);
  border-radius: .75rem;
  padding: 1rem;
  margin-bottom: .75rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.char-event-card:hover {
  border-color: rgba(255,193,7,.6);
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
}

.char-event-header {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .5rem;
}
.char-event-icon {
  width: 40px;
  height: 40px;
  border-radius: .6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
  background: rgba(255,193,7,.15);
  color: #ffc107;
}
.char-event-title-wrap {
  flex: 1;
  min-width: 0;
}
.char-event-title {
  font-weight: 600;
  font-size: 1rem;
  color: rgba(255,255,255,.95);
  margin-bottom: .25rem;
}
.char-event-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.char-event-meta .badge {
  font-size: .65rem;
}
.char-event-desc {
  font-size: .85rem;
  color: rgba(255,255,255,.7);
  line-height: 1.5;
  margin-bottom: .75rem;
  padding-top: .5rem;
  border-top: 1px solid rgba(255,255,255,.06);
}

/* Entities (Monsters / NPCs) */
.char-event-entities {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
}
.char-event-entity {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .6rem;
  border-radius: .4rem;
  font-size: .8rem;
  font-weight: 500;
}
.char-event-entity small {
  opacity: .6;
  font-size: .7rem;
}
.char-event-entity--monster {
  background: rgba(220,53,69,.1);
  border: 1px solid rgba(220,53,69,.25);
  color: #ff6b6b;
}
.char-event-entity--npc {
  background: rgba(77,163,255,.1);
  border: 1px solid rgba(77,163,255,.25);
  color: #4da3ff;
}

/* ============================================================================
   VOTING OPTIONS
   ============================================================================ */
.char-event-options {
  margin-top: .5rem;
}
.char-event-option {
  margin-bottom: .4rem;
}
.char-event-option--selected {
  border-left: 2px solid var(--opt-color, #5dd6c9);
  padding-left: .5rem;
}

/* Vote Button */
.char-event-vote-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .6rem 1rem;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: .5rem;
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.85);
  font-size: .85rem;
  cursor: pointer;
  transition: all .2s;
}
.char-event-vote-btn:hover {
  background: color-mix(in srgb, var(--opt-color, #5dd6c9) 15%, transparent);
  border-color: var(--opt-color, #5dd6c9);
  color: var(--opt-color, #fff);
  transform: translateX(4px);
}
.char-event-vote-btn i {
  color: var(--opt-color, #6c757d);
  width: 20px;
  text-align: center;
}

/* Result bar (after voting) */
.char-event-result {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem 0;
  position: relative;
}
.char-event-result-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,.06);
  border-radius: 3px;
  overflow: hidden;
}
.char-event-result-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .5s ease;
}
.char-event-result-label {
  font-size: .8rem;
  color: rgba(255,255,255,.7);
  white-space: nowrap;
  min-width: 80px;
}
.char-event-result-label i {
  margin-right: .25rem;
}
.char-event-result-count {
  font-size: .75rem;
  color: rgba(255,255,255,.4);
  white-space: nowrap;
}

/* Custom vote form */
.char-event-custom-form .form-control {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.9);
  font-size: .85rem;
}
.char-event-custom-form .form-control:focus {
  background: rgba(255,255,255,.08);
  border-color: rgba(93,214,201,.4);
  box-shadow: 0 0 0 .15rem rgba(93,214,201,.1);
}
.char-event-custom-form .form-control::placeholder {
  color: rgba(255,255,255,.3);
}

/* Voter avatars */
.char-event-voters {
  display: flex;
  gap: .25rem;
  margin-top: .75rem;
  padding-top: .5rem;
  border-top: 1px solid rgba(255,255,255,.06);
}
.char-event-voter-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.15);
  transition: transform .15s;
}
.char-event-voter-avatar:hover {
  transform: scale(1.15);
  border-color: var(--accent, #5dd6c9);
}

/* ============================================================================
   QUEST CARD (in events view)
   ============================================================================ */
.char-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, box-shadow .2s;
}
.char-quest-card:hover {
  border-color: var(--quest-color, rgba(77,163,255,.5));
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
}

.char-quest-header {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .5rem;
}
.char-quest-icon {
  width: 36px;
  height: 36px;
  border-radius: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}
.char-quest-info {
  flex: 1;
  min-width: 0;
}
.char-quest-title {
  font-weight: 600;
  font-size: .95rem;
  color: rgba(255,255,255,.95);
  margin-bottom: .2rem;
}
.char-quest-meta {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.char-quest-meta .badge {
  font-size: .6rem;
}
.char-quest-giver {
  font-size: .8rem;
  color: rgba(255,255,255,.5);
  margin-bottom: .4rem;
}
.char-quest-desc {
  font-size: .85rem;
  color: rgba(255,255,255,.65);
  line-height: 1.4;
  margin-bottom: .5rem;
}

/* Quest Objectives in events view */
.char-quest-objectives {
  margin-top: .5rem;
  padding-top: .5rem;
  border-top: 1px solid rgba(255,255,255,.06);
}
.char-quest-obj-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.char-quest-obj-list li {
  display: flex;
  align-items: flex-start;
  gap: .4rem;
  padding: .2rem 0;
  font-size: .82rem;
  color: rgba(255,255,255,.75);
}
.char-quest-obj-list li i {
  margin-top: .15rem;
  flex-shrink: 0;
  color: rgba(255,255,255,.3);
}
.char-quest-obj--done {
  color: rgba(255,255,255,.35) !important;
  text-decoration: line-through;
}
.char-quest-obj--done i {
  color: var(--accent, #5dd6c9) !important;
}
.char-quest-substep {
  padding-left: 1.2rem !important;
  font-size: .78rem !important;
}

.char-quest-reward {
  font-size: .8rem;
  color: var(--gold, #ffd36b);
  padding: .3rem .5rem;
  background: rgba(255,211,107,.08);
  border-radius: .35rem;
  border: 1px solid rgba(255,211,107,.15);
  display: inline-flex;
  align-items: center;
  margin-top: .5rem;
}
.char-quest-link {
  display: block;
  font-size: .75rem;
  color: rgba(255,255,255,.4);
  text-decoration: none;
  margin-top: .5rem;
  transition: color .2s;
}
.char-quest-link:hover {
  color: var(--accent, #5dd6c9);
}

/* ============================================================================
   LIGHT MODE
   ============================================================================ */
[data-bs-theme="light"] .char-event-card {
  background: rgba(255,255,255,.7);
  border-color: rgba(0,0,0,.08);
}
[data-bs-theme="light"] .char-event-title,
[data-bs-theme="light"] .char-quest-title {
  color: #212529;
}
[data-bs-theme="light"] .char-event-desc,
[data-bs-theme="light"] .char-quest-desc {
  color: rgba(0,0,0,.65);
}
[data-bs-theme="light"] .char-event-vote-btn {
  background: rgba(0,0,0,.02);
  border-color: rgba(0,0,0,.1);
  color: #212529;
}
[data-bs-theme="light"] .char-event-custom-form .form-control {
  background: #fff;
  border-color: rgba(0,0,0,.12);
  color: #212529;
}
[data-bs-theme="light"] .char-quest-card {
  background: rgba(255,255,255,.7);
  border-color: rgba(0,0,0,.08);
}
[data-bs-theme="light"] .char-quest-obj-list li {
  color: rgba(0,0,0,.7);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 576px) {
  .char-event-card,
  .char-quest-card {
    padding: .75rem;
  }
  .char-event-icon {
    width: 34px;
    height: 34px;
    font-size: .9rem;
  }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  .char-event-card,
  .char-quest-card,
  .char-event-vote-btn,
  .char-event-result-fill,
  .char-event-voter-avatar {
    transition: none !important;
  }
}