/*
 * mypage.css
 * 說明：此檔案專門用於 MyPage 及其相關頁面 (登入、註冊、個人資料等) 的樣式。
*/

/* ==========================================================================
   1. 認證頁面通用容器 (登入、註冊、忘記密碼等)
   ========================================================================== */
.auth-container {
    max-width: 450px;
    margin: 60px auto;
    padding: 40px;
    background: linear-gradient(135deg, var(--card-bg-color) 0%, rgba(255, 255, 255, 0.95) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4285f4, #34a853, #fbbc05, #ea4335);
    z-index: 1;
}

body.dark-theme .auth-container {
    background: linear-gradient(135deg, var(--card-bg-color) 0%, rgba(45, 55, 72, 0.95) 100%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.auth-title {
    text-align: center;
    font-size: 2em;
    margin-bottom: 25px;
    color: var(--primary-text-color);
    font-family: var(--font-primary);
    font-weight: 600;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9em;
}

.form-footer a {
    color: var(--secondary-text-color);
    text-decoration: underline;
    transition: color var(--transition-fast) ease;
}

.form-footer a:hover {
    color: var(--accent-color);
}


/* ==========================================================================
   2. 訊息提示框 (通用)
   ========================================================================== */
.message {
    padding: 12px 15px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9em;
    font-weight: 500;
    border: 1px solid transparent;
}

.error-message {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.2);
}

.success-message {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    border-color: rgba(25, 135, 84, 0.2);
}

body.dark-theme .error-message {
    background-color: rgba(255, 107, 129, 0.15);
    color: #ff9a9a;
    border-color: rgba(255, 107, 129, 0.25);
}

body.dark-theme .success-message {
    background-color: rgba(40, 167, 69, 0.15);
    color: #73d68b;
    border-color: rgba(40, 167, 69, 0.25);
}

/* ==========================================================================
   3. MyPage 主頁面樣式
   ========================================================================== */
#mypage-content .page-intro {
    margin-bottom: 40px;
}

.mypage-layout {
    display: flex;
    gap: 30px;
}

/* 3.1. 側邊欄 */
.mypage-sidebar {
    flex: 0 0 220px;
    background-color: var(--secondary-bg-color);
    padding: 20px;
    border-radius: var(--border-radius-md);
    height: fit-content;
    border: 1px solid var(--border-color);
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.mypage-sidebar h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color-strong);
    color: var(--primary-text-color);
}

ul.mypage-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul.mypage-nav li a {
    display: block;
    padding: 10px 15px;
    margin-bottom: 5px;
    color: var(--secondary-text-color);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    transition: background-color var(--transition-fast) ease, color var(--transition-fast) ease;
}

ul.mypage-nav li a:hover,
ul.mypage-nav li a.active-mypage-link {
    background-color: var(--accent-color);
    color: #FFFFFF;
}

body.dark-theme ul.mypage-nav li a:hover,
body.dark-theme ul.mypage-nav li a.active-mypage-link {
    color: var(--primary-bg-color);
}

ul.mypage-nav li a.logout-link {
    margin-top: 20px;
    color: #dc3545;
    font-weight: bold;
}

ul.mypage-nav li a.logout-link:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: #a71d2a;
}

body.dark-theme ul.mypage-nav li a.logout-link {
    color: #ff7b7b;
}

body.dark-theme ul.mypage-nav li a.logout-link:hover {
    background-color: rgba(255, 123, 123, 0.15);
    color: #ff9a9a;
}

.sidebar-toggle-btn {
    display: none;
}
.sidebar-content {
    display: block;
}

/* 3.2. 主要內容區域 */
.mypage-main-content {
    flex-grow: 1;
}

.mypage-section {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.mypage-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.mypage-section h4 {
    font-size: 1.6em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    color: var(--primary-text-color);
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
}

/* ==========================================================================
   4. MyPage 內容專用樣式
   ========================================================================== */
/* 4.1. 個人資料表單 */
.profile-form-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 15px 25px; 
}
.profile-form-grid .full-width { 
    grid-column: 1 / -1; 
}
#profile_overview .form-group label {
    text-shadow: none; /* 拿掉光暈效果 */
}
.passport-warning { 
    font-size: 0.8em; 
    color: var(--subtle-text-color);
    font-weight: 500; 
    margin-left: 5px; 
    display: block;
    margin-top: 4px;
}
body.dark-theme .passport-warning {
    color: #a8b2d1;
}

