/* ==================== TODOIST INTEGRATION STYLES ==================== */

.gvp-todoist-container {
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.gvp-todoist__toggle-all {
    max-width: 165px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    margin-bottom: 1rem;
    background-color: rgba(59, 131, 246, 0);
    border: 1px solid rgba(59, 131, 246, 0);
    border-radius: 8px;
    color: #60a5fa;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    justify-content: center;
}

.gvp-todoist__toggle-all:hover {
    background-color: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    color: #93c5fd;
    transform: translateY(-1px);
}

.gvp-todoist__toggle-all:active {
    transform: translateY(0);
}

.gvp-todoist__toggle-all i {
    width: 16px;
    height: 16px;
}

.gvp-todoist__archive-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background-color: rgba(100, 116, 139, 0.15);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 8px;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
    font-style: italic;
}

.gvp-todoist__archive-notice i {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    flex-shrink: 0;
}

.gvp-todoist__sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    width: 100%;
    /* Inline стилі з JS матимуть пріоритет на десктопі, але будуть перекриті медіа-запитами на мобільних */
}

.gvp-todoist__empty {
    padding: 2rem;
    text-align: center;
    color: #64748b;
    font-style: italic;
    background-color: rgba(15, 23, 42, 0.3);
    border: 1px dashed rgba(100, 116, 139, 0.3);
    border-radius: 8px;
}

.gvp-todoist__section {
    background-color: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100px;
    transition: all 0.3s ease;
}

.gvp-todoist__section--completed:not(.gvp-todoist__section--collapsed) {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.2);
}

.gvp-todoist__section--collapsed {
    min-height: auto;
}

.gvp-todoist__section--empty {
    opacity: 0.6;
}

.gvp-todoist__section--empty .gvp-todoist__section-header {
    opacity: 0.7;
}

/* Стилі для заархівованих проєктів */
.gvp-todoist--archived {
    opacity: 0.7;
    position: relative;
}

.gvp-todoist--archived::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(100, 116, 139, 0.05) 10px,
        rgba(100, 116, 139, 0.05) 20px
    );
    pointer-events: none;
    z-index: 1;
    border-radius: 8px;
}

.gvp-todoist__sections-grid--archived {
    opacity: 0.75;
    filter: grayscale(0.3);
}

/* Стилі для заархівованих секцій */
.gvp-todoist__section--archived {
    opacity: 0.65;
    background-color: rgba(15, 23, 42, 0.3);
    border-color: rgba(100, 116, 139, 0.15);
    position: relative;
}

.gvp-todoist__section--archived::before {
    content: '📦';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1rem;
    opacity: 0.6;
    z-index: 2;
    pointer-events: none;
}

.gvp-todoist__section--archived .gvp-todoist__section-header {
    background-color: rgba(30, 41, 59, 0.4);
    border-bottom-color: rgba(100, 116, 139, 0.15);
}

.gvp-todoist__section--archived .gvp-todoist__section-name {
    color: #94a3b8;
    font-style: italic;
}

.gvp-todoist__section--archived .gvp-todoist__task {
    opacity: 0.7;
    background-color: rgba(30, 41, 59, 0.25);
    border-color: rgba(100, 116, 139, 0.1);
}

.gvp-todoist__tasks-list--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    padding: 2rem 0.5rem;
}

.gvp-todoist__section--collapsed .gvp-todoist__tasks-list--empty {
    min-height: 0;
    padding: 0 0.5rem;
}

.gvp-todoist__empty-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.8125rem;
    text-align: center;
}

.gvp-todoist__empty-message i {
    width: 24px;
    height: 24px;
    opacity: 0.5;
}

.gvp-todoist__section-header {
    padding: 0.75rem;
    background-color: rgba(30, 41, 59, 0.6);
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
    text-align: center;
    transition: all 0.3s ease;
}

.gvp-todoist__section-header--completed {
    background-color: rgba(16, 185, 129, 0.15);
    border-bottom-color: rgba(16, 185, 129, 0.3);
}

.gvp-todoist__section-header--completed .gvp-todoist__section-name {
    color: #10b981;
}

.gvp-todoist__section-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.gvp-todoist__section-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 15px;
    font-weight: 500;
    color: #1de9d1;
       border-radius: 6px;
    padding: 0.375rem 0.625rem;
    margin-top: 0.25rem;
    text-transform: none;
    letter-spacing: normal;
    overflow: hidden;
}


.gvp-todoist__section-time i {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
    color: #60a5fa;
    flex-shrink: 0;
}

.gvp-todoist__section-header--completed {
    color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.1) 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

.gvp-todoist__section-header--completed {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.15) 100%);
    border-color: rgba(16, 185, 129, 0.5);
    color: #34d399;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.gvp-todoist__section-header--completed {
    color: #10b981;
}

