/* ============================================
   電商會員認證系統樣式
   ============================================ */

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.auth-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: authSlideIn 0.3s ease-out;
}

@keyframes authSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.auth-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.auth-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.auth-close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.auth-modal-body {
    padding: 24px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    outline: none;
}

.form-group input:focus {
    border-color: #1a1a1a;
}

.auth-error {
    padding: 10px 14px;
    background: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 8px;
    color: #cf1322;
    font-size: 14px;
}

.auth-submit-btn {
    padding: 14px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.auth-submit-btn:hover {
    background: #333;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    font-size: 14px;
    color: #666;
}

.auth-switch a {
    color: #1a1a1a;
    text-decoration: underline;
    margin-left: 4px;
    cursor: pointer;
}

/* 暗色模式 */
body.dark-mode .auth-modal-content {
    background: #1a1a1a;
    color: #fff;
}

body.dark-mode .auth-modal-header {
    border-bottom-color: #333;
}

body.dark-mode .auth-modal-header h2 {
    color: #fff;
}

body.dark-mode .auth-close-btn {
    color: #999;
}

body.dark-mode .auth-close-btn:hover {
    background: #333;
    color: #fff;
}

body.dark-mode .form-group label {
    color: #ddd;
}

body.dark-mode .form-group input {
    background: #2a2a2a;
    border-color: #444;
    color: #fff;
}

body.dark-mode .form-group input:focus {
    border-color: #fff;
}

body.dark-mode .auth-error {
    background: #3a1215;
    border-color: #5c1f23;
    color: #ff7875;
}

body.dark-mode .auth-submit-btn {
    background: #fff;
    color: #1a1a1a;
}

body.dark-mode .auth-submit-btn:hover {
    background: #e0e0e0;
}

body.dark-mode .auth-switch {
    border-top-color: #333;
    color: #999;
}

body.dark-mode .auth-switch a {
    color: #fff;
}

/* 用戶按鈕樣式 */
#userAuthBtn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all 0.2s;
}

#userAuthBtn:hover {
    background: #f5f5f5;
}

body.dark-mode #userAuthBtn {
    border-color: #444;
    color: #ddd;
}

body.dark-mode #userAuthBtn:hover {
    background: #2a2a2a;
}

/* 移動端適配 */
@media (max-width: 480px) {
    .auth-modal-content {
        width: 95%;
        max-width: none;
        margin: 20px;
    }

    .auth-modal-header {
        padding: 16px 20px 12px;
    }

    .auth-modal-body {
        padding: 20px;
    }
}

/* ============================================
   用戶信息彈窗（毛玻璃效果）
   ============================================ */
.user-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.user-modal-content {
    position: relative;
    width: 90%;
    max-width: 380px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: userModalSlideIn 0.3s ease-out;
    overflow: hidden;
}

@keyframes userModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.user-modal-header {
    padding: 24px 24px 16px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-modal-header i {
    font-size: 48px;
    color: #d4af37;
    margin-bottom: 12px;
    display: block;
}

.user-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.user-modal-body {
    padding: 20px 24px;
}

.user-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.user-info-row:last-child {
    border-bottom: none;
}

.user-info-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.user-info-value {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
}

.user-level-pro {
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-modal-footer {
    padding: 16px 24px 24px;
}

.user-modal-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-modal-btn.primary {
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: #fff;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}

.user-modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.4);
}

/* 亮色模式適配 */
body:not(.dark-mode) .user-modal-content {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body:not(.dark-mode) .user-modal-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body:not(.dark-mode) .user-modal-header h3 {
    color: #1a1a1a;
}

body:not(.dark-mode) .user-info-row {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

body:not(.dark-mode) .user-info-label {
    color: #666;
}

body:not(.dark-mode) .user-info-value {
    color: #1a1a1a;
}

/* 移動端適配 */
@media (max-width: 480px) {
    .user-modal-content {
        width: 92%;
        border-radius: 16px;
    }

    .user-modal-header {
        padding: 20px 20px 12px;
    }

    .user-modal-header i {
        font-size: 40px;
    }

    .user-modal-body {
        padding: 16px 20px;
    }

    .user-modal-footer {
        padding: 12px 20px 20px;
    }
}

/* ============================================
   用戶中心徽章樣式
   ============================================ */
#userAuthBtn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
    color: inherit;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#userAuthBtn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.user-center-label {
    color: inherit;
    opacity: 0.8;
}

.user-tier-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-tier-badge.tier-pro {
    background: #3b82f6;
    color: #fff;
}

.user-tier-badge.tier-annual {
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: #fff;
}

.user-tier-badge.tier-starter {
    background: #10b981;
    color: #fff;
}

.user-tier-badge.tier-free {
    background: #6b7280;
    color: #fff;
}

.user-name {
    font-weight: 500;
}

/* 導航按鈕樣式 */
.shop-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    color: inherit;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.shop-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.shop-nav-btn i {
    font-size: 14px;
}

/* 亮色模式 */
body:not(.dark-mode) #userAuthBtn,
body:not(.dark-mode) .shop-nav-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

body:not(.dark-mode) #userAuthBtn:hover,
body:not(.dark-mode) .shop-nav-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* 移動端適配 */
@media (max-width: 768px) {
    #userAuthBtn {
        padding: 6px 12px;
        font-size: 12px;
        gap: 6px;
    }

    .user-tier-badge {
        padding: 1px 8px;
        font-size: 10px;
    }

    .shop-nav-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
}

/* ============================================
   移动端布局優化（解決按鈕遮擋標題問題）
   ============================================ */

/* 平板及以下屏幕 */
@media (max-width: 768px) {
    /* 頂部切換欄縮小尺寸和間距 */
    .toggle-bar {
        top: 0.8rem !important;
        right: 0.8rem !important;
        gap: 0.3rem !important;
    }

    /* 所有切換按鈕縮小 */
    .toggle-btn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.75rem !important;
        min-height: 32px !important;
    }

    /* 用戶中心按鈕縮小 */
    #userAuthBtn {
        padding: 4px 10px !important;
        font-size: 11px !important;
        gap: 4px !important;
    }

    .user-tier-badge {
        padding: 1px 6px !important;
        font-size: 9px !important;
    }

    /* 增加header頂部padding，避免標題被遮擋 */
    .shop-header {
        padding-top: 3.5rem !important;
    }

    /* 導航按鈕也縮小 */
    .shop-nav-btn {
        padding: 8px 14px !important;
        font-size: 12px !important;
    }
}

