/* JexHRAI Shortcode Cover Styles - Material Design 3 Style */
/*
 * 封面樣式統一管理 (MD3 Redesign)：
 * - 模組封面：採用 Elevated Card 風格，強調層次與內容
 * - 登入封面：採用 Outlined/Filled Card 混合風格
 *
 * 設計語言：Material Design 3
 * 變數來源：variables.css (嚴格遵守)
 */

/* ==========================================
 * 主封面容器 (Main Container - MD3 Card)
 * ========================================== */

.jexhrai-cover-container {
    /* 呼吸動畫變數 (保留原有 JS 邏輯介接) */
    --jexhrai-ring-strength: 0;

    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;

    /* 佈局與尺寸 */
    max-width: 680px;
    margin: 24px auto;
    /* MD3 Grid 8px base */
    padding: 48px 32px;
    /* 增加留白 */

    /* 外觀 - MD3 Surface Container Low */
    background: var(--jexhrai-bg-white);
    background: linear-gradient(180deg, var(--jexhrai-bg-white) 0%, var(--jexhrai-cover-bg-gradient-end) 100%);
    border: 0px solid var(--jexhrai-border-light);
    /* MD3 Outlined Card 變體 */
    border-radius: var(--jexhrai-radius-lg);
    /* 25px - 符合 MD3 大卡片圓角 */

    /* 初始狀態 */
    box-shadow: var(--md-sys-elevation-1);
    opacity: 0;
    transform: translateY(10px);
    /* 進入動畫預備位置 */

    /* 轉場 */
    transition: var(--jexhrai-transition-standard);

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    z-index: 1;
}

/* 互動狀態 - Hover */
.jexhrai-cover-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 0 10px var(--jexhrai-container-glow);
    border-color: var(--jexhrai-container-hover-border);
}