.gvp-todoist__stage-badge {
    display: none; /* Приховуємо, бо назва вже показує етап */
}

.gvp-todoist__tasks-list {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    max-height: 400px;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.gvp-todoist__section--collapsed .gvp-todoist__tasks-list {
    max-height: 0;
    padding: 0 0.5rem;
    opacity: 0;
    overflow: hidden;
}

.gvp-todoist__tasks-list::-webkit-scrollbar {
    width: 4px;
}

.gvp-todoist__tasks-list::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
}

.gvp-todoist__tasks-list::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.5);
    border-radius: 2px;
}

.gvp-todoist__task {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.gvp-todoist__task:hover {
    background-color: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.4);
    transform: translateX(2px);
}

.gvp-todoist__task--completed {
    opacity: 0.6;
}

.gvp-todoist__task--completed .gvp-todoist__task-name {
    text-decoration: line-through;
    color: #64748b;
}

.gvp-todoist__task--high-priority {
    border-left: 3px solid #ef4444;
}

.gvp-todoist__task--overdue {
    border-color: rgba(248, 113, 113, 0.6);
    background-color: rgba(248, 113, 113, 0.12);
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.25) inset;
}

.gvp-todoist__task--overdue .gvp-todoist__task-name {
    color: #fecaca;
}

.gvp-todoist__task--overdue .gvp-todoist__task-due {
    color: #f87171;
}

.gvp-todoist__task--active {
    border-color: rgba(16, 185, 129, 0.65);
    background-color: rgba(16, 185, 129, 0.14);
    animation: gvp-todoist-task-active-blink 1.5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .gvp-todoist__task--active {
        animation: none;
    }
}

@keyframes gvp-todoist-task-active-blink {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.15);
    }
    50% {
        box-shadow: 0 0 18px 2px rgba(16, 185, 129, 0.35);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.15);
    }
}

.gvp-todoist__subtasks {
    margin-top: 0.5rem;
    margin-left: 1.5rem;
    padding-left: 0.75rem;
    border-left: 2px solid rgba(100, 116, 139, 0.2);
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.gvp-todoist__task--subtask {
    padding: 0.5rem 0.625rem;
    font-size: 0.75rem;
    background-color: rgba(30, 41, 59, 0.3);
    border-color: rgba(100, 116, 139, 0.15);
    margin-left: 0;
}

.gvp-todoist__task--subtask:hover {
    background-color: rgba(30, 41, 59, 0.5);
    border-color: rgba(148, 163, 184, 0.3);
    transform: translateX(1px);
}

.gvp-todoist__task--subtask .gvp-todoist__task-name {
    font-size: 0.75rem;
    font-weight: 400;
}

.gvp-todoist__task--subtask .gvp-todoist__task-meta {
    font-size: 0.625rem;
    gap: 0.375rem;
}

.gvp-todoist__task--subtask .gvp-todoist__task-link {
    top: 0.375rem;
    right: 0.375rem;
    width: 20px;
    height: 20px;
}

.gvp-todoist__task--subtask .gvp-todoist__task-link i {
    width: 12px;
    height: 12px;
}

.gvp-todoist__task-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #e5e7eb;
    line-height: 1.4;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.gvp-todoist__task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.6875rem;
    color: #94a3b8;
}

.gvp-todoist__task-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.gvp-todoist__task-status {
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gvp-todoist__task-status--overdue {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.gvp-todoist__task-status--active {
    background: rgba(16, 185, 129, 0.15);
    color: #bbf7d0;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.gvp-todoist__task-meta i {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.gvp-todoist__task-assignee {
    color: #60a5fa;
}

.gvp-todoist__task-due {
    color: #fbbf24;
}

.gvp-todoist__task-duration {
    color: #a78bfa;
}

.gvp-todoist__task-priority {
    color: #f87171;
    font-weight: 600;
}

.gvp-todoist__task-link {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem;
    color: #64748b;
    transition: all 0.2s ease;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.gvp-todoist__task:hover .gvp-todoist__task-link {
    opacity: 1;
}

.gvp-todoist__task-link:hover {
    color: #60a5fa;
    background-color: rgba(59, 130, 246, 0.1);
}

.gvp-todoist__task-link i {
    width: 14px;
    height: 14px;
}

.gvp-todoist__task-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 0.375rem;
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 10px;
    margin-left: 0.5rem;
}

/* Адаптація для mobile */
@media (max-width: 1400px) {
    .gvp-todoist__sections-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    }
}

@media (max-width: 1024px) {
    .gvp-todoist__sections-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    }
}

@media (max-width: 768px) {
    .gvp-todoist__sections-grid {
        grid-template-columns: 1fr !important;
    }
    
    .gvp-todoist__section {
        min-height: auto;
    }
    
    .gvp-todoist__tasks-list {
        max-height: 300px;
    }
}

