/* 自定义滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(59, 130, 246, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(59, 130, 246, 0.5);
}

/* 任务项动画效果 */
.task-item {
    transition: all 0.3s ease;
}

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

/* 复选框自定义样式 */
.task-checkbox {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-checkbox:checked {
    background-color: #10B981;
    border-color: #10B981;
}

.task-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.task-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* 任务优先级指示器 */
.priority-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.priority-high {
    background-color: #F59E0B;
}

.priority-medium {
    background-color: #FBBF24;
}

.priority-low {
    background-color: #FCD34D;
}

.priority-none {
    background-color: #3B82F6;
}

/* 状态标签样式 */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.status-pending {
    background-color: #FEF3C7;
    color: #92400E;
}

.status-completed {
    background-color: #D1FAE5;
    color: #065F46;
}

.status-overdue {
    background-color: #FEE2E2;
    color: #991B1B;
}

/* 任务操作按钮组 */
.task-actions {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.task-item:hover .task-actions {
    opacity: 1;
}

/* 输入框和选择框获取焦点时的动画效果 */
input:focus,
textarea:focus,
select:focus {
    transition: all 0.2s ease;
}

/* 日期显示样式 */
.due-date {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.due-date.overdue {
    color: #EF4444;
}

.due-date.soon {
    color: #F59E0B;
}

/* 按钮点击效果 */
button {
    transition: all 0.2s ease;
}

button:active {
    transform: scale(0.98);
}

/* 通知动画 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification-enter {
    animation: slideInRight 0.3s ease forwards;
}

.notification-leave {
    animation: slideOutRight 0.3s ease forwards;
}

/* 任务项进入/离开动画 */
@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUpAndFade {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-10px);
        opacity: 0;
    }
}

.task-enter {
    animation: slideDown 0.3s ease forwards;
}

.task-leave {
    animation: slideUpAndFade 0.3s ease forwards;
}

/* 渐变背景 */
.gradient-bg {
    background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
}

/* 加载状态 */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 禁用状态样式 */
.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* 移动端适配优化 */
@media (max-width: 768px) {
    .task-item {
        padding: 12px !important;
    }
    
    .task-actions {
        opacity: 1;
        margin-top: 8px;
    }
    
    .task-title {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .task-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* 空状态图标动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.8;
    }
}

#empty-state i,
#trash-empty i {
    animation: pulse 2s infinite;
}

/* 表单验证错误样式 */
input.error,
textarea.error,
select.error {
    border-color: #EF4444 !important;
}

input.error:focus,
textarea.error:focus,
select.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* 工具提示样式 */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* 倒计时样式 */
.countdown {
    font-weight: 500;
}

.countdown.danger {
    color: #EF4444;
    animation: blink 1s infinite alternate;
}

@keyframes blink {
    from { opacity: 1; }
    to { opacity: 0.6; }
}

/* 过滤按钮样式 */
.filter-btn.active {
    background-color: #1E40AF;
    color: white;
}