/* ============================================================
   DVchi TrustGuard: Stylesheet
   Brand: Cyan #00C2D4 · Yellow #FFE900 · Dark #111 · Green #22C55E
   ============================================================ */

.dvchi-tg-wrap, .dvchi-tg-admin { font-family: 'Inter', -apple-system, sans-serif; color: #374151; }
.dvchi-tg-wrap { max-width: 760px; margin: 0 auto; }
.dvchi-tg-wrap *, .dvchi-tg-admin * { box-sizing: border-box; }

/* ── Shared ───────────────────────────────────────────── */
.dvchi-tg-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.dvchi-tg-empty { color: #9ca3af; font-size: 13px; padding: 16px; text-align: center; }
.dvchi-tg-loading { color: #9ca3af; font-size: 13px; padding: 16px; text-align: center; }
.dvchi-tg-login-prompt { background: #f8f8f4; border: 1px solid #e5e7eb; border-radius: 10px; padding: 20px; text-align: center; font-size: 14px; }
.dvchi-tg-login-prompt a { color: #00C2D4; font-weight: 600; }
.dvchi-tg-notice-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FCA5A5; padding: 10px 14px; border-radius: 8px; font-size: 13px; }

/* Buttons */
.dvchi-tg-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 6px; font-family: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; border: 1.5px solid #e5e7eb; background: #fff; color: #374151; transition: all .2s; }
.dvchi-tg-btn:hover { border-color: #00C2D4; color: #00C2D4; }
.dvchi-tg-btn-primary { background: #00C2D4; color: #fff; border-color: #00C2D4; }
.dvchi-tg-btn-primary:hover { background: #0098A8; border-color: #0098A8; color: #fff; }
.dvchi-tg-btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.dvchi-tg-btn:disabled { opacity: .6; cursor: not-allowed; }

/* Report trigger link */
.dvchi-tg-report-trigger {
  background: none; border: none; color: #9ca3af; font-size: 12px; font-weight: 500;
  cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: all .15s;
}
.dvchi-tg-report-trigger:hover { color: #ef4444; background: #fee2e2; }

/* Form fields (shared with modal + age verify) */
.dvchi-tg-form-field { margin-bottom: 12px; }
.dvchi-tg-form-field label { display: block; font-size: 0.78rem; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.dvchi-tg-form-field input, .dvchi-tg-form-field select, .dvchi-tg-form-field textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid #e5e7eb; border-radius: 6px;
  font-family: inherit; font-size: 0.92rem; color: #111; background: #fff; outline: none; transition: border-color .2s;
}
.dvchi-tg-form-field input:focus, .dvchi-tg-form-field select:focus, .dvchi-tg-form-field textarea:focus { border-color: #00C2D4; }
.dvchi-tg-form-field textarea { resize: vertical; min-height: 60px; }
.dvchi-tg-form-hint { font-size: 11px; color: #9ca3af; margin: 4px 0 0; }

/* ── Report modal ─────────────────────────────────────── */
.dvchi-tg-modal {
  position: fixed; inset: 0; background: rgba(17,17,17,0.5); z-index: 9999;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.dvchi-tg-modal-box {
  background: #fff; border-radius: 14px; padding: 26px; max-width: 460px; width: 100%;
  max-height: 90vh; overflow-y: auto; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.dvchi-tg-modal-close {
  position: absolute; top: 14px; right: 14px; background: none; border: none;
  font-size: 22px; color: #9ca3af; cursor: pointer; line-height: 1; padding: 4px;
}
.dvchi-tg-modal-close:hover { color: #ef4444; }
.dvchi-tg-modal-box h3 { font-size: 18px; font-weight: 700; color: #111; margin: 0 0 8px; }
.dvchi-tg-modal-box > p { font-size: 13px; color: #6b7280; margin: 0 0 16px; line-height: 1.5; }
.dvchi-tg-modal-actions { display: flex; gap: 10px; margin-top: 14px; }
#dvchi-tg-report-feedback, #dvchi-tg-age-feedback { margin-top: 10px; font-size: 13px; }
#dvchi-tg-report-feedback.success, #dvchi-tg-age-feedback.success { color: #1A7040; }
#dvchi-tg-report-feedback.error, #dvchi-tg-age-feedback.error { color: #991B1B; }

/* ── Community Warning overlay ───────────────────────────── */
.dvchi-tg-warning-wrap { position: relative; }
.dvchi-tg-warning-cover {
  background: #FFFBEB; border: 1.5px solid #FCD34D; border-radius: 12px; padding: 28px 20px;
  text-align: center;
}
.dvchi-tg-warning-cover span { font-size: 32px; display: block; margin-bottom: 8px; }
.dvchi-tg-warning-cover h4 { font-size: 16px; font-weight: 700; color: #92400E; margin: 0 0 8px; }
.dvchi-tg-warning-cover p { font-size: 13px; color: #92400E; margin: 0 0 16px; line-height: 1.6; max-width: 460px; margin-left: auto; margin-right: auto; }

/* ── Age gate ─────────────────────────────────────────── */
.dvchi-tg-agegate {
  background: #F3F4F6; border: 1.5px solid #D1D5DB; border-radius: 12px; padding: 28px 20px; text-align: center;
}
.dvchi-tg-agegate span { font-size: 32px; display: block; margin-bottom: 8px; }
.dvchi-tg-agegate h4 { font-size: 16px; font-weight: 700; color: #111; margin: 0 0 8px; }
.dvchi-tg-agegate p { font-size: 13px; color: #6b7280; margin: 0 0 16px; }

/* ── Removed / restricted states ─────────────────────────── */
.dvchi-tg-removed {
  background: #FEF2F2; border: 1.5px solid #FCA5A5; border-radius: 12px; padding: 24px 20px; text-align: center;
}
.dvchi-tg-removed span { font-size: 28px; display: block; margin-bottom: 6px; }
.dvchi-tg-removed p { font-size: 13px; color: #991B1B; margin: 0; }
.dvchi-tg-removed--admin { text-align: left; }
.dvchi-tg-removed--admin > p { text-align: center; margin-bottom: 12px; }
.dvchi-tg-admin-actions { opacity: .6; border: 1px dashed #FCA5A5; border-radius: 8px; padding: 12px; }
.dvchi-tg-admin-bar { margin-top: 10px; text-align: center; opacity: 1; }

.dvchi-tg-restricted {
  background: #F3F4F6; border: 1px solid #D1D5DB; border-radius: 10px; padding: 18px; text-align: center;
}
.dvchi-tg-restricted span { font-size: 22px; display: block; margin-bottom: 4px; }
.dvchi-tg-restricted p { font-size: 12px; color: #6b7280; margin: 0; }
.dvchi-tg-restricted-owner .dvchi-tg-banner {
  background: #F3F4F6; border: 1px solid #D1D5DB; border-radius: 8px; padding: 8px 12px;
  font-size: 12px; color: #6b7280; margin-bottom: 10px;
}

/* ── Reviewer dashboard ───────────────────────────────────── */
.dvchi-tg-invite-card { border-color: #00C2D4; background: linear-gradient(135deg, #E0F9FC, #fff); }
.dvchi-tg-invite-card h3 { font-size: 16px; margin: 0 0 8px; }
.dvchi-tg-invite-card p { font-size: 13px; color: #374151; line-height: 1.6; margin: 0 0 4px; }

.dvchi-tg-stats-card h3 { font-size: 15px; margin: 0 0 14px; color: #111; }
.dvchi-tg-stats-row { display: flex; gap: 24px; }
.dvchi-tg-stats-row div { text-align: center; }
.dvchi-tg-stats-row strong { display: block; font-size: 22px; font-weight: 700; color: #00C2D4; }
.dvchi-tg-stats-row span { font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.04em; }
.dvchi-tg-suspended-note { font-size: 12px; color: #991B1B; margin: 12px 0 0; }

/* Review queue items in reviewer dashboard */
.dvchi-tg-queue-item { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; margin-bottom: 10px; }
.dvchi-tg-queue-item h4 { font-size: 14px; font-weight: 600; color: #111; margin: 0 0 6px; }
.dvchi-tg-queue-item .reports-summary { font-size: 12px; color: #6b7280; margin-bottom: 10px; }
.dvchi-tg-queue-item .reports-summary span { display: inline-block; background: #F3F4F6; border-radius: 999px; padding: 2px 10px; margin: 2px 4px 2px 0; }
.dvchi-tg-decision-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.dvchi-tg-decision-btn {
  padding: 7px 14px; border-radius: 6px; border: 1.5px solid #e5e7eb; background: #fff;
  font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all .15s;
}
.dvchi-tg-decision-btn[data-decision="accurate"]:hover, .dvchi-tg-decision-btn[data-decision="accurate"].selected { border-color: #ef4444; color: #ef4444; background: #FEF2F2; }
.dvchi-tg-decision-btn[data-decision="inaccurate"]:hover, .dvchi-tg-decision-btn[data-decision="inaccurate"].selected { border-color: #22C55E; color: #22C55E; background: #F0FDF4; }
.dvchi-tg-decision-btn[data-decision="needs_investigation"]:hover, .dvchi-tg-decision-btn[data-decision="needs_investigation"].selected { border-color: #F59E0B; color: #F59E0B; background: #FFFBEB; }
.dvchi-tg-decision-notes { width: 100%; margin-top: 8px; padding: 8px 12px; border: 1.5px solid #e5e7eb; border-radius: 6px; font-family: inherit; font-size: 0.85rem; resize: vertical; min-height: 50px; }
.dvchi-tg-decision-submit { margin-top: 8px; }
.dvchi-tg-decision-done { font-size: 12px; color: #22C55E; font-weight: 600; margin-top: 8px; }

/* My reports table */
.dvchi-tg-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dvchi-tg-table th { text-align: left; padding: 8px 10px; background: #F8F8F4; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7280; }
.dvchi-tg-table td { padding: 8px 10px; border-bottom: 1px solid #f3f4f6; }

/* ── Admin pages ──────────────────────────────────────────── */
.dvchi-tg-admin h1 { margin-bottom: 6px; }
.dvchi-tg-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0 30px; }
.dvchi-tg-stat-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 18px;
  text-align: center; text-decoration: none; transition: all .15s; display: block;
}
.dvchi-tg-stat-card:hover { border-color: #00C2D4; box-shadow: 0 4px 14px rgba(0,194,212,0.15); }
.dvchi-tg-stat-card strong { display: block; font-size: 28px; font-weight: 700; color: #00C2D4; }
.dvchi-tg-stat-card span { font-size: 12px; color: #6b7280; }

.dvchi-tg-admin .dvchi-tg-card { margin-bottom: 18px; }
.dvchi-tg-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #f3f4f6; }
.dvchi-tg-card-head h3 { margin: 0; font-size: 15px; color: #111; }
.dvchi-tg-meta { font-size: 12px; color: #9ca3af; margin-left: auto; }
.dvchi-tg-card-body { display: flex; gap: 24px; flex-wrap: wrap; }
.dvchi-tg-col { flex: 1 1 280px; min-width: 0; }
.dvchi-tg-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7280; margin: 0 0 8px; }
.dvchi-tg-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.dvchi-tg-list li { padding: 8px 0; border-bottom: 1px solid #f3f4f6; line-height: 1.5; }
.dvchi-tg-list li:last-child { border-bottom: none; }
.dvchi-tg-list .dvchi-tg-empty-li { color: #9ca3af; }
.dvchi-tg-loc { color: #9ca3af; font-size: 11px; }

/* Status pills */
.dvchi-tg-pill { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.dvchi-tg-pill--normal { background: #F0FDF4; color: #16A34A; }
.dvchi-tg-pill--warned { background: #FFFBEB; color: #B45309; }
.dvchi-tg-pill--restricted { background: #F3F4F6; color: #6B7280; }
.dvchi-tg-pill--removed { background: #FEF2F2; color: #B91C1C; }

/* Vote tally */
.dvchi-tg-vote-tally { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.dvchi-tg-vote { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.dvchi-tg-vote--accurate { background: #FEF2F2; color: #B91C1C; }
.dvchi-tg-vote--inaccurate { background: #F0FDF4; color: #16A34A; }
.dvchi-tg-vote--investigate { background: #FFFBEB; color: #B45309; }

/* Card actions / override row */
.dvchi-tg-card-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px;
  padding-top: 14px; border-top: 1px solid #f3f4f6;
}
.dvchi-tg-card-actions label { font-size: 12px; font-weight: 600; color: #6b7280; }
.dvchi-tg-status-select, .dvchi-tg-warning-text {
  padding: 7px 10px; border: 1.5px solid #e5e7eb; border-radius: 6px; font-family: inherit; font-size: 0.85rem;
}
.dvchi-tg-warning-text { flex: 1 1 220px; }
.dvchi-tg-inline-check { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: #374151 !important; text-transform: none; }
.dvchi-tg-appeal-notes { padding: 7px 10px; border: 1.5px solid #e5e7eb; border-radius: 6px; font-family: inherit; font-size: 0.85rem; flex: 1 1 220px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .dvchi-tg-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dvchi-tg-card-body { flex-direction: column; }
}
@media (max-width: 520px) {
  .dvchi-tg-stat-grid { grid-template-columns: 1fr; }
  .dvchi-tg-stats-row { gap: 14px; }
  .dvchi-tg-modal-box { padding: 18px; }
}

/* DVchi responsive: prevent iOS auto-zoom on input focus (>=16px on phones) */
@media (max-width: 782px) {
  .dvchi-tg-form-field input, .dvchi-tg-form-field select, .dvchi-tg-form-field textarea { font-size: 16px; }
}

/* DVchi responsive: admin tables scroll horizontally on small screens instead of overflowing the page */
@media (max-width: 782px) {
  .dvchi-tg-table-scroll { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .dvchi-tg-table-scroll thead, .dvchi-tg-table-scroll tbody, .dvchi-tg-table-scroll tr { white-space: normal; }
}


/* ==========================================================
   BLOCKING (v1.1.0)
   ========================================================== */
.dvchi-tg-block-trigger{
    display:inline-flex;align-items:center;justify-content:center;
    min-height:44px;padding:10px 18px;border:1px solid #d1d5db;border-radius:8px;
    background:#fff;color:#374151;font-size:15px;font-weight:600;cursor:pointer;
    line-height:1.2;
}
.dvchi-tg-block-trigger:hover{background:#f9fafb;border-color:#9ca3af}
.dvchi-tg-block-trigger.is-blocked{background:#111;border-color:#111;color:#fff}

.dvchi-tg-btn-danger{background:#b91c1c;border-color:#b91c1c;color:#fff}
.dvchi-tg-btn-danger:hover{background:#991b1b;border-color:#991b1b}

#dvchi-tg-block-feedback{margin-top:12px;font-size:14px}
#dvchi-tg-block-feedback.success{color:#047857}
#dvchi-tg-block-feedback.error{color:#b91c1c}

.dvchi-tg-blocklist{max-width:100%;margin:0 0 28px}
.dvchi-tg-blocklist h3{margin:0 0 6px;font-size:20px}
.dvchi-tg-blocklist .dvchi-tg-muted{color:#6b7280;font-size:14px;margin:0 0 16px}
.dvchi-tg-blocklist .dvchi-tg-empty{color:#6b7280;font-style:italic}
.dvchi-tg-blocklist-items{list-style:none;margin:0;padding:0}
.dvchi-tg-blocklist-items li{
    display:flex;align-items:center;gap:12px;flex-wrap:wrap;
    padding:12px;border:1px solid #e5e7eb;border-radius:10px;margin-bottom:10px;
}
.dvchi-tg-blocklist-items img{border-radius:50%;flex:0 0 auto}
.dvchi-tg-bl-name{font-weight:600;flex:1 1 140px;min-width:0;word-break:break-word}
.dvchi-tg-bl-date{color:#6b7280;font-size:13px;flex:0 0 auto}
.dvchi-tg-unblock-btn{min-height:44px;padding:10px 18px;flex:0 0 auto}

/* Admin tables scroll rather than break the layout on small screens */
.dvchi-tg-tablewrap{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.dvchi-tg-tablewrap table{min-width:520px}
.dvchi-tg-admin .dvchi-tg-muted{color:#6b7280;font-size:12px}

@media (max-width:782px){
    .dvchi-tg-blocklist-items li{gap:10px}
    .dvchi-tg-bl-date{width:100%;order:3}
    .dvchi-tg-unblock-btn{width:100%;order:4}
}
@media (max-width:600px){
    /* 16px inputs stop iOS from zooming the page on focus */
    #dvchi-tg-block-modal input,
    #dvchi-tg-block-modal textarea,
    #dvchi-tg-block-modal select{font-size:16px}
    .dvchi-tg-block-trigger{width:100%}
}


/* ==========================================================
   ADMIN NAV BAR (v1.1.1)
   ========================================================== */
.dvchi-tg-navbar{
    display:flex;flex-wrap:wrap;align-items:center;gap:10px;
    margin:12px 0 20px;padding:10px 0 14px;border-bottom:1px solid #dcdcde;
}
.dvchi-tg-back{
    display:inline-flex;align-items:center;min-height:36px;
    padding:6px 14px;border:1px solid #00C2D4;border-radius:6px;
    background:#00C2D4;color:#111;font-weight:700;text-decoration:none;
}
.dvchi-tg-back:hover{background:#00aebe;border-color:#00aebe;color:#111}
.dvchi-tg-back:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #00C2D4;outline:none}

.dvchi-tg-navlinks{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.dvchi-tg-navlink{
    display:inline-flex;align-items:center;min-height:36px;
    padding:6px 12px;border:1px solid #dcdcde;border-radius:6px;
    background:#fff;color:#2271b1;text-decoration:none;font-size:13px;line-height:1.3;
}
.dvchi-tg-navlink:hover{background:#f6f7f7;border-color:#8c8f94}
.dvchi-tg-navlink.is-current{background:#111;border-color:#111;color:#FFE900;font-weight:700}

@media (max-width:782px){
    .dvchi-tg-navbar{gap:8px}
    .dvchi-tg-back{width:100%;justify-content:center;min-height:44px}
    .dvchi-tg-navlinks{width:100%}
    .dvchi-tg-navlink{min-height:44px;flex:1 1 46%;justify-content:center}
}


/* ==========================================================
   DEVICE PASS (v1.3.0 / v1.1.1)
   Same rules applied across the DVchi front end so behaviour
   is consistent between plugins on every screen size.
   ========================================================== */
.dvchi-tg-modal-box,.dvchi-review-wrap,.dvchi-trust-card{
    max-width:100%;box-sizing:border-box;}
.dvchi-tg-modal-box{max-height:min(88vh,900px);overflow:auto;}

@supports (padding:max(0px)){
    .dvchi-tg-modal{
        padding-left:max(16px,env(safe-area-inset-left));
        padding-right:max(16px,env(safe-area-inset-right));
        padding-bottom:max(16px,env(safe-area-inset-bottom));}
}

/* Wide tables scroll in their own box */
.dvchi-tg-tablewrap,.dvchi-trust-tablewrap{
    width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;}

@media (max-width:600px){
    /* 16px stops iOS zooming the page when a field takes focus */
    .dvchi-tg-modal input,.dvchi-tg-modal select,.dvchi-tg-modal textarea,
    .dvchi-review-wrap input,.dvchi-review-wrap select,.dvchi-review-wrap textarea{
        font-size:16px!important;}

    /* 44px minimum touch targets */
    .dvchi-tg-btn,.dvchi-tg-modal button,.dvchi-review-wrap button{min-height:44px;}

    .dvchi-tg-modal-box{padding:18px;border-radius:12px;}
    .dvchi-trust-card{padding:16px;}
    .dvchi-tscore-chip{font-size:12px;}
}

@media (prefers-reduced-motion:reduce){
    .dvchi-tg-modal *,.dvchi-trust-card *{
        animation-duration:.01ms!important;transition-duration:.01ms!important;}
}
