/* style.css
 *  - Body has a soft warm cream tint (not pure white).
 *  - Panels use a pale blush pastel so cards POP against the page.
 *  - Header has a subtle pink-to-blue gradient.
 *  - Text stays near-black for strong contrast.
 *  - Buttons keep the dark accent palette so they read clearly.
 *  Rules respected: ONE css file, light tinted background, strong
 *  light/dark contrast for text. Schematics still use pure white
 *  per the white-background rule.
 */
:root {
    --bg:        #fbf7f5;     /* off-white warm cream body */
    --fg:        #101418;     /* near-black text */
    --panel:     #fde9f1;     /* light blush pink panel */
    --panel-alt: #e7f0ff;     /* light sky blue panel (.panel.alt) */
    --panel-warm:#fff4e6;     /* light cream panel (.panel.warm) */
    --border:    #d6bccd;     /* warm-pink border to match panel */
    --accent:    #0a3d8f;     /* dark navy - strong contrast */
    --accent-2:  #8a1538;     /* dark maroon */
    --accent-3:  #b54f00;     /* dark orange (used by .link-emph) */
    --accent-pink: #c2185b;   /* hot pink for a third button colour */
    --accent-teal: #00838f;   /* teal for a fourth button colour */
    --good:      #0b6b2b;
    --bad:       #9a1b1b;
    --warn:      #8a5a00;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 14px/1.5 "Segoe UI", Arial, sans-serif;   /* default body text - 14px max */
}

/* ---- typography caps  (per user rule: body 14px, headings 16-18px) ---- */
h1                    { font-size: 18px; margin: 0 0 8px; }
h2                    { font-size: 17px; margin: 8px 0; }
h3                    { font-size: 16px; margin: 6px 0; }
h4                    { font-size: 14px; margin: 4px 0; }
p, li, td, th, label,
input, select, textarea,
button, a              { font-size: 14px; }
small, .muted          { font-size: 13px; }

a          { color: var(--accent); text-decoration: none; font-weight: 600; }
a:hover    { text-decoration: underline; color: var(--accent-2); }

