/* ============================================================================
   🎨 member-style.css: สไตล์เฉพาะฝั่งสมาชิก (SmartWelf Member Portal)
   (ทำงานร่วมกับ style-shared.css โดยตัดโค้ดที่ซ้ำซ้อนออกทั้งหมด)
============================================================================ */

/* 📌 1. พื้นหลังโค้งส่วนหัวของแอปสมาชิก (Hero Curved Background) */
.app-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 215px;
    background: linear-gradient(135deg, #0B192C 0%, #1A365D 40%, #2563EB 100%);
    border-bottom-left-radius: 35px;
    border-bottom-right-radius: 35px;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.2);
    z-index: 0;
}

.app-header {
    padding: 20px 16px 10px 16px;
    display: flex;
    justify-content: center !important;
    align-items: center;
    text-align: center !important;
    background: transparent !important;
    color: #FFFFFF;
    position: relative;
    z-index: 10;
}
.app-header h4 { color: #FFFFFF !important; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); }
.app-header p { color: rgba(255, 255, 255, 0.85) !important; }

.card-box {
    background: #FFFFFF;
    padding: 24px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    max-width: 520px;
    margin: 10px auto 28px;
    position: relative;
    border: 1px solid var(--card-border);
    z-index: 10;
}

.section-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    text-align: left;
}

/* 📌 2. ส่วนโปรไฟล์และป้ายสถานะ (Profile & Status Badges) */
.fintech-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px !important;
    padding: 0 10px;
    position: relative;
    z-index: 10;
    background: transparent;
}
.fintech-profile-header h5 {
    color: #FFFFFF !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.fintech-profile-header .profile-img {
    margin-top: 0;
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 2;
}

.profile-avatar-wrapper { transition: transform 0.2s ease; }
.profile-avatar-wrapper:active { transform: scale(0.92); }

.profile-wrapper {
    position: relative;
    margin-top: -65px;
    text-align: center;
    margin-bottom: 15px;
}

.profile-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #FFFFFF;
    background: #FFFFFF;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.badge-status,
.badge-tier {
    height: 26px !important;
    padding: 0 14px !important;
    border-radius: 20px !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    white-space: nowrap !important;
    line-height: 1 !important;
}