/* *** NEW: 個人資訊頁面標題與按鈕的容器 *** */
.profile-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
}
.profile-header-actions h4 {
    margin-bottom: 0; /* 移除標題的下邊距 */
    border-bottom: none; /* 移除標題的底線 */
    padding-bottom: 0;
    display: inline-block;
}
.profile-header-actions .cta-button {
    margin: 0; /* 移除按鈕的外邊距 */
}
/* *** END NEW *** */


/* 4.2 會員等級 */
.current-level-name {
    font-size: 1.2em; /* 調整字體大小以符合整體和諧 */
    font-weight: 700; 
    color: var(--accent-color);
    margin-left: 8px;
    /* 移除背景和陰影 */
    background-color: transparent; 
    padding: 0;
    text-shadow: none;
    border-radius: 0;
    display: inline;
}
.level-card { 
    border: 1px solid var(--border-color); 
    border-radius: var(--border-radius-sm); 
    padding: 15px; margin-bottom: 10px; 
    transition: all 0.2s ease; 
}
.level-card.current-level { 
    border-color: var(--accent-color); 
    box-shadow: 0 0 10px rgba(var(--rgb-accent), 0.3); 
}
.level-card h5 { 
    font-size: 1.1em; 
    color: var(--accent-color); 
    margin:0 0 5px 0; 
}
.level-card p { 
    margin: 0; 
    font-size: 0.9em; 
}

/* 4.3. 歷史記錄表格 */
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.9em;
}
.history-table th,
.history-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.history-table thead th {
    background-color: var(--secondary-bg-color);
    font-weight: 600;
    color: var(--primary-text-color);
}
.history-table tbody tr:hover {
    background-color: rgba(var(--rgb-accent, 0, 123, 255), 0.05);
}
.history-table .clickable-row {
    cursor: pointer;
}
body.dark-theme .history-table thead th {
    background-color: rgba(var(--rgb-accent), 0.1);
}
body.dark-theme .history-table tbody tr:hover {
    background-color: rgba(var(--rgb-accent), 0.15);
}

