/**
 * 预约管理页面优化样式
 * 包含：列表视图、日历视图、看板视图、响应式布局
 */

/* ===========================
   预约卡片样式
   =========================== */
.appointment-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

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

.appointment-card.status-pending {
    border-left-color: #ffc107;
}

.appointment-card.status-confirmed {
    border-left-color: #28a745;
}

.appointment-card.status-completed {
    border-left-color: #17a2b8;
}

.appointment-card.status-cancelled {
    border-left-color: #dc3545;
}

.appointment-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 15px;
}

.appointment-info {
    flex: 1;
    margin-left: 15px;
}

.appointment-name {
    font-size: 18px;
    font-weight: 600;
    color: #32325d;
    margin-bottom: 5px;
}

.appointment-company {
    color: #6c757d;
    font-size: 14px;
}

.appointment-status {
    display: flex;
    align-items: center;
}

.appointment-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 14px;
}

.detail-item i {
    color: #667eea;
    font-size: 16px;
}

.appointment-message {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
    font-size: 14px;
    line-height: 1.6;
}

.appointment-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

/* ===========================
   看板视图样式
   =========================== */
.kanban-board {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
}

.kanban-column {
    flex: 0 0 300px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
}

.kanban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

.kanban-header h5 {
    font-size: 16px;
    font-weight: 600;
    color: #32325d;
    margin: 0;
}

.kanban-count {
    background: white;
    color: #667eea;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.kanban-items {
    min-height: 400px;
}

.kanban-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: move;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.kanban-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(3deg);
}

.kanban-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.kanban-card-header strong {
    color: #32325d;
    font-size: 14px;
}

.kanban-time {
    color: #adb5bd;
    font-size: 12px;
}

.kanban-card-body {
    margin-bottom: 10px;
}

.kanban-detail {
    color: #6c757d;
    font-size: 13px;
    margin-bottom: 5px;
}

.kanban-card-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

/* ===========================
   日历视图样式
   =========================== */
#appointmentsCalendar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    min-height: 600px;
}

.fc-event {
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 13px;
    cursor: pointer;
}

.fc-day-today {
    background: rgba(102, 126, 234, 0.05) !important;
}

/* 简单日历回退样式 */
.simple-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    background: white;
    border-radius: 12px;
    padding: 20px;
}

.calendar-day {
    aspect-ratio: 1;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 8px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-day:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.calendar-day-number {
    font-weight: 600;
    color: #6c757d;
    font-size: 12px;
}

.calendar-day-events {
    margin-top: 5px;
}

.calendar-event {
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 3px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===========================
   统计卡片样式
   =========================== */
.stat-card.mini {
    padding: 15px;
    text-align: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.stat-card.mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.stat-card.mini .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #32325d;
    margin-bottom: 5px;
}

.stat-card.mini .stat-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.status-pending {
    border-top: 3px solid #ffc107;
}

.stat-card.status-confirmed {
    border-top: 3px solid #28a745;
}

.stat-card.status-completed {
    border-top: 3px solid #17a2b8;
}

/* ===========================
   筛选和工具栏
   =========================== */
.appointments-toolbar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.view-switcher {
    display: flex;
    gap: 10px;
    background: #f8f9fa;
    padding: 4px;
    border-radius: 8px;
}

.view-switcher button {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-switcher button.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.view-switcher button:hover:not(.active) {
    color: #32325d;
}

/* ===========================
   通知样式
   =========================== */
.notifications-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 3000;
    max-width: 350px;
}

.notification-toast {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification-toast.show {
    transform: translateX(0);
}

.notification-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-content strong {
    display: block;
    color: #32325d;
    margin-bottom: 4px;
}

.notification-content p {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
}

.notification-close {
    background: none;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    padding: 0;
    font-size: 20px;
    line-height: 1;
}

/* ===========================
   导出对话框
   =========================== */
.export-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 2000;
    min-width: 400px;
}

.export-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.export-option {
    padding: 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-option:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.export-option i {
    font-size: 32px;
    color: #667eea;
    margin-bottom: 10px;
}

.export-option span {
    display: block;
    font-weight: 500;
    color: #32325d;
}

/* ===========================
   状态变更动画
   =========================== */
@keyframes statusChange {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        background: rgba(102, 126, 234, 0.1);
    }
    100% {
        transform: scale(1);
    }
}

.status-changing {
    animation: statusChange 0.6s ease;
}

/* ===========================
   响应式布局
   =========================== */
@media (max-width: 1200px) {
    .kanban-column {
        flex: 0 0 280px;
    }
    
    .appointment-details {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .appointment-actions {
        flex-wrap: wrap;
    }
    
    .appointment-actions button {
        flex: 1;
        min-width: calc(50% - 4px);
    }
    
    .kanban-board {
        flex-direction: column;
    }
    
    .kanban-column {
        flex: 1;
        width: 100%;
    }
    
    .view-switcher {
        flex-direction: column;
    }
    
    .appointment-details {
        grid-template-columns: 1fr;
    }
    
    .export-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .appointment-card {
        padding: 15px;
    }
    
    .appointment-name {
        font-size: 16px;
    }
    
    .appointment-actions button {
        min-width: 100%;
        margin-bottom: 5px;
    }
    
    .stat-card.mini {
        margin-bottom: 10px;
    }
    
    .notifications-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}