.status-pending { background-color: #FEF3C7; color: #D97706; border: 1px solid #FDE68A; }
.status-active { background-color: #D1FAE5; color: #059669; border: 1px solid #A7F3D0; }
.status-inactive { background-color: #FEE2E2; color: #DC2626; border: 1px solid #FECACA; }
.badge-tier { color: #FFFFFF; gap: 6px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }

/* 📌 3. ALL-IN-ONE WALLET HUB & QUICK ACTIONS */
.wallet-hub-card {
    background: #FFFFFF;
    border-radius: 22px;
    padding: 14px 14px 12px 14px;
    margin-top: 14px;
    margin-bottom: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.09);
    border: 1px solid rgba(37, 99, 235, 0.1);
    position: relative;
    z-index: 12;
}

.wallet-hub-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 10px;
    border-bottom: 1px dashed #E2E8F0;
}

.wallet-balance-col {
    flex: 1.15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 12px;
    border-right: 1px solid #F1F5F9;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s;
}
.wallet-balance-col:active,
.wallet-points-col:active { opacity: 0.75; }

.wallet-points-col {
    flex: 0.85;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 12px;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s;
}

/* ====== [จุดเริ่มแก้ไข 2.1 ใน assets/css/member-style.css (แทนที่บรรทัด 157 - 210)] ====== */
.wh-label {
    font-size: 0.76rem;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.wh-eye-btn {
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 0.72rem;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.wh-eye-btn:hover,
.wh-eye-btn:active { background: #E2E8F0; color: #0F172A; }

.wh-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: #047857;
    line-height: 1.2;
    letter-spacing: -0.3px;
}
.wh-points {
    font-size: 1.15rem;
    font-weight: 700;
    color: #B45309;
    line-height: 1.2;
}
.wh-unit {
    font-size: 0.74rem;
    font-weight: 600;
    color: #64748B;
    margin-left: 3px;
}
.wh-arrow-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.qa-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: transparent;
    border: none;
    padding: 6px 2px;
    min-height: 68px;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.qa-btn:active { transform: scale(0.92); }

.qa-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 1.28rem;
    margin-bottom: 6px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
    transition: transform 0.2s;
}
.qa-icon-blue { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }
.qa-icon-rose { background: #FFE4E6; color: #BE123C; border: 1px solid #FECDD3; }
.qa-icon-indigo { background: #E0E7FF; color: #3730A3; border: 1px solid #C7D2FE; }
.qa-icon-amber { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; }
.qa-icon-emerald { background: #D1FAE5; color: #047857; border: 1px solid #A7F3D0; }

.qa-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: #0F172A;
    white-space: nowrap;
    letter-spacing: -0.2px;
}
/* ====== [จุดจบแก้ไข 2.1 ใน assets/css/member-style.css] ====== */

/* 📌 4. ภารกิจและเช็คอินรายวัน (Mission & Gamification) */
.mission-hub {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    border: 1px solid #334155;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.3);
}
.mission-hub .hub-title { color: #F8FAFC !important; }

.streak-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: 0.3s;
}
.streak-circle.active {
    background: #10B981;
    color: #FFFFFF;
    border-color: #34D399;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
}
.streak-circle.gift { background: transparent; border-color: #F59E0B; color: #F59E0B; }
.streak-circle.gift.active {
    background: #F59E0B;
    color: #FFFFFF;
    border-color: #FBBF24;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

/* 📌 5. กระดานความโปร่งใส, ไทม์ไลน์ และฟีดแนวนอน */
#transparencyFeed,
.horizontal-scroll-row {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 8px;
}
#transparencyFeed::-webkit-scrollbar,
.horizontal-scroll-row::-webkit-scrollbar { display: none; }

.horizontal-scroll-row { gap: 12px; }

#transparencyFeed .transparency-card {
    flex: 0 0 85%;
    scroll-snap-align: center;
    margin-bottom: 0 !important;
    margin-right: 15px;
    background: #FFFFFF;
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--card-border);
}
#transparencyFeed .transparency-card:last-child { margin-right: 0; }

.timeline { border-left: 2px dashed #CBD5E1; padding-left: 20px; margin-left: 10px; position: relative; }
.timeline-item { margin-bottom: 20px; position: relative; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -27px;
    top: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #F8FAFC;
    border: 2px solid #CBD5E1;
    z-index: 2;
}
.timeline-item.active::before { background: #10B981; border-color: #059669; box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
.timeline-item.warning::before { background: #F59E0B; border-color: #D97706; box-shadow: 0 0 8px rgba(245, 158, 11, 0.5); }

/* 📌 6. ข่าวสารและของรางวัล */
.vertical-news-card {
    flex: 0 0 240px;
    scroll-snap-align: start;
    background: #FFFFFF;
    border-radius: 18px;
    border: 1px solid var(--card-border);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s;
}
.vertical-news-card:active { transform: scale(0.98); }
.news-img { width: 100%; height: 130px; object-fit: cover; background: #F1F5F9; border-bottom: 1px solid #F3F4F6; }
.news-content { padding: 12px; display: flex; flex-direction: column; flex-grow: 1; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.reward-card {
    min-width: 150px;
    max-width: 150px;
    background: #FFFFFF !important;
    border: 1px solid #F1F5F9 !important;
    border-radius: 18px !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    scroll-snap-align: start;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
    cursor: pointer;
    transition: transform 0.2s;
}
.reward-card:active { transform: scale(0.96); }
.reward-img { width: 100%; height: 110px; object-fit: cover; background: #F8FAFC; border-bottom: 1px solid #F1F5F9; }

/* 📌 7. ฟอร์ม, รายการข้อมูล และป๊อปอัปแชร์ */
.info-list { background: #FFFFFF; border-radius: var(--radius-md); border: 1px solid var(--card-border); margin-bottom: 20px; overflow: hidden; }
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid #F3F4F6; }
.info-row:last-child { border-bottom: none; }
.info-label { color: #6B7280; font-size: 0.85rem; font-weight: 500; }
.info-data { color: #111827; font-size: 0.9rem; font-weight: 600; text-align: right; display: flex; align-items: center; gap: 8px; }

.form-control,
.form-select {
    border-radius: 14px;
    border: 1px solid #CBD5E1;
    background-color: #FFFFFF;
    font-size: 0.95rem;
    padding: 12px 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.btn-fintech {
    background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 100%);
    color: #FFFFFF;
    border-radius: 14px;
    padding: 14px;
    font-weight: 600;
    font-size: 1.02rem;
    border: none;
    transition: 0.25s;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
    width: 100%;
}
.btn-fintech:active { transform: scale(0.98); }
.pdpa-box { background: #F8FAFC; border: 1px dashed #CBD5E1; border-radius: var(--radius-md); padding: 16px; font-size: 0.85rem; text-align: left; }

.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 10000;
    justify-content: center;
    align-items: flex-end;
}
.share-content {
    background: #FFFFFF;
    width: 100%;
    max-width: 560px;
    border-radius: 24px 24px 0 0;
    padding: 25px;
    animation: slideUp 0.3s ease-out;
    text-align: center;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #FFFFFF;
    border: none;
    margin: 0 10px;
    cursor: pointer;
}

/* 📌 8. แผ่นการ์ดสมาชิกแนวนอน (Compact Member Cards) */
.id-card-wrapper {
    background: linear-gradient(135deg, #0F172A 0%, #2563EB 100%);
    border-radius: 18px;
    padding: 16px;
    color: #FFFFFF;
    min-width: 265px;
    max-width: 280px;
    min-height: 145px;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
    position: relative;
    scroll-snap-align: start;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.id-card-wrapper::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}
.id-card-content { position: relative; z-index: 1; }
.id-card-label { font-size: 0.65rem; color: rgba(255, 255, 255, 0.75); margin-bottom: 2px; font-weight: 300; }
.id-card-value { font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; letter-spacing: 0.3px; }
.id-card-wrapper.managed-card {
    background: linear-gradient(135deg, #064E3B 0%, #059669 100%);
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.22);
}

.add-member-card {
    background: #F8FAFC;
    border: 2px dashed #94A3B8;
    color: #475569;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
    min-height: 145px;
    border-radius: 18px;
}
.add-member-card:active { transform: scale(0.95); background: #F1F5F9; }

#memberCardsFeed > div,
#memberCardsFeed .member-card {
    min-width: 265px !important;
    max-width: 280px !important;
    height: auto !important;
    min-height: 145px !important;
    padding: 14px 16px !important;
    border-radius: 18px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08) !important;
}
#memberCardsFeed h4, #memberCardsFeed h5, #memberCardsFeed .member-name {
    font-size: 1rem !important; font-weight: 600 !important; margin: 6px 0 4px 0 !important; line-height: 1.3 !important;
}
#memberCardsFeed .badge, #memberCardsFeed span[class*="badge"] {
    font-size: 0.65rem !important; font-weight: 500 !important; padding: 4px 10px !important;
}
#memberCardsFeed small, #memberCardsFeed .text-white-50, #memberCardsFeed .label-text {
    font-size: 0.65rem !important; font-weight: 300 !important; opacity: 0.85; line-height: 1.2 !important; display: block;
}
#memberCardsFeed p, #memberCardsFeed .value-text, #memberCardsFeed div:not([class*="d-flex"]) {
    font-size: 0.8rem !important; font-weight: 500 !important; margin-bottom: 2px !important; line-height: 1.3 !important;
}
#memberCardsFeed hr { margin: 6px 0 !important; opacity: 0.15 !important; }
#memberCardsFeed .rounded-circle { width: 26px !important; height: 26px !important; font-size: 0.7rem !important; }

/* 📌 9. หน้ารายละเอียดและประวัติสมาชิก (Modern FinTech Detail View) */
.detail-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 6px 4px 0 4px;
}

.member-modern-card,
.detail-info-box {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    padding: 20px 18px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.1);
    position: relative;
    margin-bottom: 20px;
}

.avatar-squircle {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border: 1px solid #BFDBFE;
    color: #1D4ED8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.1);
}

.memid-pill {
    background: #F8FAFC;
    color: #1E40AF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 6px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}
.memid-pill:active { transform: scale(0.95); background: #EFF6FF; border-color: #93C5FD; }

.contrib-highlight-box {
    background: linear-gradient(135deg, #065F46 0%, #059669 60%, #10B981 100%);
    border-radius: 18px;
    padding: 14px 16px;
    margin: 14px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #FFFFFF;
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.22);
    position: relative;
    overflow: hidden;
}

.info-mini-box {
    background: #F8FAFC;
    border: 1px solid #F1F5F9;
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
}
.info-mini-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.info-item-label, .detail-row-label { font-size: 0.65rem; color: #64748B; font-weight: 500; margin-bottom: 2px; line-height: 1.1; }
.info-item-val, .detail-row-value { font-size: 0.8rem; color: #0F172A; font-weight: 600; word-break: break-word; line-height: 1.25; }

.btn-modern-action {
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #FFFFFF;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.btn-modern-action:active { transform: scale(0.96); }
.btn-modern-contrib { background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 100%); box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25); }
.btn-modern-claim { background: linear-gradient(135deg, #BE123C 0%, #E11D48 100%); box-shadow: 0 6px 16px rgba(225, 29, 72, 0.25); }
.btn-action-icon-wrap {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.history-tabs {
    display: flex;
    background: #E2E8F0;
    border-radius: var(--radius-md);
    padding: 4px;
    gap: 4px;
    margin-bottom: 14px;
}
.history-tab-btn {
    flex: 1;
    text-align: center;
    padding: 9px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.history-tab-btn.active {
    background: linear-gradient(135deg, #0F172A 0%, #1E40AF 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.history-table thead tr,
.history-table th {
    background: linear-gradient(90deg, #0F172A 0%, #1E3A8A 100%) !important;
    color: #FFFFFF !important;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 11px 8px !important;
    text-align: center;
    border: none !important;
}
.history-table td {
    font-size: 0.78rem;
    vertical-align: middle;
    text-align: center;
    padding: 12px 8px !important;
    color: #1E293B;
    border-bottom: 1px solid #F1F5F9;
}
.history-table tbody tr:nth-of-type(odd) { background-color: #F8FAFC; }

/* 📌 10. การปรับขนาดเฉพาะส่วนของหน้าสมาชิกบนจอใหญ่ (เสริมจาก style-shared.css) */
@media (min-width: 600px) and (max-width: 899px) {
    .wallet-hub-card { padding: 18px 22px; }
    .wh-amount { font-size: 1.35rem; }
    .wh-points { font-size: 1.25rem; }
    .qa-icon { width: 48px; height: 48px; font-size: 1.35rem; }
    .qa-label { font-size: 0.75rem; }
    #memberCardsFeed > div, #memberCardsFeed .member-card {
        min-width: 300px !important;
        max-width: 320px !important;
    }
}

@media (min-width: 900px) {
    .app-container::before { height: 230px; }
    .content-grid > .px-3 {
        padding-left: 28px !important;
        padding-right: 28px !important;
    }
    .wallet-hub-card {
        padding: 20px 28px;
        border-radius: var(--radius-lg);
    }
    .wh-amount { font-size: 1.5rem; }
    .wh-points { font-size: 1.35rem; }
    .qa-icon {
        width: 52px;
        height: 52px;
        border-radius: 16px;
        font-size: 1.4rem;
    }
    .qa-label { font-size: 0.8rem; }
}