/* 4.4. 狀態標籤 */
.status-tag {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    border: none;
}
.status-tag[data-order-status="주문확정"] { background-color: #28a745; }
.status-tag[data-order-status="주문승인중"] { background-color: #ffc107; color: #212529; }
.status-tag[data-order-status="사용완료"] { background-color: #007bff; }
.status-tag[data-order-status="취소"] { background-color: #6c757d; }
.status-tag[data-order-status="취소승인중"] { background-color: #fd7e14; }
.status-tag[data-payment-status="결제완료"] { background-color: #28a745; }
.status-tag[data-payment-status="미결제"] { background-color: #dc3545; }
.status-tag[data-payment-status="결제실패"] { background-color: #6f42c1; }
.status-tag[data-payment-status="부분환불"] { background-color: #17a2b8; }
.status-tag[data-payment-status="전액환불"] { background-color: #343a40; }
.status-tag[data-inquiry-status="已回覆"] { background-color: #007bff; }
.status-tag[data-inquiry-status="確認中"] { background-color: #ffc107; color: #212529; }

/* 4.5. 無記錄提示 */
.no-records {
    color: var(--subtle-text-color);
    text-align: center;
    padding: 30px;
    font-size: 1.1em;
    font-style: italic;
}

/* ==========================================================================
   5. Modal 彈出視窗
   ========================================================================== */
.modal-overlay { 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.6); 
    display: none; 
    justify-content: center; 
    align-items: center; 
    z-index: 1050; 
}
.modal-content { 
    background-color: var(--card-bg-color); 
    padding: 25px; 
    border-radius: var(--border-radius-md); 
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); 
    width: 90%; 
    max-width: 600px; 
    max-height: 90vh; 
    overflow-y: auto; 
}
.modal-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 15px; 
    margin-bottom: 20px; 
}
.modal-header h3 { font-size: 1.2em; margin: 0; }
.modal-close-button { font-size: 1.8em; background: none; border: none; cursor: pointer; padding: 0; line-height: 1; }
.modal-body .inquiry-section { margin-bottom: 15px; }
.modal-body .inquiry-section h4 { 
    font-size: 1em; 
    color: var(--accent-color); 
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 5px; 
    margin-bottom: 10px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
.modal-body .inquiry-section h4 .timestamp { 
    font-size: 0.8em; 
    font-weight: 400; 
    color: var(--subtle-text-color); 
}
.modal-body .inquiry-section p { font-size: 0.95em; white-space: pre-wrap; word-wrap: break-word; }
.modal-footer { text-align: right; margin-top: 20px; }

/* Order Details Page Specifics */
.order-details-container { max-width: 800px; margin: 40px auto; }
.order-details-header { border-bottom: 2px solid var(--accent-color); padding-bottom: 15px; margin-bottom: 20px; }
.order-details-header h2 { font-size: 1.8em; margin: 0; }
.order-details-grid { display: grid; grid-template-columns: 150px 1fr; gap: 12px 20px; font-size: 1em; }
.order-details-grid strong { font-weight: 600; color: var(--primary-text-color); }
body.dark-theme .order-details-grid strong { color: var(--accent-color); }
.order-details-grid .section-title { grid-column: 1 / -1; margin-top: 15px; padding-top: 15px; border-top: 1px dashed var(--border-color); font-weight: bold; font-size: 1.1em; color: var(--primary-text-color); }
body.dark-theme .order-details-grid .section-title { color: white; }
.invoice-link { font-size: 1.2em; text-decoration: none; transition: transform .2s ease; display: inline-block;}
.invoice-link:hover { transform: scale(1.1); }


/* ==========================================================================
   6. 響應式設計
   ========================================================================== */
@media (max-width: 767.98px) {
    .auth-container {
        margin: 40px auto;
        padding: 25px;
    }
    .auth-title {
        font-size: 1.8em;
    }
    .mypage-layout {
        flex-direction: column;
    }
    .mypage-sidebar {
        flex: 0 0 auto;
        width: 100%;
        padding: 0;
        background: transparent;
        border: none;
    }
    .mypage-section h4 {
        font-size: 1.4em;
    }
    .history-table th,
    .history-table td {
        padding: 10px 8px;
        font-size: 0.95em;
    }
    .profile-form-grid {
        grid-template-columns: 1fr;
    }
    .order-details-grid {
        grid-template-columns: 100px 1fr;
    }

    /* --- 手機版可折疊側邊欄樣式 --- */
    .sidebar-toggle-btn {
        display: block;
        background-color: var(--secondary-bg-color);
        color: var(--primary-text-color);
        border: 1px solid var(--border-color);
        padding: 15px 20px;
        width: 100%;
        text-align: left;
        font-size: 1.1em;
        font-weight: 600;
        cursor: pointer;
        position: relative;
        border-radius: var(--border-radius-md);
        margin-bottom: 20px;
    }
    .sidebar-toggle-btn::after {
        content: '▼';
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%) rotate(0deg);
        transition: transform 0.3s ease;
    }
    .mypage-sidebar.open .sidebar-toggle-btn::after {
        transform: translateY(-50%) rotate(180deg);
    }
    
    .mypage-sidebar {
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
        max-height: 55px; /* Adjust this to match button height */
    }
    .mypage-sidebar.open {
        max-height: 500px; /* A large enough value to show all content */
    }

    .mypage-sidebar .sidebar-content {
        padding: 20px;
        background-color: var(--secondary-bg-color);
        border: 1px solid var(--border-color);
        border-top: none;
        border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
        margin-top: -1px; /* Overlap border */
    }
    .mypage-sidebar h3 {
        display: none; /* Hide original title on mobile */
    }
}

/* 讓會員等級的「達成條件」和「專屬優惠」標題更醒目 */
#membership-info .level-card p strong[data-translate-key="membership_level_condition"],
#membership-info .level-card p strong[data-translate-key="membership_level_benefits"] {
    color: var(--accent-secondary-color); /* 使用主題中的次要強調色，在淺色和深色模式下都很好看 */
    font-weight: 700; /* 加粗字體 */
    
}

/* 在深色模式下，讓光暈效果更明顯一點 */
body.dark-theme #membership-info .level-card p strong[data-translate-key="membership_level_condition"],
body.dark-theme #membership-info .level-card p strong[data-translate-key="membership_level_benefits"] {
    color: var(--accent-color);
}

/* --- 位於 mypage.css 檔案底部 --- */

/* 7. 會員等級進度條 */
.membership-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}
.membership-header h4 {
    margin-bottom: 0;
}
.current-level-summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.membership-progress-container {
    margin-bottom: 20px;
}
.progress-bar {
    width: 100%;
    height: 12px;
    background-color: var(--secondary-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}
.progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-secondary-color), var(--accent-color));
    border-radius: 6px;
    transition: width 0.5s ease-out;
    box-shadow: 0 0 8px rgba(var(--rgb-accent), 0.5);
}
.progress-text {
    text-align: right;
    font-size: 0.8em;
    font-weight: 500;
    color: var(--subtle-text-color);
    margin-top: 5px;
}
body.dark-theme .progress-bar {
    background-color: rgba(var(--rgb-primary-dark), 0.5);
}

/* 8. 回饋金與優惠券分頁 */
#rewards-coupons h5 {
    font-size: 1.2em;
    color: var(--accent-color);
    margin: 25px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
}
#rewards-coupons h5:first-child {
    margin-top: 0;
}
.rewards-summary {
    text-align: center;
    background-color: var(--secondary-bg-color);
    padding: 15px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
}
.rewards-summary h5 {
    margin: 0 0 5px 0;
    border: none;
    font-size: 1em;
}
.rewards-summary .points-total {
    font-size: 2em;
    font-weight: 700;
    color: var(--primary-text-color);
    margin: 0;
}
body.dark-theme .rewards-summary .points-total {
    color: var(--accent-hover-color);
    text-shadow: 0 0 8px var(--glow-color);
}
.points-positive {
    color: #28a745;
    font-weight: 600;
}
.points-negative {
    color: #dc3545;
    font-weight: 600;
}
body.dark-theme .points-positive { color: #73d68b; }
body.dark-theme .points-negative { color: #ff9a9a; }
.coupon-code {
    font-family: monospace;
    background-color: rgba(var(--rgb-accent), 0.1);
    color: var(--accent-color);
    padding: 3px 6px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
}

/* ==========================================================================
   Google 로그인 관련 스타일
   ========================================================================== */
.social-login-divider {
    text-align: center;
    margin: 35px 0 25px;
    position: relative;
    overflow: hidden;
}

.social-login-divider span {
    background: linear-gradient(135deg, var(--card-bg-color) 0%, rgba(255, 255, 255, 0.9) 100%);
    padding: 8px 20px;
    color: var(--secondary-text-color);
    font-size: 14px;
    font-weight: 500;
    position: relative;
    z-index: 2;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.social-login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--border-color) 20%, var(--accent-color) 50%, var(--border-color) 80%, transparent 100%);
    z-index: 1;
    transform: translateY(-50%);
}

/* 다크 테마에서의 소셜 로그인 구분선 */
body.dark-theme .social-login-divider span {
    background: linear-gradient(135deg, var(--card-bg-color) 0%, rgba(45, 55, 72, 0.9) 100%);
    border-color: var(--border-color);
}

.social-login-container {
    display: flex;
    justify-content: center;
    margin: 25px 0 20px;
}

.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e8eaed;
    border-radius: 12px;
    color: #202124;
    text-decoration: none;
    font-family: 'Google Sans', 'Segoe UI', Tahoma, sans-serif;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.25px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.google-login-btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-align: center;
}

.google-login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.google-login-btn:hover::before {
    left: 100%;
}

.google-login-btn:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e8f0fe 100%);
    border-color: #4285f4;
    box-shadow: 0 4px 16px rgba(66, 133, 244, 0.2);
    transform: translateY(-2px);
    text-decoration: none;
    color: #1a73e8;
}

