/* ===================================================================
   Quest Tracker HUD — WoW/Butter-style persistent overlay on map
   =================================================================== */

.qt-hud {
    position: absolute;
    top: calc(var(--header-height, 72px) + env(safe-area-inset-top) + 48px);
    right: 0;
    z-index: 8;
    width: 220px;
    max-width: 50vw;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 10px 0 0 10px;
    border-left: 1px solid rgba(255, 217, 61, 0.15);
    overflow: hidden;
    pointer-events: auto;
    font-family: var(--font-ui, 'Figtree', sans-serif);
    animation: qt-slide-in 250ms ease-out;
}

.qt-hud--empty {
    display: none;
}

/* --- Header --- */
.qt-header {
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 217, 61, 0.2);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.qt-header-title {
    font-family: var(--font-display, 'Archivo Black', sans-serif);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 217, 61, 0.9);
}

.qt-header-chevron {
    color: rgba(255, 217, 61, 0.5);
    font-size: 12px;
    transition: transform 250ms ease;
}

.qt-hud--collapsed .qt-header-chevron {
    transform: rotate(-90deg);
}

/* --- Body --- */
.qt-body {
    padding: 6px 0;
    max-height: calc(100vh - 260px);
    overflow-y: auto;
    transition: max-height 300ms ease, opacity 200ms ease, padding 200ms ease;
}

.qt-hud--collapsed .qt-body {
    max-height: 0;
    opacity: 0;
    padding: 0;
    overflow: hidden;
}

/* --- Quest block --- */
.qt-quest {
    padding: 4px 12px 8px;
}

.qt-quest-title {
    font-family: var(--font-display, 'Archivo Black', sans-serif);
    font-size: 12px;
    color: #FFD93D;
    letter-spacing: 0.01em;
    margin-bottom: 2px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-tap-highlight-color: transparent;
}

.qt-quest-title:active {
    opacity: 0.7;
}

/* --- Objective line --- */
.qt-objective {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    padding: 1px 0 1px 8px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 4px;
}

.qt-objective--done {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: line-through;
}

.qt-obj-check {
    color: #27ae60;
    font-size: 12px;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

.qt-obj-dash {
    color: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

.qt-obj-progress {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: rgba(255, 217, 61, 0.7);
    flex-shrink: 0;
}

.qt-obj-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qt-obj-find {
    margin-left: auto;
    font-size: 8px;
    text-transform: uppercase;
    color: #2980b9;
    background: rgba(41, 128, 185, 0.15);
    border: 1px solid rgba(41, 128, 185, 0.3);
    border-radius: 3px;
    padding: 1px 5px;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.qt-obj-find:active {
    background: rgba(41, 128, 185, 0.3);
}

/* --- Claim row --- */
.qt-claim-row {
    padding: 4px 12px 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.qt-btn-claim {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    animation: qt-claim-pulse 2s infinite;
    -webkit-tap-highlight-color: transparent;
}

.qt-btn-claim:active {
    transform: scale(0.95);
}

.qt-claim-reward {
    font-size: 9px;
    color: rgba(255, 217, 61, 0.7);
}

/* --- Visibility states --- */
.qt-hud--dimmed {
    opacity: 0.2;
    pointer-events: none;
}

.qt-hud--hidden {
    opacity: 0;
    pointer-events: none;
}

/* --- Keyframes --- */
@keyframes qt-slide-in {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

@keyframes qt-claim-pulse {
    0%, 100% { box-shadow: 0 0 4px rgba(39, 174, 96, 0.3); }
    50%      { box-shadow: 0 0 12px rgba(39, 174, 96, 0.6); }
}

/* --- Responsive --- */
@media (max-width: 360px) {
    .qt-hud { width: 180px; }
}

/* --- Suggestion divider --- */
.qt-suggestion-divider {
    height: 1px;
    margin: 4px 12px 2px;
    background: rgba(255, 217, 61, 0.2);
}

/* --- Suggested quest --- */
.qt-quest--suggested {
    opacity: 0.85;
    border-left: 2px solid rgba(255, 217, 61, 0.2);
    padding-left: 10px;
    margin-left: 4px;
}

.qt-quest--suggested .qt-quest-title {
    font-size: 11px;
    color: rgba(255, 217, 61, 0.8);
}

.qt-suggestion-reason {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 217, 61, 0.45);
    font-family: var(--font-display, 'Archivo Black', sans-serif);
    padding-bottom: 1px;
}

/* --- Shadow progress (almost-there) --- */
.qt-shadow-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0 0 8px;
}

.qt-shadow-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.qt-shadow-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #FFD93D, #27ae60);
}

.qt-shadow-pct {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #27ae60;
    flex-shrink: 0;
}

.qt-shadow-detail {
    font-size: 10px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.35);
    padding: 1px 0 0 8px;
}

/* --- Departing countdown --- */
.qt-depart-countdown {
    font-size: 10px;
    color: #e74c3c;
    padding: 1px 0 0 8px;
}

/* --- Task summary --- */
.qt-task-summary {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    padding: 1px 0 0 8px;
}

/* --- Responsive --- */
@media (max-width: 360px) {
    .qt-hud { width: 180px; }
}

@media (min-width: 600px) {
    .qt-hud {
        width: 260px;
        right: 8px;
        border-radius: 10px;
    }
}
