/* ================================================================
   TASKS (Daily / Weekly) — Military-green dark theme
   Adapted from QuestsPage.tsx Figma design
   ================================================================ */

/* ── Screen container ── */
.tasks-screen {
    background: #0d0f0b;
    min-height: 100%;
}

/* ── Header ── */
.tasks-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 16px 14px;
    border-bottom: 1px solid #2a3020;
}
.tasks-header-icon {
    width: 32px; height: 32px;
    border-radius: 6px;
    background: #3a4a2a;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.tasks-header-text h2 {
    color: #c8d4a0; font-size: 13px; letter-spacing: 0.15em; margin: 0;
}
.tasks-header-text p {
    color: #4a5a30; font-size: 10px; letter-spacing: 0.1em; margin: 2px 0 0;
}
.tasks-timer {
    margin-left: auto;
    display: flex; align-items: center; gap: 6px;
}
.tasks-timer-icon { color: #3a5020; font-size: 14px; }
.tasks-timer-value {
    padding: 4px 8px;
    border-radius: 4px;
    background: #111a08;
    border: 1px solid #2a3a18;
    color: #6a9a30;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}
.tasks-header .btn-close { margin-left: 8px; }

/* ── Tabs ── */
.tasks-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid #2a3020;
    background: #0a0c08;
}
.tasks-tab {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 0;
    background: transparent;
    color: #3a5020;
    border: none; border-bottom: 2px solid transparent;
    font-size: 11px; letter-spacing: 0.12em;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.tasks-tab.active {
    background: #1a2010;
    color: #8fba50;
    border-bottom-color: #6a9a30;
}
.tasks-tab-badge {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #5a9a10;
    color: #fff;
    font-size: 9px;
    display: flex; align-items: center; justify-content: center;
}

/* ── Milestone section ── */
.tasks-milestone-section {
    border-bottom: 1px solid #1a2a10;
    padding-bottom: 12px;
}
.tasks-milestone-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 12px 4px;
}
.tasks-milestone-header-label {
    color: #4a6a20; font-size: 9px; letter-spacing: 0.14em;
}
.tasks-milestone-header-count {
    color: #3a5020; font-size: 10px;
}

/* Track */
.milestone-track {
    position: relative;
    display: flex; align-items: center;
    height: 28px;
    margin: 0 12px;
}
.milestone-track-bg {
    position: absolute;
    left: 0; right: 0;
    height: 4px;
    background: #111a08;
    border-radius: 99px;
    top: 50%; transform: translateY(-50%);
}
.milestone-track-fill {
    position: absolute;
    left: 0;
    height: 4px;
    border-radius: 99px;
    top: 50%; transform: translateY(-50%);
    background: linear-gradient(90deg, #2a5010, #7aaa20);
    transition: width 0.7s ease;
}
.milestone-node {
    position: absolute;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transform: translateX(-50%);
    transition: all 0.5s;
    z-index: 2;
    font-size: 12px;
}
.milestone-node--locked {
    background: #0d0f0b; border: 2px solid #2a3a18; color: #2a3a18;
}
.milestone-node--reached {
    background: #2a5010; border: 2px solid #7aaa20; color: #9adf30;
    box-shadow: 0 0 10px rgba(120,200,20,0.5);
}
.milestone-node--claimed {
    background: #1a2a10; border: 2px solid #3a5a20; color: #3a6a20;
}

/* Milestone cards */
.milestone-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 8px 12px 0;
}
.milestone-card {
    border-radius: 8px;
    padding: 8px;
    display: flex; flex-direction: column; gap: 6px;
    transition: all 0.3s;
}
.milestone-card--locked {
    background: #0a0d07; border: 1px solid #151f0d; opacity: 1;
}
.milestone-card--claimable {
    background: #0f1e08; border: 1px solid #4a7a18;
    box-shadow: 0 0 12px rgba(100,180,20,0.12);
}
.milestone-card--claimed {
    background: #090c07; border: 1px solid #1a2a10; opacity: 0.5;
}
.milestone-card-top {
    display: flex; align-items: center; justify-content: space-between;
}
.milestone-card-req {
    font-size: 9px; letter-spacing: 0.1em;
}
.milestone-card-req--reached { color: #6a9a30; }
.milestone-card-req--locked { color: #2a3a18; }
.milestone-card-done-icon { color: #3a6020; font-size: 12px; }

.milestone-card-reward {
    display: flex; flex-direction: column; gap: 4px;
}
.milestone-reward-row {
    display: flex; align-items: center; gap: 4px;
}
.milestone-reward-row .icon { font-size: 12px; }
.milestone-reward-row .icon--money { color: #c0a020; }
.milestone-reward-row .icon--exp { color: #3080c0; }
.milestone-reward-row .icon--stars { color: #ffd700; }
.milestone-reward-row .icon--locked { color: #2a3a18; }
.milestone-reward-row .val { font-size: 10px; }
.milestone-reward-row .val--money { color: #d0b020; }
.milestone-reward-row .val--exp { color: #4090d0; }
.milestone-reward-row .val--stars { color: #ffd700; }
.milestone-reward-row .val--locked { color: #2a3a18; }

.milestone-claim-btn {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 4px;
    padding: 6px 0;
    border-radius: 4px;
    background: #1e3a10;
    border: 1px solid #5a9a20;
    color: #9adf30;
    font-size: 10px; letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    margin-top: 2px;
}
.milestone-claim-btn:active { transform: scale(0.95); }

.milestone-locked-info {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    padding: 4px 0;
    margin-top: 2px;
}
.milestone-locked-info span {
    color: #1a2a10; font-size: 9px; letter-spacing: 0.06em;
}
.milestone-locked-info .icon { color: #1a2a10; font-size: 12px; }

/* ── Quest list ── */
.tasks-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex; flex-direction: column; gap: 10px;
    padding-bottom: 80px;
}
.tasks-section-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 4px;
}
.tasks-section-header .icon { font-size: 14px; }
.tasks-section-header .label {
    font-size: 9px; letter-spacing: 0.14em;
}
.tasks-section-header .line {
    flex: 1; height: 1px;
}
.tasks-section-header .count { font-size: 9px; }

.tasks-section-header--active .icon { color: #4a7020; }
.tasks-section-header--active .label { color: #4a6a20; }
.tasks-section-header--active .line { background: #1a2a10; }
.tasks-section-header--active .count { color: #2a3a18; }

.tasks-section-header--completed .icon { color: #6aaa20; }
.tasks-section-header--completed .label { color: #6a9a20; }
.tasks-section-header--completed .line { background: #2a3a18; }
.tasks-section-header--completed .count { color: #5a8a20; }

.tasks-section-header--claimed .icon { color: #2a4020; }
.tasks-section-header--claimed .label { color: #2a3a18; }
.tasks-section-header--claimed .line { background: #141e0c; }
.tasks-section-header--claimed .count { color: #2a3a18; }

/* ── Quest card ── */
.task-card {
    border-radius: 12px;
    overflow: hidden;
}
.task-card--active {
    background: #0f1409; border: 1px solid #1e2a14;
}
.task-card--completed {
    background: #0f1409; border: 1px solid #4a7a20;
}
.task-card--claimed {
    background: #090c07; border: 1px solid #141e0c; opacity: 0.5;
}

.task-card-glow {
    height: 1px; width: 100%;
    background: linear-gradient(90deg, transparent, #6aaa20, transparent);
}

.task-card-body {
    display: flex; gap: 12px; padding: 12px;
}

/* Category icon */
.task-cat-icon {
    width: 40px; height: 40px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 18px;
}
.task-cat-icon--combat  { background: #150505; border: 1px solid #6a1010; color: #c04040; }
.task-cat-icon--mission { background: #051505; border: 1px solid #1a4a10; color: #5aaa20; }
.task-cat-icon--trade   { background: #151505; border: 1px solid #4a4a10; color: #c0a020; }
.task-cat-icon--supply  { background: #051015; border: 1px solid #1a3a50; color: #3080b0; }
.task-cat-icon--recon   { background: #100515; border: 1px solid #3a1a5a; color: #9040b0; }
.task-cat-icon--economy { background: #151200; border: 1px solid #5a4a00; color: #d0a020; }
.task-cat-icon--dimmed  { background: #0a0d07; border: 1px solid #1a2010; color: #2a3a20; }

/* Content */
.task-content { flex: 1; min-width: 0; }
.task-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.task-info { flex: 1; min-width: 0; }
.task-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.task-title {
    font-size: 13px;
}
.task-title--active { color: #8aaa60; }
.task-title--completed { color: #c0e050; }
.task-title--claimed { color: #3a5020; }

.task-difficulty {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px; letter-spacing: 0.08em;
    flex-shrink: 0;
}
.task-difficulty--easy   { background: #0a1505; border: 1px solid #2a5010; color: #5aaa20; }
.task-difficulty--medium { background: #151205; border: 1px solid #504010; color: #c09020; }
.task-difficulty--hard   { background: #150505; border: 1px solid #501010; color: #c03030; }
.task-difficulty--dimmed { background: #0a0d07; border: 1px solid #1a2010; color: #2a3a18; }

.task-desc {
    margin-top: 2px;
    font-size: 11px; line-height: 1.5;
}
.task-desc--active { color: #4a6a30; }
.task-desc--claimed { color: #2a3a18; }

/* Claim / done buttons */
.task-claim-btn {
    flex-shrink: 0;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #1e3a10;
    border: 1px solid #5a9a20;
    color: #9adf30;
    box-shadow: 0 0 10px rgba(100,200,20,0.2);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.task-claim-btn:active { transform: scale(0.95); }
.task-claim-btn .btn-icon { font-size: 16px; }
.task-claim-btn .btn-label { font-size: 9px; letter-spacing: 0.08em; }

.task-done-badge {
    flex-shrink: 0;
    display: flex; align-items: center; gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    background: #0a0d07;
    border: 1px solid #1a2a10;
}
.task-done-badge .done-icon { color: #2a5020; font-size: 14px; }
.task-done-badge .done-label { color: #2a4018; font-size: 9px; letter-spacing: 0.06em; }

/* Progress bar */
.task-progress { margin-top: 8px; }
.task-progress-bar {
    width: 100%; height: 4px;
    border-radius: 99px;
    background: #111a08;
    overflow: hidden;
}
.task-progress-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.5s;
}
.task-progress-fill--active { background: #3a5a20; }
.task-progress-fill--active-hi { background: #5a9a20; }
.task-progress-fill--completed { background: #6aaa20; }
.task-progress-fill--claimed { background: #2a3a20; }
.task-progress-nums {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 4px;
}
.task-progress-nums span { color: #3a5020; font-size: 10px; }
.task-progress-nums .pct { color: #4a6a20; }

/* Reward row */
.task-reward { margin-top: 8px; }
.task-reward-label {
    color: #2a3a18; font-size: 9px; letter-spacing: 0.1em; margin-bottom: 4px;
}
.task-reward-badges {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.reward-badge {
    display: flex; align-items: center; gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}
.reward-badge--money {
    background: #15120a; border: 1px solid #504010;
}
.reward-badge--money .icon { color: #c0a020; }
.reward-badge--money .val { color: #d0b020; }
.reward-badge--exp {
    background: #071a0a; border: 1px solid #1a5010;
}
.reward-badge--exp .icon { color: #40c060; }
.reward-badge--exp .val { color: #50d070; }
.reward-badge-exp-icon {
    width: 16px; height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}
.milestone-reward-row .reward-badge-exp-icon {
    width: 18px; height: 18px;
}
.reward-badge--stars {
    background: #1a1500; border: 1px solid #504010;
}
.reward-badge--stars .icon { color: #ffd700; }
.reward-badge--stars .val { color: #ffd700; }

/* Loading */
.tasks-loading {
    display: flex; align-items: center; justify-content: center;
    padding: 40px 0;
    color: #4a6a20;
    font-size: 13px;
}