.google-login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(66, 133, 244, 0.2);
}

.google-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    max-width: 20px;
    max-height: 20px;
    margin-right: 12px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.google-login-btn:hover .google-icon {
    transform: scale(1.1);
}

/* 다크 테마에서의 Google 로그인 버튼 */
body.dark-theme .google-login-btn {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    border-color: #4a5568;
    color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-theme .google-login-btn::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

body.dark-theme .google-login-btn:hover {
    background: linear-gradient(135deg, #4a5568 0%, #2b6cb0 100%);
    border-color: #4285f4;
    color: #90cdf4;
    box-shadow: 0 4px 16px rgba(66, 133, 244, 0.3);
}

/* Google 로그인 버튼 로딩 상태 */
.google-login-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.google-login-btn.loading .google-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 포커스 접근성 개선 */
.google-login-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.3);
}

/* 터치 디바이스 최적화 */
@media (pointer: coarse) {
    .google-login-btn {
        min-height: 48px;
        touch-action: manipulation;
    }
}

/* 반應式設計 */
@media (max-width: 480px) {
    .google-login-btn {
        height: 44px;
        min-height: 44px;
        max-height: 44px;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .google-icon {
        width: 18px;
        height: 18px;
        min-width: 18px;
        min-height: 18px;
        max-width: 18px;
        max-height: 18px;
        margin-right: 10px;
    }
}

/* 다크 테마에서의 소셜 로그인 스타일 */
body.dark-theme .social-login-divider span {
    background-color: var(--card-bg-color);
}

/* ==========================================================================
   첨部文件相關樣式
   ========================================================================== */

/* 問詢內頁表格的附件顯示 */
.attachment-indicator {
    margin-left: 8px;
    font-size: 0.9em;
    opacity: 0.7;
}

/* 彈出視窗的附件區域 */
.attachments-list {
    margin-top: 10px;
}

.attachment-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9em;
    transition: all var(--transition-speed) ease;
}