/* 狀態：淡出（關閉封面時使用，與主內容交叉淡入淡出） */
.jexhrai-cover-container.fade-out,
.jexhrai-cover-container.shrink-exit {
    opacity: 0;
    transform: translateY(-15px) scale(0.85);
    transition: opacity 0.6s cubic-bezier(0.4, 0.0, 0.2, 1),
        transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* 狀態：呼吸動畫 (優化為柔和的光暈脈衝) */
.jexhrai-cover-container.breathing {
    animation: jexhrai-md3-pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    border-color: var(--jexhrai-primary);
}

.jexhrai-cover-container.breathing-out {
    animation: none;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

/* ==========================================
 * 封面內容元素 (Content Elements)
 * ========================================== */

/* Canvas 容器 */
.jexhrai-cover-canvas {
    width: 300px;
    height: 200px;
    margin-bottom: 1rem;
    display: block;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 4px 6px var(--md-sys-color-shadow));
    /* 增加圖示立體感 */
}

/* 背景裝飾 Canvas */
.jexhrai-cover-bg-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

/* 標題 - MD3 Headline Small/Medium */
.jexhrai-cover-title {
    font-size: 2.5rem;
    /* 32px */
    line-height: 1.25;
    font-weight: 700;
    /* MD3 偏好 400-700 */
    color: var(--jexhrai-cover-text-dark);
    letter-spacing: -0.01em;
    margin: 0 0 12px 0;
    position: relative;
    z-index: 2;
}

/* 副標題 - MD3 Title Medium */
.jexhrai-cover-subject {
    font-size: 1.125rem;
    /* 18px */
    line-height: 1.5;
    font-weight: 500;
    color: var(--jexhrai-primary-hover);
    /* 使用深一點的品牌色強調 */
    margin: 0 0 16px 0;
    position: relative;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 介紹文字 - MD3 Body Large */
.jexhrai-cover-introduction {
    font-size: 1rem;
    /* 16px */
    line-height: 1.6;
    color: var(--jexhrai-cover-text-medium);
    margin: 0 0 40px 0;
    max-width: 520px;
    /* 限制寬度增加可讀性 */
    position: relative;
    z-index: 2;
}

/* ==========================================
 * 按鈕樣式 (MD3 Filled Button)
 * ========================================== */

.jexhrai-cover-start-button {
    /* 佈局 */
    display: inline-flex;
    align-items: center;
    justify-content: center;

    /* 尺寸 - MD3 標準高度 40px */
    height: 48px;
    /* 加大至 48px 提升觸控體驗 */
    padding: 0 32px;
    min-width: 140px;

    /* 外觀 */
    background-color: var(--jexhrai-cover-primary);
    color: var(--jexhrai-text-main);
    /* On Primary Color */
    border: none;
    border-radius: var(--jexhrai-radius-btn);
    /* 100px - Stadium shape */

    /* 排版 - MD3 Label Large */
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;

    /* 互動 */
    cursor: pointer;
    position: relative;
    z-index: 2;
    overflow: hidden;
    /* 為 Ripple 效果準備 (如有) */

    /* 陰影與轉場 */
    box-shadow: var(--md-sys-elevation-1);
    transition: all 0.2s cubic-bezier(0.2, 0.0, 0, 1.0);
}

/* State Layer: Hover */
.jexhrai-cover-start-button:hover {
    background-color: var(--jexhrai-cover-primary-hover);
    color: var(--md-sys-color-on-secondary);
    /* 深色背景反白 */
    box-shadow: var(--md-sys-elevation-2);
    transform: translateY(-1px);
}

/* State Layer: Active/Pressed */
.jexhrai-cover-start-button:active {
    background-color: var(--jexhrai-cover-primary-active);
    box-shadow: var(--md-sys-elevation-0);
    transform: translateY(1px);
}

/* 焦點狀態 (Accessibility) */
.jexhrai-cover-start-button:focus-visible {
    outline: 2px solid var(--jexhrai-text-main);
    outline-offset: 2px;
}

.jexhrai-cover-image {
    display: none;
}

/* ==========================================
 * 主內容容器控制 (Main Content Control)
 * ========================================== */
/* 保持與原設計一致的顯隱邏輯 */

.jexhrai-main-content-container {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s cubic-bezier(0.4, 0.0, 0.2, 1),
        transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform: translateY(20px);
    display: none;
}

.jexhrai-main-content-container.visible {
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* MD3 Grid 調整 */
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cover-active .jexhrai-main-content-container {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ==========================================
 * 登入封面 (Login Cover - MD3 Card)
 * ========================================== */

.jexhrai-login-cover {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    /* 卡片樣式 */
    background-color: var(--jexhrai-bg-white);
    border: 1px solid var(--jexhrai-border-light);
    border-radius: var(--jexhrai-radius-md);
    /* 15px */

    padding: 40px 24px;
    text-align: center;
    margin: 20px auto;
    max-width: 640px;

    /* MD3 Elevation */
    box-shadow: var(--md-sys-elevation-1);
}

.jexhrai-login-cover>div {
    width: 100%;
    z-index: 1;
}

.jexhrai-login-cover .dashicons-lock {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: var(--jexhrai-cover-primary);
    margin-bottom: 16px;
    /* 增加圖示背景圓圈 - MD3 風格 */
    background: var(--jexhrai-bg-light);
    padding: 12px;
    border-radius: 50%;
    box-sizing: content-box;
}

.jexhrai-login-cover h2 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    /* Headline Small */
    font-weight: 600;
    color: var(--jexhrai-text-main);
}

.jexhrai-login-cover p {
    margin: 0 0 24px;
    font-size: 0.95rem;
    /* Body Medium */
    color: var(--jexhrai-text-secondary);
    line-height: 1.5;
}

/* 登入按鈕 - MD3 Tonal Button 風格 */
.jexhrai-login-cover-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 10px 24px;
    border-radius: var(--jexhrai-radius-btn);

    background-color: var(--jexhrai-bg-light);
    /* Secondary Container */
    color: var(--jexhrai-text-main);
    /* On Secondary Container */
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.jexhrai-login-cover-button:hover {
    background-color: var(--jexhrai-border-light);
}

.jexhrai-login-cover .note {
    margin-top: 16px;
    font-size: 0.75rem;
    /* Body Small */
    color: var(--jexhrai-text-muted);
}

/* 背景裝飾 */
.jexhrai-login-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at top right, color-mix(in srgb, var(--md-sys-color-primary), transparent 90%), transparent 70%);
    border-radius: inherit;
}

/* 登入封面響應式 */
.jexhrai-login-cover.responsive-center {
    min-height: 60vh;
    margin: 20px;
}

/* ==========================================
 * 動畫定義 (Animations - MD3 Style)
 * ========================================== */

/* 脈衝動畫：模擬呼吸燈，但更柔和，強調邊框與光暈 */
@keyframes jexhrai-md3-pulse {
    0% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--md-sys-color-primary), transparent 60%);
        border-color: var(--jexhrai-cover-border);
    }

    50% {
        box-shadow: 0 0 0 6px color-mix(in srgb, var(--md-sys-color-primary), transparent 85%);
        border-color: var(--jexhrai-primary);
    }

    100% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--md-sys-color-primary), transparent 100%);
        border-color: var(--jexhrai-cover-border);
    }
}

/* ==========================================
 * 響應式設計 (Responsive)
 * ========================================== */

@media (max-width: 600px) {
    .jexhrai-cover-container {
        padding: 32px 20px;
        margin: 16px;
        border-radius: var(--jexhrai-radius-md);
        /* 手機版圓角稍微縮小 */
    }

    .jexhrai-cover-title {
        font-size: 1.75rem;
    }

    .jexhrai-cover-introduction {
        font-size: 0.95rem;
        margin-bottom: 32px;
    }

    .jexhrai-cover-canvas {
        width: 300px;
        height: 180px;
    }

    .jexhrai-login-cover.responsive-center {
        min-height: 50vh;
        padding: 24px 16px;
    }
}