/* ============================================================
   FilipinaMatching — stylesheet
   Rose / warm theme, responsive, mobile-first.
   ============================================================ */
:root {
    --rose:      #e4405f;
    --rose-dark: #c22e4a;
    --rose-soft: #ffe3ec;
    --rose-tint: #fff5f8;
    --ink:       #2b2230;
    --muted:     #8a7f8f;
    --line:      #f0dfe6;
    --bg:        #fff8fa;
    --white:     #ffffff;
    --ok:        #2e9e6b;
    --shadow:    0 6px 24px rgba(196, 46, 74, 0.12);
    --radius:    16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
}
a { color: var(--rose-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 18px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.lead { font-size: 1.15rem; color: #5c5162; }

/* ---------- Header / nav ---------- */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { font-weight: 800; font-size: 1.3rem; color: var(--rose-dark); }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--rose); }
.site-nav { display: flex; align-items: center; gap: 18px; }
.site-nav a { color: var(--ink); font-weight: 600; }
.site-nav a.muted { color: var(--muted); font-weight: 500; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.5rem; color: var(--rose-dark); cursor: pointer; }
.badge {
    display: inline-block; min-width: 18px; padding: 0 5px; height: 18px; line-height: 18px;
    background: var(--rose); color: #fff; border-radius: 9px; font-size: .72rem; text-align: center; font-weight: 700;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block; border: 0; cursor: pointer; font: inherit; font-weight: 700;
    background: var(--rose); color: #fff; padding: 10px 18px; border-radius: 999px;
    transition: transform .05s ease, background .15s ease; text-align: center;
}
.btn:hover { background: var(--rose-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; }
.btn-sm { padding: 7px 14px; font-size: .9rem; }
.btn-xs { padding: 4px 10px; font-size: .8rem; }
.btn-ghost { background: transparent; color: var(--rose-dark); box-shadow: inset 0 0 0 2px var(--rose-soft); }
.btn-ghost:hover { background: var(--rose-soft); color: var(--rose-dark); }
.btn-video { background: #6a3ea1; }
.btn-video:hover { background: #58318a; }

/* ---------- Flash ---------- */
.flash { padding: 12px 16px; border-radius: 12px; margin: 14px 0; font-weight: 600; }
.flash-success { background: #e4f7ee; color: #1d7a4f; }
.flash-error { background: #fde8ec; color: #b4304a; }
.flash-info { background: #eef1fb; color: #3f4c93; }

/* ---------- Cards / forms ---------- */
main.container { padding-top: 22px; padding-bottom: 40px; }
.card {
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 22px; margin: 0 0 22px; box-shadow: var(--shadow);
}
.form label { display: block; margin: 0 0 14px; font-weight: 600; font-size: .92rem; }
.form input, .form select, .form textarea {
    width: 100%; margin-top: 5px; padding: 11px 12px; font: inherit; color: var(--ink);
    border: 1px solid #e6d3db; border-radius: 10px; background: #fff;
}
.form input:focus, .form select:focus, .form textarea:focus {
    outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px var(--rose-soft);
}
.form textarea { resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-wrap { max-width: 460px; margin: 20px auto; }

/* ---------- Hero (landing) ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 30px 0 20px; }
.hero h1 { font-size: 2.6rem; color: var(--rose-dark); }
.hero-cta { display: flex; gap: 12px; margin: 22px 0 10px; flex-wrap: wrap; }
.hero-card { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.feature { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }
.feature h3 { font-size: 1rem; margin-bottom: 4px; }
.feature p { margin: 0; font-size: .9rem; color: var(--muted); }

/* ---------- Browse grid ---------- */
.browse-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.filters label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.filters input[type=number], .filters input[type=text] {
    padding: 8px 10px; border: 1px solid #e6d3db; border-radius: 9px; font: inherit; width: 64px; display: block; margin-top: 3px;
}
.filters input[type=text] { width: 150px; }
.filters .age-range { display: flex; align-items: center; gap: 6px; }
.filters .check { display: flex; align-items: center; gap: 6px; }
.filters .check input { width: auto; margin-top: 0; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.member-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s ease, opacity .3s ease; }
.member-card:hover { transform: translateY(-3px); }
.member-card.card-removed { opacity: 0; transform: scale(.9); }
.member-photo { display: block; height: 240px; background-size: cover; background-position: center; position: relative; }
.online-badge { position: absolute; top: 10px; left: 10px; background: var(--ok); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.member-body { padding: 12px 14px 16px; }
.member-body h3 { font-size: 1.05rem; margin-bottom: 2px; }
.member-body h3 a { color: var(--ink); }
.member-actions { display: flex; gap: 8px; margin-top: 10px; }
.member-actions .btn { flex: 1; }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 26px 0; }

/* ---------- Profile view ---------- */
.profile-view { display: grid; grid-template-columns: 420px 1fr; gap: 30px; align-items: start; }
.profile-gallery { position: sticky; top: 80px; }
.gallery-main { width: 100%; height: 460px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--rose-soft); }
.placeholder-lg { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; cursor: pointer; border: 2px solid transparent; }
.gallery-thumbs img:hover, .gallery-thumbs img.active { border-color: var(--rose); }
.profile-info h1 { font-size: 2rem; }
.dot-online { display: inline-block; width: 12px; height: 12px; background: var(--ok); border-radius: 50%; vertical-align: middle; }
.profile-actions { display: flex; gap: 10px; margin: 16px 0 8px; flex-wrap: wrap; }
.bio { white-space: pre-line; }
.detail-list { list-style: none; padding: 0; margin: 0 0 10px; }
.detail-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.detail-label { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--rose-soft); color: var(--rose-dark); padding: 5px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.profile-safety { display: flex; align-items: center; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.report-box { display: inline-block; }
.report-box summary { list-style: none; display: inline-block; }
.report-box[open] { display: block; margin-top: 10px; width: 100%; }
.report-box .form { margin-top: 10px; max-width: 360px; }

/* ---------- Photo manager ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; margin-top: 12px; }
.photo-item { position: relative; margin: 0; }
.photo-item img { width: 100%; height: 150px; object-fit: cover; border-radius: 12px; }
.photo-item .tag { position: absolute; top: 8px; left: 8px; background: var(--rose); color: #fff; font-size: .72rem; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.photo-item figcaption { display: flex; gap: 6px; margin-top: 6px; }
.photo-add { border: 2px dashed #e6c6d3; border-radius: 12px; display: flex; align-items: center; justify-content: center; min-height: 150px; }
.add-label { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; color: var(--rose-dark); font-weight: 600; }
.add-label .plus { font-size: 2rem; line-height: 1; }
.add-label input[type=file] { display: none; }

/* ---------- Matches ---------- */
.match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.match-card { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.match-avatar { width: 64px; height: 64px; border-radius: 50%; background-size: cover; background-position: center; position: relative; flex: 0 0 auto; }
.match-avatar .online-badge { top: -2px; left: -2px; padding: 2px 6px; font-size: .6rem; }
.match-meta { flex: 1; min-width: 0; }
.match-meta h3 { font-size: 1rem; margin: 0; }
.preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-cta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

/* ---------- Conversations list ---------- */
.convo-list { list-style: none; padding: 0; margin: 0; }
.convo { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; margin-bottom: 10px; color: var(--ink); box-shadow: var(--shadow); }
.convo:hover { text-decoration: none; background: var(--rose-tint); }
.convo-avatar { width: 54px; height: 54px; border-radius: 50%; background-size: cover; background-position: center; position: relative; flex: 0 0 auto; }
.convo-avatar .dot-online { position: absolute; bottom: 2px; right: 2px; border: 2px solid #fff; }
.convo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.convo-name { font-weight: 700; }
.convo-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Chat ---------- */
.chat-shell { display: flex; flex-direction: column; height: calc(100vh - 160px); min-height: 420px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.chat-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.back-link { font-size: 1.4rem; color: var(--rose-dark); }
.chat-peer { display: flex; align-items: center; gap: 10px; flex: 1; color: var(--ink); }
.chat-peer:hover { text-decoration: none; }
.chat-peer-avatar { width: 42px; height: 42px; border-radius: 50%; background-size: cover; background-position: center; }
.chat-peer small { display: block; font-size: .78rem; }
.chat-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px; background: var(--rose-tint); }
.chat-empty { text-align: center; margin: auto; }
.msg { display: flex; }
.msg-mine { justify-content: flex-end; }
.bubble { max-width: 72%; padding: 9px 13px 6px; border-radius: 16px; position: relative; font-size: .96rem; word-wrap: break-word; }
.msg-theirs .bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg-mine .bubble { background: var(--rose); color: #fff; border-bottom-right-radius: 5px; }
.msg-time { display: block; font-size: .66rem; opacity: .6; margin-top: 3px; text-align: right; }
.chat-input { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.chat-input input { flex: 1; padding: 12px 14px; border: 1px solid #e6d3db; border-radius: 999px; font: inherit; }
.chat-input input:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px var(--rose-soft); }

/* ---------- Video call ---------- */
.call-overlay { position: fixed; inset: 0; background: #14101a; z-index: 200; display: flex; align-items: center; justify-content: center; }
.call-stage { position: relative; width: 100%; height: 100%; }
#remoteVideo { width: 100%; height: 100%; object-fit: cover; background: #000; }
#localVideo { position: absolute; bottom: 100px; right: 20px; width: 160px; height: 220px; object-fit: cover; border-radius: 12px; border: 2px solid #fff; background: #333; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.call-status { position: absolute; top: 20px; left: 0; right: 0; text-align: center; color: #fff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.call-controls { position: absolute; bottom: 24px; left: 0; right: 0; display: flex; justify-content: center; gap: 18px; }
.call-btn { width: 60px; height: 60px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 1.4rem; cursor: pointer; backdrop-filter: blur(4px); }
.call-btn:hover { background: rgba(255,255,255,.3); }
.call-btn.off { background: #fff; color: var(--ink); }
.call-hangup { background: #e0294a; }
.call-hangup:hover { background: #c01e3c; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(43,34,48,.6); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: #fff; border-radius: var(--radius); padding: 28px; max-width: 400px; width: 100%; box-shadow: var(--shadow); }
.modal-actions { display: flex; gap: 12px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: #fff; padding: 22px 0; margin-top: 30px; }
.site-footer p { margin: 4px 0; color: var(--muted); font-size: .9rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .hero { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2rem; }
    .profile-view { grid-template-columns: 1fr; }
    .profile-gallery { position: static; }
    .gallery-main { height: 360px; }
}
@media (max-width: 640px) {
    .nav-toggle { display: block; }
    .site-nav {
        display: none; position: absolute; top: 62px; right: 0; left: 0;
        flex-direction: column; align-items: stretch; gap: 0; background: #fff;
        border-bottom: 1px solid var(--line); padding: 8px 18px;
    }
    body.nav-open .site-nav { display: flex; }
    .site-nav a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    #localVideo { width: 110px; height: 150px; bottom: 96px; }
    .chat-shell { height: calc(100vh - 130px); }
}