.attachment-item:hover {
    background-color: var(--hover-bg-color);
    border-color: var(--primary-color);
}

.attachment-item .file-icon {
    margin-right: 8px;
    font-size: 1.1em;
}

.attachment-item .file-name {
    flex: 1;
    margin-right: 8px;
    color: var(--primary-text-color);
    font-weight: 500;
}

.attachment-item .file-size {
    margin-right: 12px;
    color: var(--secondary-text-color);
    font-size: 0.85em;
}

.attachment-item .download-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all var(--transition-speed) ease;
}

.attachment-item .download-link:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 深色主題下的附件樣式 */
body.dark-theme .attachment-item {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .attachment-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .attachment-item .download-link:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ==========================================================================
   管理자 모드 첨부파일 관련 스타일
   ========================================================================== */

/* 관리자 테이블의 첨부파일 컬럼 */
.attachment-cell {
    text-align: center;
    min-width: 80px;
}

.attachment-count {
    background-color: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    display: inline-block;
}

.no-attachment {
    color: var(--secondary-text-color);
    font-style: italic;
}

/* 관리자 모달의 첨付파일 스타일 */
.admin-attachments {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.admin-attachment-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9em;
}

.admin-attachment-item:last-child {
    border-bottom: none;
}

.admin-attachment-item .file-icon {
    margin-right: 8px;
    font-size: 1.1em;
}

.admin-attachment-item .file-name {
    flex: 1;
    margin-right: 8px;
    color: var(--primary-text-color);
    font-weight: 500;
}

.admin-attachment-item .file-size {
    margin-right: 12px;
    color: var(--secondary-text-color);
    font-size: 0.85em;
}

.admin-download-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all var(--transition-speed) ease;
    border: 1px solid var(--primary-color);
}

.admin-download-link:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 다크 테마에서의 관리자 첨부파일 스타일 */
body.dark-theme .admin-attachments {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .admin-attachment-item {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .admin-download-link:hover {
    background-color: var(--primary-color);
    color: white;
}

/* *** NEW: Google 계정 연동 섹션 스타일 *** */
.google-account-section {
    margin-top: 30px;
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--secondary-bg-color); /* Use variable */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

/* *** NEW: 深色模式修正 *** */
body.dark-theme .google-account-section {
    background: var(--secondary-bg-color); /* Ensures it uses the dark theme's secondary bg */
    border-color: var(--border-color); /* Ensures it uses the dark theme's border color */
}

/* *** FIX for Dark Mode background issue in Google Status *** */
body.dark-theme .google-status {
    background-color: var(--primary-bg-color); /* Match the darker main BG */
    border-left-color: var(--accent-color);
}

body.dark-theme .google-unlink-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.2) 100%);
    border-color: #f59e0b;
}

