/*!
 * 自定义样式
 * 基于 Tailwind CSS v3.0
 */

/* Tailwind 指令 */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* 全局样式 */
:root {
    --primary-color: #1E88E5;
    --secondary-color: #FF9800;
    --neutral-color: #F5F7FA;
    --color-work: #3b82f6;
    --color-study: #10b981;
    --color-life: #f97316;
    --color-other: #eab308;
}

/* Inter字体定义 - 使用系统字体作为后备 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: all 0.3s ease-in-out;
}

/* 头部组件 */
header {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 导航栏 */
nav {
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    width: 16rem;
    transition: width 0.3s ease-in-out;
}

nav.collapsed {
    width: 4rem;
}

nav.collapsed ul li span {
    display: none;
}

nav.collapsed ul li i {
    margin-right: 0;
    display: flex;
    justify-content: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    main {
        margin-left: 4rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.3s ease-in-out;
    backdrop-filter: blur(10px);
}

.card:hover {
    transform: translateY(-2px);
}

/* 任务管理表格列固定宽度 */
#task-management table th:nth-child(1),
#task-management table td:nth-child(1) {
    width: 5%;
}

#task-management table th:nth-child(4),
#task-management table td:nth-child(4) {
    width: 8%;
}

#task-management table th:nth-child(5),
#task-management table td:nth-child(5) {
    width: 8%;
}

#task-management table th:nth-child(6),
#task-management table td:nth-child(6) {
    width: 8%;
}

#task-management table th:nth-child(7),
#task-management table td:nth-child(7) {
    width: 8%;
}

/* 表格悬停效果 */
table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 页面内容切换 */
.page-content {
    display: none !important;
}

.page-content.active {
    display: block !important;
}

/* 导航项激活状态 */
.nav-item.active {
    background-color: rgba(30, 136, 229, 0.1);
    color: var(--primary-color);
}

/* 模态框动画 */
#add-task-modal {
    transition: all 0.3s ease-in-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* 波纹效果 */
@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    transform: scale(0);
    animation: ripple 0.6s linear;
}

/* 圆形进度条 */
.circular-progress {
    transition: stroke-dashoffset 0.3s ease-in-out;
}

/* 表单元素样式 */
.form-checkbox, .form-radio {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-radius: 2px;
    background-color: white;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.form-checkbox:checked::after {
    content: "";
    position: absolute;
    top: 1px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-checkbox:checked {
    background-color: #1E88E5;
    border-color: #1E88E5;
}

.form-radio {
    border-radius: 50%;
}

.form-radio:checked::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
}

.form-radio:checked {
    background-color: #1E88E5;
    border-color: #1E88E5;
}

.form-checkbox:focus, .form-radio:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.2);
}

/* 自定义下拉框样式 */
#focus-goal-selector {
    min-height: 42px;
    display: flex;
    align-items: center;
    position: relative;
}

#focus-goal-selector::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #6b7280;
    pointer-events: none;
}

#focus-goal-selector:focus {
    outline: none;
    border-color: #1E88E5;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

#focus-goal-dropdown {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

#focus-goal-dropdown::-webkit-scrollbar {
    width: 6px;
}

#focus-goal-dropdown::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

#focus-goal-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

#focus-goal-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 番茄钟计时器圆形进度条样式 */
#timer-circle-svg {
    transform: rotate(-90deg);
    filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.4));
    transition: filter 0.5s ease;
}

#timer-circle-svg.timer-running {
    animation: pulse-ring-svg 2s ease-in-out infinite;
}

@keyframes pulse-ring-svg {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.4))
                drop-shadow(0 0 40px rgba(16, 185, 129, 0.2));
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(16, 185, 129, 0.8))
                drop-shadow(0 0 60px rgba(16, 185, 129, 0.5))
                drop-shadow(0 0 80px rgba(16, 185, 129, 0.3));
    }
}

.timer-background-circle {
    transition: stroke 0.3s ease;
}

.timer-progress-circle {
    transition: stroke-dashoffset 0.5s linear, stroke 0.5s ease;
    stroke: #10b981;
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.6));
    transform-origin: center;
}

.timer-progress-circle.circular-progress {
    transform: rotate(0deg);
}

/* 添加一个关键帧动画，用于进度条的动态效果 */
@keyframes progress-pulse {
    0% {
        filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.9));
    }
    100% {
        filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.6));
    }
}

.timer-progress-circle.animating {
    animation: progress-pulse 2s infinite;
}

/* 今日任务滚动条样式 */
#today-tasks-container {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

#today-tasks-container::-webkit-scrollbar {
    width: 6px;
}

#today-tasks-container::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

#today-tasks-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

#today-tasks-container::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 今日任务卡片样式 */
.today-task-item {
    transition: all 0.2s ease;
    cursor: pointer;
}

.today-task-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background-color: #ffffff !important;
}

/* 仪表盘卡片样式 */
.dashboard-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease-in-out;
    padding: 1.25rem;
    position: relative;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* 分页控件样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 12px;
    margin: 0 4px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination button:hover {
    background-color: #f5f5f5;
}

.pagination button.active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 表格排序样式 */
.sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.sortable-header:hover {
    background-color: #f5f5f5;
}

.sort-indicator {
    transition: transform 0.3s ease;
}

.sort-indicator.asc {
    transform: rotate(180deg);
}

.sort-indicator.desc {
    transform: rotate(0deg);
}

/* 加载动画样式 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
}

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

/* 响应式导航栏样式 */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.nav-toggle span {
    width: 30px;
    height: 3px;
    background: #333;
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: center;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        background-color: #fff;
        width: 100%;
        height: 100vh;
        transition: left 0.3s ease;
        padding-top: 60px;
    }
    
    .nav-menu.active {
        left: 0;
    }
}

/* 任务名称省略号样式 */
#record-task-name {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


