/* ============================================================
   ThaiLoveFriend – Mobile App Style
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
    --primary:  #FF6B6B;
    --primary2: #FF8E8E;
    --dark:     #1a1a2e;
    --gray:     #888;
    --lgray:    #bbb;
    --light:    #f7f7f7;
    --white:    #fff;
    --radius:   14px;
    --shadow:   0 2px 16px rgba(0,0,0,0.08);
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light);
    color: var(--dark);
    overflow-x: hidden;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

/* ── Fixed Header ─────────────────────────────────────────── */
.header {
    position: fixed; top: 0; left: 0; right: 0;
    height: 56px;
    background: var(--white);
    display: flex; align-items: center; padding: 0 16px;
    box-shadow: 0 1px 0 #eee;
    z-index: 200;
    padding-top: env(safe-area-inset-top);
}
.header .back-btn {
    font-size: 22px; width: 36px; text-decoration: none;
    color: var(--dark); flex-shrink: 0;
}
.header h1 {
    flex: 1; text-align: center; font-size: 17px;
    font-weight: 700; color: var(--primary);
    letter-spacing: -0.3px;
}
.header .right-btn {
    width: 36px; font-size: 20px; text-align: right;
    background: none; border: none; cursor: pointer; color: var(--dark);
}

/* ── Page Content ─────────────────────────────────────────── */
.content {
    margin-top: 56px;
    margin-bottom: 68px;
    padding: 16px;
    min-height: calc(100vh - 124px);
}
.content.no-bottom { margin-bottom: 0; }
.content.no-top    { margin-top: 0; }

