﻿.modern-task-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 504px; /* Increased width by 20% */
    max-height: 80vh;
    background: linear-gradient(to bottom, var(--color-black-850), var(--color-black-900));
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-black-700);
}

    .modern-task-panel.hide {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        pointer-events: none;
    }

    .modern-task-panel.collapsed {
        max-height: 56px;
        width: 300px;
    }

    .modern-task-panel.has-new-tasks {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(72, 89, 255, 0.2), 0 0 20px rgba(72, 89, 255, 0.4);
    }

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(to right, var(--color-black-850), var(--color-black-800));
    border-bottom: 1px solid var(--color-black-700);
    user-select: none;
    cursor: move;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title {
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--color-text-base);
    letter-spacing: 0.2px;
}

.task-count {
    background: linear-gradient(to bottom right, var(--color-primary-600), var(--color-primary-500));
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    padding: 2px 8px;
    min-width: 24px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.notification-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: transparent;
}

    .notification-indicator.pulse {
        background: linear-gradient(to bottom right, var(--color-primary-600), var(--color-primary-500));
        box-shadow: 0 0 0 rgba(72, 89, 255, 0.6);
        animation: pulse 2s infinite;
    }

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(72, 89, 255, 0.6);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(72, 89, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(72, 89, 255, 0);
    }
}

.panel-controls {
    display: flex;
    gap: 8px;
}

.panel-button {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.05);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .panel-button:hover {
        background-color: rgba(255, 255, 255, 0.1);
        transform: translateY(-1px);
    }

    .panel-button:active {
        transform: translateY(0);
    }

    .panel-button img {
        width: 16px;
        height: 16px;
        opacity: 0.8;
        transition: opacity 0.2s ease;
    }

    .panel-button:hover img {
        opacity: 1;
    }

.panel-content {
    flex: 1;
    overflow-y: auto;
    transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 70vh;
    scrollbar-width: thin;
    scrollbar-color: var(--color-black-750) var(--color-black-900);
}

    .panel-content::-webkit-scrollbar {
        width: 6px;
    }

    .panel-content::-webkit-scrollbar-track {
        background: var(--color-black-900);
    }

    .panel-content::-webkit-scrollbar-thumb {
        background-color: var(--color-black-750);
        border-radius: 6px;
    }

    .panel-content.hidden {
        max-height: 0;
        overflow: hidden;
    }

.task-tabs {
    display: flex;
    flex-direction: column;
}

.tablist {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--color-black-700);
}

.tab {
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-base);
    cursor: pointer;
    transition: color 0.2s ease;
}

    .tab.active {
        color: var(--color-primary-400);
        border-bottom-color: var(--color-primary-400);
    }

    .tab:hover:not(.active) {
        color: var(--color-secondary-400);
        border-bottom-color: var(--color-secondary-900);
    }

.tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.valid-accounts-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.account-price {
    font-weight: 600;
    color: var(--color-success-500);
}

.panel-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tasks-list {
    padding: 0;
}

.task-card {
    margin: 12px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.02);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

    .task-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .task-card.in-progress {
        border-left: 3px solid var(--color-waiting-500);
    }

    .task-card.completed {
        border-left: 3px solid var(--color-success-500);
    }

    .task-card.failed {
        border-left: 3px solid var(--color-error-text);
    }

    /* Highlighting completed tasks */
    .task-card.completed::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        background: var(--color-success-500);
        box-shadow: 0 0 8px var(--color-success-500);
    }

    /* No need for the additional "Task canceled" text since we now show it inline */
    .task-card.failed::after {
        display: none;
    }

.account-status.cancelled {
    opacity: 0.7;
}

.task-card-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /*background-color: rgba(255, 255, 255, 0.03);*/
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.task-type {
    display: flex;
    align-items: center;
    gap: 12px;
}

.task-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(to bottom right, var(--color-primary-900), var(--color-primary-950));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

    .task-icon img {
        width: 18px;
        height: 18px;
        opacity: 0.9;
    }

.task-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text-base);
}