/* 手機屏幕 */
@media (max-width: 480px) {
    .toggle-bar {
        top: 0.6rem !important;
        right: 0.6rem !important;
        gap: 0.25rem !important;
    }

    .toggle-btn {
        padding: 0.3rem 0.6rem !important;
        font-size: 0.7rem !important;
        min-height: 28px !important;
    }

    #userAuthBtn {
        padding: 3px 8px !important;
        font-size: 10px !important;
        gap: 3px !important;
    }

    .user-center-label {
        display: none !important; /* 隱藏「用戶中心：」文字，節省空間 */
    }

    .shop-header {
        padding-top: 3rem !important;
    }

    .shop-nav {
        gap: 8px !important;
        margin-top: 12px !important;
    }

    .shop-nav-btn {
        padding: 6px 12px !important;
        font-size: 11px !important;
    }
}

/* 超小屏幕 */
@media (max-width: 360px) {
    .toggle-bar {
        top: 0.5rem !important;
        right: 0.5rem !important;
    }

    #userAuthBtn {
        padding: 2px 6px !important;
        font-size: 9px !important;
    }

    .shop-header h1 {
        font-size: 1.2rem !important;
    }
}

/* 導航按鈕樣式升級 */
.shop-nav-btn {
    padding: 12px 24px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    border: 1px solid rgba(212, 175, 55, 0.4) !important;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3), 0 0 20px rgba(212, 175, 55, 0.1) !important;
}
.shop-nav-btn:hover {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 30px rgba(212, 175, 55, 0.25) !important;
}

/* ============================================
   細節微調
   ============================================ */

/* 1. 金色光暈面積調小 */
.shop-nav-btn {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 8px rgba(212, 175, 55, 0.15) !important;
}

.shop-nav-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 0 12px rgba(212, 175, 55, 0.25) !important;
}

/* 2. 導航按鈕和副標題之間加空行（增加margin-bottom） */
.shop-nav {
    margin-bottom: 12px !important;
}

/* 3. 移動端標題字號再增大 */
@media (max-width: 768px) {
    .shop-header h1 {
        font-size: 1.6rem !important;
    }
}

@media (max-width: 480px) {
    .shop-header h1 {
        font-size: 1.5rem !important;
    }
}

/* ============================================
   溫馨版用戶彈窗
   ============================================ */
.user-modal-content {
    max-width: 340px;
}

.user-modal-header {
    padding: 28px 24px 16px;
    text-align: center;
    border-bottom: none;
}

.user-avatar-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37, #b8941f);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}

.user-avatar-circle i {
    font-size: 28px;
    color: #fff;
    margin: 0;
}

.user-modal-header h3 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
}

.user-welcome-name {
    margin: 0;
    font-size: 14px;
    opacity: 0.7;
}

.user-modal-body {
    padding: 16px 24px;
    text-align: center;
}

.user-tier-banner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.user-tier-banner.tier-free {
    background: rgba(107, 114, 128, 0.15);
}

.user-tier-banner.tier-starter {
    background: rgba(16, 185, 129, 0.15);
}

.user-tier-banner.tier-pro {
    background: rgba(59, 130, 246, 0.15);
}

.user-tier-banner.tier-annual {
    background: rgba(212, 175, 55, 0.15);
}

.tier-label {
    font-size: 13px;
    opacity: 0.8;
}

.tier-value {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
}

.user-thanks {
    margin: 0;
    font-size: 13px;
    opacity: 0.6;
    line-height: 1.5;
}

.user-modal-footer {
    padding: 8px 24px 24px;
}

/* 亮色模式適配 */
body:not(.dark-mode) .user-modal-header h3 {
    color: #1a1a1a;
}

body:not(.dark-mode) .user-welcome-name {
    color: #666;
}

body:not(.dark-mode) .user-thanks {
    color: #666;
}
