/* ========================================
   社務所新手教學 CSS
   參考 ema-onboarding 的全螢幕風格
   ======================================== */

/* 教學遮罩層 */
.tutorial-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 提示文字 */
.tutorial-hint {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #4a3728;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: hint-bounce 1s ease-in-out infinite;
}

@keyframes hint-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

/* 高亮元素（穿透遮罩，不改變定位） */
.tutorial-highlight {
    z-index: 510 !important;
    animation: tutorial-pulse 1.5s ease-in-out infinite;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* 只提升層級，不發光（用於選單等容器） */
.tutorial-above {
    position: fixed !important;
    z-index: 510 !important;
    pointer-events: auto !important;
}

@keyframes tutorial-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 8px #fff) 
                drop-shadow(0 0 15px rgba(255, 215, 0, 0.9)) 
                drop-shadow(0 0 25px rgba(255, 215, 0, 0.7));
    }
    50% {
        filter: drop-shadow(0 0 12px #fff) 
                drop-shadow(0 0 25px rgba(255, 215, 0, 1)) 
                drop-shadow(0 0 40px rgba(255, 215, 0, 0.8));
    }
}

/* 選單按鈕專用強化發光 */
.qbei-menu-btn-img.tutorial-highlight {
    animation: tutorial-pulse-strong 1s ease-in-out infinite !important;
}

@keyframes tutorial-pulse-strong {
    0%, 100% {
        filter: drop-shadow(0 0 10px #fff) 
                drop-shadow(0 0 20px #fff) 
                drop-shadow(0 0 35px rgba(255, 215, 0, 1))
                drop-shadow(0 0 50px rgba(255, 180, 0, 0.9));
        transform: scale(1.05);
    }
    50% {
        filter: drop-shadow(0 0 15px #fff) 
                drop-shadow(0 0 30px #fff) 
                drop-shadow(0 0 50px rgba(255, 215, 0, 1))
                drop-shadow(0 0 80px rgba(255, 180, 0, 1));
        transform: scale(1.15);
    }
}

/* ========================================
   簡單提示
   ======================================== */

/* 簡單提示（不帶遮罩，顯示在畫面下方） */
.tutorial-simple-hint {
    position: fixed;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #4a3728;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9998;
    animation: hint-bounce 1s ease-in-out infinite;
}

/* 跳過教學按鈕 */
.tutorial-skip-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 600;
    padding: 0.6rem 1.2rem;
    background: rgba(0, 0, 0, 0.6);
    color: #aaa;
    border: 1px solid #666;
    border-radius: 25px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tutorial-skip-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-color: #999;
}

/* ========================================
   對話框 Modal（全螢幕）
   ======================================== */

.tutorial-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    padding-bottom: 10%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tutorial-dialog-overlay.active {
    opacity: 1;
    visibility: visible;
}

.tutorial-dialog-box {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    background: linear-gradient(135deg, #fff8e7 0%, #fff 100%);
    border: 5px solid #8b4513;
    border-radius: 20px;
    padding: 2rem 2.5rem;
    max-width: 700px;
    width: 90%;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.8);
    transform: translateY(50px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.tutorial-dialog-overlay.active .tutorial-dialog-box {
    transform: translateY(0);
}

/* Q北頭像 */
.tutorial-dialog-avatar {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #8b4513;
    background: #fff8e7;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tutorial-dialog-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 對話內容 */
.tutorial-dialog-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80px;
}

.tutorial-dialog-text {
    font-size: 1.3rem;
    color: #4a3728;
    line-height: 1.8;
    font-family: 'Noto Sans TC', sans-serif;
    margin: 0;
}

/* 點擊提示 */
.tutorial-dialog-indicator {
    text-align: right;
    color: #8b4513;
    font-size: 1rem;
    animation: indicator-blink 0.8s ease-in-out infinite;
    margin-top: 0.5rem;
}

@keyframes indicator-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ========================================
   響應式
   ======================================== */

@media (max-width: 768px) {
    .tutorial-dialog-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .tutorial-dialog-avatar {
        width: 80px;
        height: 80px;
    }
    
    .tutorial-dialog-text {
        font-size: 1.1rem;
    }
    
    .tutorial-hint {
        font-size: 1rem;
        padding: 0.8rem 1.5rem;
    }
}
