/* 我的收藏老師頁面 */
.favorites-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 40px 100px;
    min-height: calc(100vh - 76px);
}

/* 頁面標題 */
.favorites-header {
    text-align: center;
    margin-bottom: 45px;
}
.favorites-header h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    font-size: 36px;
    font-weight: 800;
    color: var(--text-dark);
}
.favorites-header h1 svg {
    width: 36px;
    height: 36px;
    color: var(--primary);
}
.favorites-header p {
    margin-top: 16px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-gray);
}

/* 收藏清單 */
.favorites-content {
    width: 100%;
}
#favorites-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

/* 載入中 */
#favorites-loading {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-gray);
    font-size: 16px;
}

/* 尚無收藏老師 */
#favorites-empty {
    text-align: center;
    padding: 65px 24px;

    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
}
#favorites-empty[hidden] {
    display: none;
}
#favorites-empty > svg {
    width: 52px;
    height: 52px;
    color: var(--primary);
    margin-bottom: 20px;
}
#favorites-empty h2 {
    font-size: 23px;
    margin-bottom: 12px;
}
#favorites-empty p {
    color: var(--text-gray);
    line-height: 1.8;
    margin-bottom: 28px;
}
#favorites-empty a {
    display: inline-block;
    padding: 12px 28px;

    background: var(--primary);
    color: var(--white);
    border-radius: 10px;
    font-weight: 600;

    transition: background 0.2s;
}
#favorites-empty a:hover {
    background: var(--primary-dark);
}

/* 收藏老師卡片 */
.favorite-teacher-card {
    position: relative;
}
/* 卡片右上角的收藏愛心 */
.favorite-heart-button {
    position: absolute;
    top: 16px;
    right: 16px;

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #fff3eb;
    color: var(--primary);
    border: none;
    border-radius: 50%;

    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
/* 已收藏：實心愛心 */
.favorite-heart-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}
/* 滑鼠移入 */
.favorite-heart-button:hover:not(:disabled) {
    background: #ffe3d0;
    transform: scale(1.08);
}
/* 鍵盤操作 */
.favorite-heart-button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}
/* 尚未啟用時保留正常外觀 */
.favorite-heart-button:disabled {
    cursor: default;
    opacity: 1;
}

/* 未登入會員提示 */
/* 尚未登入：鎖定背景捲動 */
html:has(body.favorites-login-required) {
    overflow: hidden;
}
body.favorites-login-required {
    background: #fff8f1;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}
/* 未登入提示：外層背景與置中 */
#favorites-login-required {
    position: fixed;
    top: 100px;
    left: 0;
    right: 0;
    bottom: 0;

    z-index: 900;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 32px 20px;
    background: #fff8f1;
    overflow-y: auto;
}
/* 隱藏未登入提示 */
#favorites-login-required[hidden] {
    display: none;
}
/* TutorLink 登入提示卡片 */
.favorites-login-card {
    width: 100%;
    max-width: 500px;
    padding: 48px 36px;

    text-align: center;
    background: #ffffff;
    border: 1px solid #ffe1cc;
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(255, 121, 40, 0.08);
}
/* 鎖頭圖示 */
.favorites-login-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    background: #fff0e5;
    color: #ff7928;
}
.favorites-login-icon svg {
    width: 34px;
    height: 34px;
}
/* 提示標題 */
#favorites-login-required h2 {
    margin: 0 0 14px;
    font-size: 26px;
    font-weight: 700;
    color: #292929;
}
/* 提示說明 */
#favorites-login-required p {
    margin: 0 auto 28px;
    max-width: none;
    color: #777777;
    font-size: 15px;
    line-height: 1.9;
}
/* 立即登入按鈕 */
#favorites-login-button {
    width: 100%;
    max-width: 240px;
    padding: 14px 24px;

    border: none;
    border-radius: 12px;
    background: #ff7928;
    color: #ffffff;

    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
#favorites-login-button:hover {
    background: #ed6819;
}
/* 登入視窗顯示在通知上方 */
#auth-modal {
    z-index: 1000;
}

/* RWD 平板 */
@media (max-width: 900px) {
    #favorites-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* RWD 手機 */
@media (max-width: 600px) {
    .favorites-page {
        padding: 40px 20px 70px;
    }
    .favorites-header h1 {
        font-size: 28px;
    }
    .favorites-header h1 svg {
        width: 28px;
        height: 28px;
    }
    .favorites-header p {
        font-size: 14px;
    }
    #favorites-list {
        grid-template-columns: 1fr;
    }
    #favorites-empty {
        padding: 50px 20px;
    }
    .favorites-login-card {
        padding: 36px 24px;
    }
    #favorites-login-required {
        padding: 36px 24px;
    }
    #favorites-login-required h2 {
        font-size: 23px;
    }
}