body.dark-theme .google-unlink-warning small {
    color: #fde68a;
}

/* --- 【問題 #4 修正】狀態標籤顏色定義 --- */
/* 將這段新增至 mypage.css 檔案的末尾 */

/* 訂單狀態 Order Status */
.status-tag[data-order-status="주문확정"] { background-color: #28a745; }
.status-tag[data-order-status="사용완료"] { background-color: #007bff; }
.status-tag[data-order-status="주문승인중"] { background-color: #ffc107; color: #212529; }
.status-tag[data-order-status="취소승인중"] { background-color: #fd7e14; }
.status-tag[data-order-status="취소"] { background-color: #6c757d; }

/* 付款狀態 Payment Status */
.status-tag[data-payment-status="결제완료"] { background-color: #28a745; }
.status-tag[data-payment-status="미결제"] { background-color: #dc3545; }
.status-tag[data-payment-status="부분환불"] { background-color: #17a2b8; }
.status-tag[data-payment-status="전액환불"] { background-color: #343a40; }
.status-tag[data-payment-status="결제실패"] { background-color: #6f42c1; }

/* 諮詢狀態 Inquiry Status */
.status-tag[data-inquiry-status="해결"],
.status-tag[data-inquiry-status="已回覆"] { background-color: #28a745; }
.status-tag[data-inquiry-status="처리중"],
.status-tag[data-inquiry-status="確認中"] { background-color: #17a2b8; }
.status-tag[data-inquiry-status="미처리"] { background-color: #ffc107; color: #212529; }



/* /mypage/mypage.css */

/* ==========================================================================
   訂單詳情頁專屬樣式 (Order Details Page)
   ========================================================================== */

.details-page-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 15px;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--accent-color);
}
.page-header h2 {
    font-size: 2em;
    margin: 0;
    color: var(--primary-text-color);
}
.page-actions { 
    display: flex;
    gap: 10px; 
}
.details-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}
.main-column { 
    display: flex; 
    flex-direction: column; 
    gap: 30px; 
}
.sidebar-column { 
    position: sticky; 
    top: 100px; /* 您可以根據 header 的高度微調這個值 */
}
.info-card {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}
.info-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-hover-shadow);
}
.info-card-header {
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-color);
}
.info-card-header h3 {
    font-size: 1.2em;
    font-weight: 600;
    margin: 0;
    color: var(--primary-text-color);
}
.info-card-body { 
    padding: 25px; 
}
.detail-list { 
    display: flex; 
    flex-direction: column; 
    gap: 18px; 
}
.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.95em;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
}
.detail-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.detail-item strong { 
    color: var(--subtle-text-color); 
    font-weight: 500;
}
.detail-item span, .detail-item a { 
    font-weight: 600; 
    text-align: right; 
    color: var(--primary-text-color);
}
/* 憑證列表樣式 */
.voucher-list { 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
}
.voucher-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background-color: var(--secondary-bg-color);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}
.voucher-thumbnail {
    width: 100px; 
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--border-color);
}
.voucher-info-text a, .voucher-info-text span {
    font-weight: 500;
    color: var(--accent-color);
    text-decoration: none;
}
.voucher-info-text a:hover {
    text-decoration: underline;
}
/* 圖片燈箱 */
.lightbox {
    display: none; 
    position: fixed; 
    z-index: 9999;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    justify-content: center; 
    align-items: center;
    cursor: pointer;
}
.lightbox img { 
    max-width: 90%; 
    max-height: 90%; 
    border-radius: 8px;
}
@media (max-width: 991.98px) {
    .details-layout { 
        grid-template-columns: 1fr; 
    }
    .sidebar-column { 
        order: -1; 
        position: static; 
        margin-bottom: 30px; 
    }
}
@media print {
    body { background: #fff !important; color: #000 !important; }
    header, footer, .page-header, .mypage-sidebar, .page-actions { display: none !important; }
    .details-page-container { max-width: 100%; margin: 0; padding: 0; }
    .info-card { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
    .details-layout { display: block; }
}
/* *** END NEW *** */