/* ==================== 時間感知系統樣式 ==================== */

/* 自動切換狀態指示器 */
.auto-switch-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--color-bg-secondary);
    border-radius: 20px;
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-left: 12px;
    transition: all var(--transition-fast);
}

.auto-switch-status.auto-switch-active {
    background: rgba(52, 199, 89, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.auto-switch-status.auto-switch-paused {
    background: rgba(255, 149, 0, 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(255, 149, 0, 0.3);
}

.auto-switch-status.auto-switch-disabled {
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
    opacity: 0.6;
}

/* 下一場次提示 */
.next-session-hint {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
}

.next-session-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1), rgba(0, 122, 255, 0.05));
    border: 1px solid rgba(0, 122, 255, 0.3);
    border-radius: 12px;
    color: var(--color-text-primary);
    font-size: 14px;
    box-shadow: var(--shadow-md);
}

.next-session-alert .countdown {
    padding: 4px 8px;
    background: var(--color-brand);
    color: white;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
}

.next-session-alert .time-slot {
    color: #666;
    font-size: 13px;
    margin: 0 8px;
    font-weight: normal;
}

/* 時間軸容器 */
#session-timeline,
.session-timeline {
    padding: 20px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    margin: 20px 0;
}

.timeline-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: background var(--transition-fast);
}

.timeline-item.active {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.1), rgba(52, 199, 89, 0.05));
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.timeline-item.active::before {
    background: var(--color-success);
}

.timeline-item.past {
    opacity: 0.5;
}

.timeline-item.next {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1), rgba(0, 122, 255, 0.05));
    border: 1px solid rgba(0, 122, 255, 0.3);
}

.timeline-item.next::before {
    background: var(--color-brand);
}

.timeline-time {
    min-width: 60px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-right: 16px;
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.timeline-meta {
    font-size: 12px;
    color: var(--color-text-secondary);
}

/* 議程模態框 */
.schedule-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 10001;
    display: none;
}

.schedule-modal.show {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.schedule-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
}

.schedule-modal-overlay.show {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.schedule-modal-header {
    padding: 20px;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.schedule-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.schedule-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-bg-tertiary);
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.schedule-modal-close:hover {
    background: var(--color-brand);
    color: white;
}

.schedule-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

/* 時間感知通知 */
.time-aware-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    color: var(--color-text-primary);
    font-size: 14px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideUpNotification 0.3s ease-out;
}

.time-aware-notification.info {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1), rgba(0, 122, 255, 0.05));
    border-color: rgba(0, 122, 255, 0.3);
}

.time-aware-notification.success {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.1), rgba(52, 199, 89, 0.05));
    border-color: rgba(52, 199, 89, 0.3);
}

.time-aware-notification.warning {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.1), rgba(255, 149, 0, 0.05));
    border-color: rgba(255, 149, 0, 0.3);
}

.notification-action {
    padding: 4px 12px;
    background: var(--color-brand);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.notification-action:hover {
    background: var(--color-brand-dark);
    transform: scale(1.05);
}

/* 預載進度條 */
.preload-progress {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 4px;
    background: var(--color-bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    z-index: 1000;
    display: none;
}

.preload-progress.show {
    display: block;
}

.preload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-brand) 0%, var(--color-success) 100%);
    width: 0%;
    transition: width 0.5s ease;
}

/* 動畫 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideUpNotification {
    from {
        transform: translate(-50%, 20px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 響應式調整 */
@media (max-width: 768px) {
    .auto-switch-status {
        display: none;
    }
    
    .next-session-hint {
        top: auto;
        bottom: 60px;
        right: 10px;
        left: 10px;
    }
    
    .next-session-alert {
        font-size: 12px;
        padding: 10px 16px;
    }
    
    .schedule-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .timeline-item {
        padding: 10px;
        font-size: 13px;
    }
    
    .timeline-time {
        min-width: 50px;
        font-size: 12px;
    }
}