header.site {
    background: linear-gradient(90deg, #fde9f1 0%, #f7f0ff 50%, #e7f0ff 100%);
    border-bottom: 3px solid var(--accent);
    padding: 12px 18px;
    box-shadow: 0 2px 6px rgba(10,61,143,0.06);
}
header.site h1 { margin: 0; font-size: 18px; color: var(--accent); letter-spacing: 0.3px; }
header.site nav { margin-top: 4px; }
header.site nav a {
    margin-right: 14px; font-weight: 600;
    color: var(--accent-2);
}
header.site nav a:hover { color: var(--accent); }

main { padding: 18px; max-width: 1100px; margin: 0 auto; }

footer.site {
    margin-top: 30px;
    padding: 14px 18px;
    border-top: 2px solid var(--accent-2);
    background: linear-gradient(90deg, #e7f0ff 0%, #fde9f1 100%);
    color: var(--fg);
    font-size: 13px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent-2);     /* small color stripe so cards pop */
    border-radius: 6px;
    padding: 14px;
    margin: 12px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.panel.alt   { background: var(--panel-alt);  border-color: #b9c8de; border-left-color: var(--accent); }
.panel.warm  { background: var(--panel-warm); border-color: #e1cfb2; border-left-color: var(--accent-3); }
.panel h2, .panel h3 { color: var(--accent); margin-top: 0; }
.panel.alt  h2, .panel.alt  h3 { color: var(--accent); }
.panel.warm h2, .panel.warm h3 { color: var(--accent-3); }

.btn {
    display: inline-block;
    padding: 8px 14px;
    background: var(--accent);
    color: #ffffff;        /* WHITE text on dark navy - strong contrast */
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}
.btn           { transition: background 0.12s ease, transform 0.06s ease; }
.btn:hover     { background: #082f6e; transform: translateY(-1px); }
.btn:active    { transform: translateY(0); }
.btn.secondary { background: var(--accent-2); }
.btn.secondary:hover { background: #6c0f2b; }
.btn.pink      { background: var(--accent-pink); }
.btn.pink:hover{ background: #95124a; }
.btn.teal      { background: var(--accent-teal); }
.btn.teal:hover{ background: #006b75; }
.btn.danger    { background: var(--bad); }

input[type=text], input[type=email], input[type=password],
input[type=date], input[type=number], select, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #ffffff;
    color: var(--fg);
    font-size: 14px;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus,
input[type=date]:focus, input[type=number]:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(10, 61, 143, 0.15);
}

label { display: block; font-weight: 600; margin-top: 8px; }

.flash       { padding: 10px; border-radius: 4px; margin: 10px 0; }
.flash.info  { background: #e7efff; color: #0a3d8f; border: 1px solid #0a3d8f; }
.flash.good  { background: #e7fbec; color: #0b6b2b; border: 1px solid #0b6b2b; }
.flash.bad   { background: #ffe8e8; color: #9a1b1b; border: 1px solid #9a1b1b; }
.flash.warn  { background: #fff7e0; color: #8a5a00; border: 1px solid #8a5a00; }

table       { width: 100%; border-collapse: collapse; background: #ffffff; }
th, td      { border: 1px solid var(--border); padding: 6px 8px; text-align: left; }
th          { background: linear-gradient(180deg, #e7f0ff, #d6e0f2); color: var(--accent); }

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent-pink);
    border-radius: 6px;
    padding: 10px;
    transition: transform 0.06s ease, box-shadow 0.12s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.card img { max-width: 100%; border-radius: 4px; }

.age-gate {
    position: fixed; inset: 0;
    background: rgba(255,255,255,0.97);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}
.age-gate .box {
    background: #ffffff; color: var(--fg);
    border: 2px solid var(--bad); border-radius: 8px;
    padding: 24px; max-width: 480px; text-align: center;
}

.chat-window {
    height: 55vh; min-height: 300px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 4px;
}
.chat-msg { margin: 4px 0; }
.chat-msg .who { font-weight: 700; color: var(--accent); }
.chat-msg .when { color: #5a6472; font-size: 12px; margin-left: 6px; }

.error-list { color: var(--bad); }
.muted      { color: #5a6472; }

.contact-email { font-weight: 600; }

/* ============================================================
   WEBCAM PAGE - layout shell + Online Now sidebar
   ============================================================ */
.webcam-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 14px;
    align-items: start;
}
.webcam-main { min-width: 0; }

@media (max-width: 800px) {
    .webcam-shell { grid-template-columns: 1fr; }
}

.online-sidebar {
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}
.online-sidebar h3 { margin-top: 0; }

.online-list { display: flex; flex-direction: column; gap: 6px; }

.online-row {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid var(--border);
    transition: border-color 0.12s, background 0.12s;
}
.online-row:hover         { border-color: var(--accent); background: #f4f8ff; }
.online-row.online-row-active {
    border-color: var(--accent-pink);
    background: #fff0f7;
}

.online-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #d6e0f2;
    border: 1px solid var(--border);
}
.online-avatar-placeholder {
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    font-weight: 800;
    font-size: 16px;
}
.online-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.online-call-btn { padding: 3px 10px; }

/* Strong-contrast link, used where a normal blue link blends in too
   much next to dark body text. Examples: "OTHER WAYS TO PAY" on the
   signup page. */
.link-emph {
    color: #b54f00;             /* dark orange - distinct from blue and black */
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
    letter-spacing: 0.3px;
}
.link-emph:hover { color: #7c3500; }

/* ============================================================
   GALLERY (public pictures + videos by member)
   ============================================================ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin: 8px 0 24px;
}
.gallery-cell {
    position: relative;
    display: block;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: var(--fg);
    transition: transform 0.06s ease;
}
.gallery-cell:hover { transform: translateY(-2px); text-decoration: none; }
.gallery-cell img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #000;
}
.gallery-cell-empty {
    display: flex; align-items: center; justify-content: center;
    height: 180px;
    background: #e9edf2;
    color: #5a6472;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.gallery-cell-name {
    padding: 6px 8px;
    font-size: 13px;
    line-height: 1.3;
}
.gallery-cell-name strong { display: block; color: var(--fg); }
.gallery-play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 26px;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}

.admin-tabs { display: flex; gap: 6px; margin: 8px 0 14px; }
.admin-tabs .btn { padding: 6px 14px; }

/* ============================================================
   ADMIN SECTION
   ============================================================ */
.admin-body         { background: var(--bg); }
.admin-topbar       { border-bottom: 3px solid var(--accent-2); }
.admin-topbar h1    { color: var(--accent-2); }

.admin-shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px;
}

.admin-sidebar {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 10px;
    align-self: start;
    position: sticky;
    top: 10px;
}
.admin-sidebar h3   { margin: 0 0 8px 4px; color: var(--accent); font-size: 14px; }
.admin-sidebar a    {
    display: block; padding: 6px 8px; margin: 2px 0;
    border-radius: 4px; color: var(--fg); font-weight: 500;
}
.admin-sidebar a:hover { background: #e9edf2; text-decoration: none; }

.admin-main { min-width: 0; }

.admin-footer {
    max-width: 1280px; margin: 12px auto 0;
    border-radius: 4px 4px 0 0;
}

.admin-badge {
    display: inline-block;
    background: var(--bad);
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Dashboard tiles */
.admin-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px; margin: 10px 0 16px;
}
.admin-tile {
    background: #fff;
    border: 1px solid var(--border);
    border-left: 5px solid var(--accent);
    border-radius: 4px;
    padding: 10px 12px;
}
.admin-tile h4   { margin: 0 0 4px; font-size: 13px; color: #5a6472; font-weight: 600; }
.admin-tile .n   { font-size: 18px; font-weight: 700; color: var(--fg); line-height: 1; }
.admin-tile a    { font-size: 12px; display: inline-block; margin-top: 4px; }
.admin-tile.good { border-left-color: var(--good); }
.admin-tile.warn { border-left-color: var(--warn); }
.admin-tile.bad  { border-left-color: var(--bad); }

/* Admin table: denser than the front-of-site table */
.admin-table          { font-size: 13px; }
.admin-table th       { background: #e9edf2; font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px; }
.admin-table td       { vertical-align: top; padding: 5px 7px; }
.admin-table td code  { font-size: 12px; }

.admin-actions form   { margin: 0; }
.admin-actions .btn   { margin: 2px 2px; }
.btn-xs               { padding: 3px 7px; font-size: 11px; font-weight: 600; }
.btn.btn-approve      { background: var(--good); color: #fff; }
.btn.btn-approve:hover{ background: #074f1f; }
.btn.btn-reject       { background: var(--bad); color: #fff; }
.btn.btn-reject:hover { background: #6e1111; }

.pill {
    display: inline-block; padding: 1px 7px;
    border-radius: 10px; font-size: 11px; font-weight: 700;
    color: #fff; letter-spacing: 0.3px;
}
.pill.good { background: var(--good); }
.pill.warn { background: var(--warn); }
.pill.bad  { background: var(--bad); }

.admin-filter-bar {
    display: flex; gap: 8px; align-items: center;
    margin: 6px 0 12px;
}
.admin-filter-bar input[type=text],
.admin-filter-bar select { width: auto; flex: 0 0 auto; min-width: 140px; }

.admin-pager { margin-top: 10px; }
.admin-pager .btn { margin-right: 4px; }

/* ID review cards */
.admin-id-card h3 { margin: 0 0 4px; }
.admin-id-thumbs  {
    display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0;
}
.admin-id-thumbs > div { text-align: center; }
.admin-id-thumb {
    max-width: 280px;  max-height: 220px;
    border: 1px solid var(--border); border-radius: 4px;
    background: #fff;
}

@media (max-width: 800px) {
    .admin-shell  { grid-template-columns: 1fr; }
    .admin-sidebar{ position: static; }
}

/* ============================================================
   WEBRTC  -  webcam.php simple 2-pane call
   ============================================================ */
.rtc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 12px;
    margin: 10px 0;
}
.rtc-pane {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px;
    display: flex;
    flex-direction: column;
}
.rtc-pane-title {
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 700; color: var(--accent);
    padding: 4px 6px 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}
.rtc-video {
    width: 100%;
    background: #000;            /* inside the <video> only -- pixels carry contrast */
    border: 1px solid var(--border);
    border-radius: 4px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* ============================================================
   MACHINE_3D  -  machine.php two-sided operator layout
   ============================================================ */
.mach-root {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 10px 0;
}

.mach-video-row,
.mach-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.mach-video-row[data-expanded] {
    grid-template-columns: 1fr;     /* one pane fills the row */
}

.mach-pane {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.mach-pane-title {
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 700; color: var(--accent);
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px; margin-bottom: 8px;
}
.mach-pane-title .btn { padding: 3px 9px; font-size: 12px; }

.mach-pane.mach-ctrl table { margin-top: 10px; }
.mach-pane.mach-ctrl table th,
.mach-pane.mach-ctrl table td { padding: 6px 8px; font-size: 14px; }
.mach-pane.mach-ctrl table td { font-family: Consolas, monospace; color: var(--accent); font-weight: 700; }

.mach-pane.mach-chat .chat-window { height: 180px; min-height: 120px; }

@media (max-width: 800px) {
    .mach-video-row,
    .mach-bottom-row { grid-template-columns: 1fr; }
}