.task-info {
    font-size: 12px;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-cancelled {
    display: inline-block;
    font-weight: 500;
    color: var(--color-error-text);
    background-color: rgba(236, 71, 71, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

.task-actions {
    display: flex;
    gap: 8px;
}

.action-button {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.05);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .action-button:hover {
        background-color: rgba(255, 255, 255, 0.1);
        transform: translateY(-1px);
    }

    .action-button:active {
        transform: translateY(0);
    }

    .action-button img {
        width: 14px;
        height: 14px;
        opacity: 0.8;
    }

    .action-button:hover img {
        opacity: 1;
    }

    .action-button.cancel-button:hover {
        background-color: rgba(236, 71, 71, 0.1);
    }

    .action-button.remove-button:hover {
        background-color: rgba(236, 71, 71, 0.1);
    }

.accounts-container {
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-black-750) transparent;
}

    .accounts-container::-webkit-scrollbar {
        width: 4px;
    }

    .accounts-container::-webkit-scrollbar-track {
        background: transparent;
    }

    .accounts-container::-webkit-scrollbar-thumb {
        background-color: var(--color-black-750);
        border-radius: 4px;
    }

.account-item {
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background-color 0.2s ease;
}

    .account-item:hover {
        background-color: rgba(255, 255, 255, 0.03);
    }

    .account-item:last-child {
        border-bottom: none;
    }

.account-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-id {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.account-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-base);
}

.account-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--color-primary-600);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.status-text {
    font-size: 12px;
    color: var(--color-text-secondary);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .status-text.clickable {
        cursor: pointer;
        text-decoration: underline dotted;
        text-underline-offset: 2px;
    }

    .status-text.success {
        color: var(--color-success-500);
    }

    .status-text.error {
        color: var(--color-error-text);
    }

    .status-text.processing {
        color: var(--color-waiting-500);
    }

    .status-text.invalid {
        color: var(--color-error-text);
    }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
}

.empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(to bottom right, var(--color-black-800), var(--color-black-850));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

    .empty-icon img {
        width: 24px;
        height: 24px;
        opacity: 0.6;
    }

.empty-text {
    font-size: 14px;
    color: var(--color-text-secondary);
    text-align: center;
}

.message-tooltip {
    position: absolute;
    background: linear-gradient(to bottom, var(--color-black-850), var(--color-black-900));
    border: 1px solid var(--color-black-700);
    padding: 12px;
    border-radius: 8px;
    z-index: 1010;
    max-width: 300px;
    word-wrap: break-word;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: tooltip-appear 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tooltip-content {
    font-size: 13px;
    color: var(--color-text-base);
    line-height: 1.5;
}

.tooltip-close {
    align-self: flex-end;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.05);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

    .tooltip-close:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

    .tooltip-close img {
        width: 12px;
        height: 12px;
        opacity: 0.8;
    }

@keyframes tooltip-appear {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Glass morphism effect for modern UI */
.modern-task-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    pointer-events: none;
    z-index: -1;
}

/* Task card status indicators with glow effects */
.task-card.in-progress::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-waiting-500);
    box-shadow: 0 0 8px var(--color-waiting-500);
}

.task-card.completed::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-success-500);
    box-shadow: 0 0 8px var(--color-success-500);
}

.task-card.failed::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-error-text);
    box-shadow: 0 0 8px var(--color-error-text);
}
/* Enhanced tabs styling */
.tablist {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--color-black-700);
    background: linear-gradient(to right, var(--color-black-850), var(--color-black-800));
    padding: 0 8px;
}

.tab {
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
    position: relative;
    border-radius: 8px 8px 0 0;
    margin: 0 2px;
}

    .tab:hover:not(.active) {
        color: var(--color-text-base);
        background-color: rgba(255, 255, 255, 0.05);
        border-bottom-color: var(--color-secondary-600);
    }

    .tab.active {
        color: var(--color-primary-400);
        background: linear-gradient(to bottom, rgba(72, 89, 255, 0.1), rgba(72, 89, 255, 0.05));
        border-bottom-color: var(--color-primary-400);
        box-shadow: 0 0 10px rgba(72, 89, 255, 0.2);
    }

.tab-text {
    font-weight: inherit;
}

.tab-badge {
    background: linear-gradient(to bottom right, var(--color-primary-600), var(--color-primary-500));
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    padding: 2px 6px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-left: auto;
}

    .tab-badge.success {
        background: linear-gradient(to bottom right, var(--color-success-600), var(--color-success-500));
        box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3);
    }

.tab-price {
    background: linear-gradient(to bottom right, var(--color-success-700), var(--color-success-600));
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 8px;
    padding: 2px 6px;
    margin-left: 4px;
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.4);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Enhanced valid accounts display */
.valid-accounts-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .valid-accounts-list .account-item {
        background: linear-gradient(to right, rgba(34, 197, 94, 0.05), rgba(34, 197, 94, 0.02));
        border: 1px solid rgba(34, 197, 94, 0.1);
        border-radius: 8px;
        padding: 12px 16px;
        transition: all 0.2s ease;
    }

        .valid-accounts-list .account-item:hover {
            background: linear-gradient(to right, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
            border-color: rgba(34, 197, 94, 0.2);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(34, 197, 94, 0.1);
        }

    .valid-accounts-list .account-price {
        font-weight: 700;
        color: var(--color-success-500);
        font-size: 14px;
        background: linear-gradient(to right, var(--color-success-500), var(--color-success-400));
        -webkit-background-clip: text;
        background-clip: text;
    }
/* Responsive adjustments */
@media (max-width: 768px) {
    .modern-task-panel {
        width: calc(100% - 32px);
        bottom: 16px;
        right: 16px;
        max-height: 70vh;
    }

        .modern-task-panel.collapsed {
            width: 280px;
        }
}
