/* Модальное окно заданий */
.tasks-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tasks-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.tasks-modal {
    background-color: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 420px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.tasks-modal-overlay.active .tasks-modal {
    transform: scale(1);
    opacity: 1;
}

.tasks-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.tasks-modal-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
    font-weight: 600;
}

.tasks-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.tasks-modal-close:hover {
    opacity: 0.7;
}

.tasks-modal-close svg {
    width: 24px;
    height: 24px;
}


.tasks-list-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
    box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);
}

.task-item:hover {
    transform: translateY(-1px);
    box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.1);
}

.task-item.completed {
    opacity: 0.65;
    background-color: #f8fafc;
}

.task-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.task-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.task-icon svg {
    width: 22px;
    height: 22px;
    color: #64748b;
}

.task-info {
    flex: 1;
    min-width: 0;
}

.task-title {
    color: #0f172a;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.task-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.task-badge.new {
    background-color: #f1f5f9;
    color: #64748b;
}

.task-badge.in-progress {
    background-color: #fef3c7;
    color: #92400e;
}

.task-badge.completed {
    background-color: #dcfce7;
    color: #166534;
}

.task-badge.claimed {
    background-color: #e2e8f0;
    color: #64748b;
}

.task-description {
    color: #64748b;
    margin: 0;
    line-height: 1.5;
    font-size: 12px;
}


.task-progress-container {
    margin-top: 12px;
}

.task-progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.task-progress-text {
    color: #64748b;
    font-size: 11px;
    font-weight: 500;
}

.task-progress-percentage {
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
}

.task-progress-bar {
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.task-progress-fill {
    height: 100%;
    background-color: #64748b;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.task-progress-fill.completed {
    background-color: #475569;
}


.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    gap: 12px;
}

.task-reward {
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-reward-icon {
    width: 18px;
    height: 18px;
}

.task-reward-amount {
    color: #0f172a;
    font-size: 13px;
    font-weight: 600;
}

.task-action-btn {
    background-color: #64748b;
    border: none;
    border-radius: 6px;
    padding: 6px 16px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
}

.task-action-btn:hover {
    background-color: #475569;
}

.task-action-btn.claim {
    background-color: #64748b;
}

.task-action-btn.claim:hover {
    background-color: #475569;
}

.task-action-btn.claimed {
    background-color: #f1f5f9;
    color: #64748b;
    cursor: default;
    border: 1px solid #e2e8f0;
}

.task-action-btn.claimed:hover {
    background-color: #f1f5f9;
}

.task-action-btn:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    border: 1px solid #e2e8f0;
}


.tasks-empty {
    padding: 60px 20px;
    text-align: center;
    color: #64748b;
}

.tasks-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    opacity: 0.2;
}

.tasks-empty-icon svg {
    width: 100%;
    height: 100%;
}

.tasks-empty-text {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}


.tasks-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.tasks-close-btn {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 24px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 600;
}

.tasks-close-btn:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

/* Custom Scrollbar */
.tasks-list-body::-webkit-scrollbar {
    width: 6px;
}

.tasks-list-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.tasks-list-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.tasks-list-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Touch scroll improvements */
.tasks-list-body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}