/**
 * 全局样式表 - 任务管理系统
 * 
 * 描述: 主要样式文件，包含整个应用的视觉设计和交互效果
 * 作者: 开发团队
 * 创建时间: 2024
 * 最后修改: 2024
 * 
 * 主要功能:
 * - 全局CSS变量定义
 * - 响应式布局设计
 * - 核心组件样式定义
 * - 动画和过渡效果
 * - 主题色彩系统
 * 
 * 注意: 具体组件样式已迁移到 components/ 目录
 */

/* ========================================
   CSS 变量定义 - 全局主题色彩系统
   ======================================== */
:root {
    /* 主要颜色 */
    --primary: #ffffff;        /* 主色调 - 纯白 */
    --secondary: #ff9900;      /* 辅助色 - 橙色 */
    --accent: #ff7700;         /* 强调色 - 深橙色 */
    
    /* 基础颜色 */
    --dark: #212529;           /* 深色文字 */
    --light: #ffffff;          /* 浅色背景 */
    
    /* 状态颜色 */
    --success: #28a745;        /* 成功状态 - 绿色 */
    --warning: #ffc107;        /* 警告状态 - 黄色 */
    --danger: #dc3545;         /* 危险状态 - 红色 */
    
    /* 组件背景 */
    --card-bg: rgba(255, 255, 255, 0.95);  /* 卡片背景 - 半透明白色 */
}

/* ========================================
   浏览器兼容性处理 - 输入框自动填充样式重置
   ======================================== */

/* 强制隐藏浏览器的自动完成下拉菜单 */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--light) inset !important;
    -webkit-text-fill-color: var(--dark) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* 隐藏下拉菜单和历史记录，但保留日历选择器 */
datalist,
input::-webkit-list-button,
input::-webkit-inner-spin-button,
input::-webkit-outer-spin-button,
input::-webkit-clear-button,
input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
    visibility: hidden !important;
    display: none !important;
    opacity: 0 !important;
    -webkit-appearance: none !important;
    pointer-events: none !important;
    position: absolute !important;
}

/* 只对非日期输入框隐藏日历指示器 */
input:not([type="date"]):not([type="datetime-local"])::-webkit-calendar-picker-indicator {
    visibility: hidden !important;
    display: none !important;
    opacity: 0 !important;
    -webkit-appearance: none !important;
    pointer-events: none !important;
    position: absolute !important;
}

/* 禁用浏览器自动填充样式 */
form[autocomplete="off"] input,
input[autocomplete="off"],
input[autocomplete="new-password"] {
    background-position: 100% 50% !important;
    background-repeat: no-repeat !important;
}

input:-webkit-autofill {
    -webkit-animation-name: autofill;
    -webkit-animation-fill-mode: both;
}

/* ========================================
   全局重置样式和基础布局
   ======================================== */

/* 全局重置 - 清除默认样式并设置统一字体 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 页面主体样式 - 渐变背景和基础设置 */
html {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
    color: var(--dark);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 确保所有元素在页面加载时不显示白色背景 */
html::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    z-index: -1;
}

/* 仪表板主容器 - Flexbox布局 */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   侧边栏导航 - 主导航菜单样式
   ======================================== */



/* ========================================
   主内容区域 - 页面主体内容布局
   ======================================== */

/* 主内容容器 - 占据剩余空间，垂直布局 */
.main-content {
    flex: 1;
    margin-left: 260px; /* 为固定定位的侧边栏留出空间 */
    padding: 30px;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease; /* 响应式过渡效果 */
}

/* 信息栏样式 */
.info-bar {
    background-color: #e1f5fe;
    border-radius: 5px;
    padding: 10px 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #0277bd;
}

.info-bar .fas {
    font-size: 16px;
}

.info-bar .countdown {
    margin-left: auto;
    font-weight: 500;
}

/* 时间槽选择样式 */
.time-slot-item.selected {
    background-color: #d6f5d6;
    border-color: #4CAF50;
    position: relative;
}

.selected-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #4CAF50;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.appointment-success {
    margin-top: 20px;
    padding: 15px;
    background-color: #d6f5d6;
    border: 1px solid #4CAF50;
    border-radius: 5px;
    color: #2e7d32;
    display: flex;
    align-items: center;
}

.appointment-success i {
    font-size: 24px;
    margin-right: 10px;
}

.suitable-time-found {
    margin-top: 20px;
    padding: 15px;
    background-color: #e3f2fd;
    border: 1px solid #2196F3;
    border-radius: 5px;
    color: #0d47a1;
}

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

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* 加载动画样式已迁移到 components/loading.css */

/* ========================================
   动画效果定义
   ======================================== */

/* 基础淡入动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* 旋转动画已迁移到 components/loading.css */

/* 复选标记动画 */
@keyframes checkmark {
    0% {
        opacity: 0;
        transform: rotate(45deg) scale(0);
    }
    100% {
        opacity: 1;
        transform: rotate(45deg) scale(1);
    }
}

/* 模态框动画 */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalBackdropFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

@keyframes modalContentFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
}

/* ========================================
   响应式设计
   ======================================== */

@media (max-width: 1200px) {
    .main-content {
        margin-left: 80px; /* 适配收缩后的侧边栏宽度 */
    }
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0; /* 移动端侧边栏不占用空间 */
        padding: 20px 15px;
    }
    /* 头部响应式样式已迁移到 layout/header.css */
    .table-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    .search-box {
        width: 100%;
    }

}