/* ══════════════════════════════════════════
   PROFILE PAGE — profile.css
   Save as: static/css/profile.css
══════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --green-dark:  #1a5c38;
    --green-mid:   #2d7a50;
    --wa-green:    #00a884;
    --wa-green2:   #25D366;
    --gold:        #e6a817;
    --chat-bg:     #ece5dd;
    --white:       #ffffff;
    --text-main:   #111b21;
    --text-sub:    #667781;
    --border:      #e9edef;
    --red:         #ea4d3d;
    --bg-page:     #f0f2f5;
    --shadow:      0 1px 3px rgba(0,0,0,.12);
}

html, body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg-page);
    font-family: 'Poppins', sans-serif;
}

/* ══ WRAPPER ══════════════════════════════ */
.profile-page .profile-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    min-height: auto;
    background: var(--bg-page);
    display: flex;
    flex-direction: column;
    padding-bottom: 16px;
}

.profile-subhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 6px;
    gap: 12px;
}

.profile-subhead-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--green-dark);
    flex: 1;
}

.profile-page .profile-topbar {
    display: none;
}

/* ══ TOP BAR (legacy) ═════════════════════ */
.profile-topbar {
    background: var(--green-dark);
    display: flex;
    align-items: center;
    padding: 14px 16px;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.back-btn, .edit-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: background .15s;
    flex-shrink: 0;
}
.back-btn:hover, .edit-btn:hover { background: rgba(255,255,255,.15); }

.topbar-title {
    flex: 1;
    color: white;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: .2px;
}

/* ══ AVATAR SECTION ══════════════════════ */
.avatar-section {
    background: var(--green-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px 32px;
    gap: 8px;
}

.avatar-ring {
    width: 124px; height: 124px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--gold), var(--wa-green));
    box-shadow: 0 4px 24px rgba(0,0,0,.3);
}

.avatar-wrap {
    width: 100%; height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    background: #dfe5e7;
    cursor: pointer;
}

.profile-img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.avatar-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: #dfe5e7;
    font-size: 52px;
    color: #b0bec5;
}

.camera-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 36%;
    background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: height .2s;
}
.avatar-wrap:hover .camera-overlay { height: 100%; border-radius: 50%; }
.camera-overlay i { color: white; font-size: 20px; }

.avatar-name {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-top: 4px;
}

.photo-hint {
    color: rgba(255,255,255,.55);
    font-size: 11px;
}

/* ══ VERIFIED BAR ════════════════════════ */
.verified-bar {
    background: #e7f9f1;
    border-bottom: 1px solid #c3e8d1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    font-size: 13px;
    color: #1a7a4a;
    font-weight: 500;
}
.verified-bar .fab { color: var(--wa-green2); font-size: 16px; }
.verified-tick     { color: var(--wa-green2); font-size: 15px; }

/* ══ NOT LOGGED IN CARD ══════════════════ */
.not-logged-card {
    background: var(--white);
    margin: 16px 16px 0;
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: var(--shadow);
}

.nlc-icon {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: #e7f9f1;
    color: var(--wa-green2);
    font-size: 26px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
}

.not-logged-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.not-logged-card p {
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.6;
    margin-bottom: 20px;
}