/* ── Bottom Navigation ────────────────────────────────────── */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 60px;
    background: var(--white);
    display: flex;
    border-top: 1px solid #eee;
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-decoration: none; color: var(--lgray);
    font-size: 10px; font-weight: 600; gap: 3px;
    transition: color 0.2s;
}
.bottom-nav a .icon { font-size: 21px; line-height: 1; }
.bottom-nav a.active { color: var(--primary); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: block; width: 100%;
    padding: 15px; border: none; border-radius: var(--radius);
    font-size: 16px; font-weight: 700; cursor: pointer;
    text-align: center; text-decoration: none; transition: opacity 0.2s;
    letter-spacing: 0.2px;
}
.btn:active { opacity: 0.8; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline  { background: #fff; color: var(--primary);
                border: 2px solid var(--primary); }
.btn-gray     { background: #eee; color: #666; }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn-sm {
    display: inline-block; width: auto; padding: 8px 18px;
    font-size: 13px; border-radius: 20px;
}

/* ── Form ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--gray); margin-bottom: 7px; text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%; padding: 14px 16px;
    border: 1.5px solid #e0e0e0; border-radius: var(--radius);
    font-size: 15px; background: #fff; color: var(--dark);
    -webkit-appearance: none; appearance: none;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255,107,107,0.12);
}
.form-group textarea { min-height: 100px; resize: vertical; }
.form-hint { font-size: 11px; color: var(--lgray); margin-top: 5px; }

/* ── Member Card ──────────────────────────────────────────── */
.member-card {
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 10px;
    display: flex; flex-direction: column; align-items: stretch;
    padding: 12px 14px;
    cursor: pointer; transition: transform 0.15s;
}
.member-card:active { transform: scale(0.98); }
.member-card .avatar {
    width: 54px; height: 54px; border-radius: 50%;
    object-fit: cover; background: #f0f0f0; flex-shrink: 0;
    font-size: 26px; display: flex; align-items: center; justify-content: center;
}
.member-card .info { flex: 1; min-width: 0; }
.member-card .name { font-size: 16px; font-weight: 700; }
.member-card .meta { font-size: 12px; color: var(--gray); margin-top: 3px; }
.member-card .like-btn {
    background: none; border: none; font-size: 24px;
    cursor: pointer; padding: 6px; flex-shrink: 0;
    transition: transform 0.2s;
}
.member-card .like-btn:active { transform: scale(1.3); }

/* ── member-card 사진 슬롯 (profile과 동일 방식) ─────────── */
.member-card .photo-slot-row {
    display: flex; gap: 10px; margin-top: 10px; width: 100%;
}
.member-card .photo-slot-row img {
    width: 100%; aspect-ratio: 1/1; object-fit: cover;
    border-radius: 10px; border: 1px solid #eee;
    display: block; cursor: pointer;
    transition: opacity 0.15s;
}
.member-card .photo-slot-row img:active { opacity: 0.8; }
.member-card .photo-slot-row .view-btn {
    display: none; width: 100%; margin-top: 5px; padding: 6px 0;
    background: #f0f0f0; border: 1px solid #ddd; border-radius: 8px;
    font-size: 12px; font-weight: 600; color: #444; cursor: pointer;
}
.member-card .photo-slot-row .view-btn:active { background: #e0e0e0; }

/* ── Profile Photo ────────────────────────────────────────── */
.photo-slot {
    width: 100%; aspect-ratio: 1;
    background: #f0f0f0; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 40px; cursor: pointer; overflow: hidden;
    border: 2px dashed #ddd; transition: border-color 0.2s;
    position: relative;
}
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot .add-icon {
    position: absolute; font-size: 32px; opacity: 0.4;
}

/* ── Payment Plan Card ────────────────────────────────────── */
.plan-card {
    background: #fff; border-radius: var(--radius);
    border: 2px solid #eee; padding: 18px 16px;
    margin-bottom: 12px; cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; gap: 14px;
}
.plan-card.selected { border-color: var(--primary); background: #fff5f5; }
.plan-card .plan-radio {
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid #ddd; flex-shrink: 0; display: flex;
    align-items: center; justify-content: center; transition: all 0.2s;
}
.plan-card.selected .plan-radio {
    border-color: var(--primary); background: var(--primary);
}
.plan-card.selected .plan-radio::after {
    content: ''; width: 8px; height: 8px;
    border-radius: 50%; background: #fff;
}
.plan-card .plan-info { flex: 1; }
.plan-card .plan-name { font-size: 16px; font-weight: 700; }
.plan-card .plan-sub  { font-size: 12px; color: var(--gray); margin-top: 2px; }
.plan-card .plan-price {
    font-size: 20px; font-weight: 800; color: var(--primary);
}
.plan-badge {
    background: var(--primary); color: #fff;
    font-size: 10px; font-weight: 700; padding: 2px 8px;
    border-radius: 20px; margin-left: 8px;
}

/* ── Section Title ────────────────────────────────────────── */
.section-title {
    font-size: 13px; font-weight: 700; color: var(--gray);
    text-transform: uppercase; letter-spacing: 0.8px;
    margin: 20px 0 10px;
}

/* ── Info Row (profile settings) ─────────────────────────── */
.info-row {
    background: #fff; border-radius: var(--radius);
    padding: 14px 16px; margin-bottom: 8px;
    display: flex; align-items: center; gap: 12px;
    cursor: pointer; box-shadow: var(--shadow);
}
.info-row .ir-icon  { font-size: 20px; width: 28px; text-align: center; }
.info-row .ir-label { flex: 1; font-size: 15px; }
.info-row .ir-value { font-size: 14px; color: var(--gray); }
.info-row .ir-arrow { color: var(--lgray); font-size: 16px; }

/* ── Badge / Tag ──────────────────────────────────────────── */
.badge {
    display: inline-block;
    background: var(--primary); color: #fff;
    font-size: 10px; font-weight: 700; padding: 2px 7px;
    border-radius: 20px; min-width: 18px; text-align: center;
}
.tag {
    display: inline-block; background: #f0f0f0; color: #666;
    font-size: 12px; padding: 4px 10px; border-radius: 20px;
}
.tag-premium {
    background: linear-gradient(90deg,#FF6B6B,#FF8E8E);
    color: #fff;
}

/* ── Upgrade Box ──────────────────────────────────────────── */
.upgrade-box {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
    color: #fff; border-radius: var(--radius);
    padding: 24px 20px; text-align: center; margin: 16px 0;
}
.upgrade-box h3 { font-size: 20px; margin-bottom: 8px; }
.upgrade-box p  { font-size: 13px; opacity: 0.9; margin-bottom: 18px; }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
    text-align: center; padding: 60px 20px; color: var(--lgray);
}
.empty-state .empty-icon { font-size: 52px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ── Loading / Spinner ────────────────────────────────────── */
.loading { display: flex; justify-content: center; padding: 40px; }
.spinner {
    width: 32px; height: 32px;
    border: 3px solid #eee; border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ────────────────────────────────────────────────── */
.toast {
    position: fixed; bottom: 78px; left: 50%;
    transform: translateX(-50%);
    background: rgba(26,26,46,0.88); color: #fff;
    padding: 11px 22px; border-radius: 22px;
    font-size: 13px; font-weight: 500; z-index: 9999;
    opacity: 0; transition: opacity 0.25s;
    white-space: nowrap; pointer-events: none;
}
.toast.show { opacity: 1; }

/* ── Modal overlay ────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500; display: flex;
    align-items: flex-end; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal-sheet {
    background: #fff; border-radius: 20px 20px 0 0;
    padding: 24px 20px 40px; width: 100%;
    transform: translateY(100%); transition: transform 0.3s;
}
.modal-overlay.show .modal-sheet { transform: translateY(0); }
.modal-title {
    font-size: 17px; font-weight: 700; margin-bottom: 20px;
    text-align: center;
}

/* ── Cooldown Timer ───────────────────────────────────────── */
.cooldown-bar {
    background: #fff3f3; border: 1px solid #ffd0d0;
    border-radius: 10px; padding: 10px 14px;
    font-size: 13px; color: var(--primary);
    text-align: center; margin-bottom: 12px;
}

/* ── Comment bubble ───────────────────────────────────────── */
.comment-item {
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 14px;
    margin-bottom: 10px; display: flex; gap: 12px;
}
.comment-item .c-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    object-fit: cover; background: #f0f0f0; flex-shrink: 0;
    font-size: 22px; display: flex; align-items: center; justify-content: center;
}
.comment-item .c-body { flex: 1; }
.comment-item .c-name { font-size: 14px; font-weight: 700; }
.comment-item .c-text { font-size: 14px; color: #444; margin-top: 4px; }
.comment-item .c-time { font-size: 11px; color: var(--lgray); margin-top: 4px; }
.comment-item.unread { border-left: 3px solid var(--primary); }

/* ── Range Slider ─────────────────────────────────────────── */
input[type=range] {
    -webkit-appearance: none; width: 100%; height: 4px;
    background: #eee; border-radius: 2px; outline: none;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 22px; height: 22px;
    border-radius: 50%; background: var(--primary); cursor: pointer;
}

/* ── Divider ──────────────────────────────────────────────── */
.divider { height: 1px; background: #f0f0f0; margin: 16px 0; }