.wa-login-btn {
    background: var(--wa-green2);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 13px 28px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: background .15s, transform .1s;
    box-shadow: 0 3px 12px rgba(37,211,102,.3);
}
.wa-login-btn:hover  { background: #20b857; }
.wa-login-btn:active { transform: scale(.97); }

.wa-hint {
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 12px;
}

/* ══ INFO CARDS ══════════════════════════ */
.info-section {
    background: var(--white);
    margin-top: 12px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.info-card {
    display: flex;
    align-items: flex-start;
    padding: 15px 20px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}
.info-card:last-child { border-bottom: none; }
.info-card:hover { background: #f9fafb; }

.info-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #e8f5ee;
    display: flex; align-items: center; justify-content: center;
    color: var(--green-dark);
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.info-label {
    font-size: 11px;
    color: var(--wa-green);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-value {
    font-size: 15px;
    color: var(--text-main);
    font-weight: 500;
    flex: 1;
    word-break: break-word;
}

.loc-value  { font-size: 14px; line-height: 1.4; }

.loc-coords-row {
    font-size: 11px;
    color: var(--text-sub);
    font-family: monospace;
    margin-top: 2px;
}

.verified-chip {
    font-size: 10px;
    background: #e7f9f1;
    color: #1a7a4a;
    border: 1px solid #c3e8d1;
    border-radius: 20px;
    padding: 3px 9px;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.info-input {
    flex: 1;
    border: none;
    border-bottom: 2px solid var(--wa-green);
    outline: none;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    color: var(--text-main);
    background: transparent;
    padding: 2px 0;
    min-width: 0;
}

.hidden { display: none !important; }

/* ══ SAVE ROW ════════════════════════════ */
.save-row {
    display: flex;
    justify-content: center;
    padding: 16px 20px 8px;
}

.save-btn {
    background: var(--wa-green);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 12px 36px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    box-shadow: 0 3px 12px rgba(0,168,132,.3);
    transition: background .15s, transform .1s;
}
.save-btn:hover  { background: #009e7d; }
.save-btn:active { transform: scale(.97); }

/* ══ LOGOUT ══════════════════════════════ */
.logout-section {
    margin-top: auto;
    padding: 24px 20px 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.logout-btn {
    background: white;
    color: var(--red);
    border: 1.5px solid var(--red);
    border-radius: 12px;
    padding: 13px 40px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    transition: background .15s, transform .1s;
    width: 100%; max-width: 300px;
    justify-content: center;
    box-shadow: var(--shadow);
}
.logout-btn:hover  { background: #fff5f5; }
.logout-btn:active { transform: scale(.97); }

.logout-hint {
    font-size: 11px;
    color: var(--text-sub);
    text-align: center;
}

/* ══ MODALS ══════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    transition: opacity .25s;
    padding: 20px;
}
.modal-overlay.show { opacity: 1; }

.modal-box {
    background: white;
    border-radius: 16px;
    padding: 28px 24px 22px;
    width: 100%; max-width: 320px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
    transform: scale(.92);
    transition: transform .25s;
}
.modal-overlay.show .modal-box { transform: scale(1); }

.modal-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: #fff0ee;
    color: var(--red);
    font-size: 22px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
}
.modal-icon.wa-icon { background: #e7f9f1; color: var(--wa-green2); }

.modal-box h3 { font-size: 17px; font-weight: 700; color: var(--text-main); margin-bottom: 8px; }
.modal-box p  { font-size: 13px; color: var(--text-sub); line-height: 1.5; margin-bottom: 16px; }

.modal-btns { display: flex; gap: 10px; }

.modal-cancel, .modal-confirm {
    flex: 1;
    padding: 11px 0;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: background .15s;
}
.modal-cancel  { background: #f0f2f5; color: var(--text-main); }
.modal-cancel:hover  { background: #e2e5e9; }
.modal-confirm { background: var(--red); color: white; display: flex; align-items: center; justify-content: center; gap: 6px; }
.modal-confirm:hover { background: #d43a2a; }
.modal-confirm.wa-confirm { background: var(--wa-green2); }
.modal-confirm.wa-confirm:hover { background: #20b857; }

/* Phone input */
.phone-input-wrap {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 12px;
}
.phone-input-wrap:focus-within { border-color: var(--wa-green); }

.country-code {
    background: #eee;
    padding: 11px 12px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    border-right: 1.5px solid #ddd;
    flex-shrink: 0;
}

.phone-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    padding: 11px 12px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    background: transparent;
    color: var(--text-main);
    letter-spacing: 1px;
}

/* ══ TOAST ═══════════════════════════════ */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1f2937;
    color: white;
    padding: 10px 22px;
    border-radius: 24px;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    z-index: 300;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    pointer-events: none;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}