/* Portal shared styles — ci-includes.clearstaging.co.uk */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ── */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f0f2f5;
    color: #1a1a1a;
    font-size: 16px;
    line-height: 1.6;
}
.portal-index body { min-height: 100vh; }

a { color: #3a5fa0; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
header {
    background: #1a1a2e;
    color: #fff;
    padding: 0 40px;
    height: 68px;
    display: flex;
    align-items: center;
    gap: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.portal-review header { position: sticky; top: 0; z-index: 100; }

.header-logo { flex-shrink: 0; background: #fff; border-radius: 6px; padding: 6px 12px; display: flex; align-items: center; }
.header-logo img { height: 32px; width: auto; display: block; }
.header-divider { width: 1px; height: 28px; background: rgba(255,255,255,0.2); }

/* Index: header title text */
.header-text { flex: 1; }
.header-text h1 { font-size: 1.05rem; font-weight: 600; }
.header-text p  { font-size: 0.82rem; opacity: 0.55; margin-top: 1px; }
.header-actions { display: flex; align-items: center; gap: 8px; }

/* Review: header nav actions */
.header-nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Review: header nav */
.header-nav { display: flex; align-items: center; gap: 10px; flex: 1; }
.header-nav a { color: rgba(255,255,255,0.65); font-size: 0.9rem; font-weight: 500; transition: color 0.15s; }
.header-nav a:hover { color: #fff; text-decoration: none; }
.header-nav .sep { color: rgba(255,255,255,0.25); }
.header-nav .current { color: #fff; font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }

.header-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-avatar { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.header-user-name { font-size: 0.85rem; color: rgba(255,255,255,0.75); font-weight: 500; }
.header-btn {
    font-size: 12px; color: #555; text-decoration: none;
    padding: 5px 10px; border: 1px solid #ccc; border-radius: 5px;
    transition: all 0.15s; background: #fff; cursor: pointer;
    font-family: inherit; white-space: nowrap;
}
.header-btn:hover { color: #000; border-color: #999; text-decoration: none; }

/* ── Layout ── */
.portal-index main { max-width: 860px; margin: 48px auto; padding: 0 32px; }
.portal-review main { max-width: 1100px; margin: 36px auto; padding: 0 32px; display: flex; flex-direction: column; gap: 24px; }

/* ── Index: section label & empty state ── */
.section-label {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: #999; margin-bottom: 18px;
}
.empty {
    background: #fff; border-radius: 10px; border: 1px solid #dde1e7;
    padding: 60px 40px; text-align: center; color: #aaa;
}
.empty p { font-size: 1rem; }
.empty p + p { margin-top: 8px; font-size: 0.9rem; }

/* ── Index: PR cards ── */
.pr-list { display: flex; flex-direction: column; gap: 12px; }
.pr-card {
    background: #fff; border-radius: 10px; border: 1px solid #dde1e7;
    padding: 22px 28px; color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.pr-card-inner { display: flex; align-items: flex-start; gap: 20px; cursor: pointer; }
.pr-card:hover { border-color: #3a5fa0; box-shadow: 0 4px 16px rgba(58,95,160,0.12); }
.pr-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.btn-staff-edit {
    font-size: 12px; color: #555; background: #fff; border: 1px solid #ccc;
    border-radius: 5px; padding: 5px 10px; cursor: pointer;
    font-family: inherit; white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.btn-staff-edit:hover { color: #000; border-color: #999; }

.pr-info { flex: 1; min-width: 0; }
.portal-index .pr-branch { font-size: 1.1rem; font-weight: 700; color: #111; }
.portal-index .pr-round { font-size: 0.72rem; background: #eee; color: #666; padding: 2px 8px; border-radius: 8px; margin-left: 8px; font-weight: 500; }
.portal-index .pr-meta { font-size: 0.85rem; color: #999; margin-top: 4px; }
.portal-index .pr-domains { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.portal-index .pr-domains a {
    font-size: 0.85rem; color: #3a5fa0; text-decoration: none;
    background: #f0f5ff; border: 1px solid #c5d5f0;
    padding: 4px 10px; border-radius: 6px; display: inline-block;
}
.portal-index .pr-domains a:hover { background: #dceaff; text-decoration: none; }
.portal-index .pr-note { font-size: 0.875rem; color: #666; margin-top: 10px; font-style: italic; }
.pr-arrow { color: #ccc; font-size: 1.5rem; flex-shrink: 0; margin-top: 2px; }

/* ── Review: PR header card ── */
.card {
    background: #fff; border-radius: 10px; border: 1px solid #dde1e7;
    padding: 28px 32px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.card-label {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: #999; margin-bottom: 18px;
}
.pr-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.portal-review .pr-branch { font-size: 1.5rem; font-weight: 700; color: #111; line-height: 1.3; }
.portal-review .pr-round { font-size: 0.75rem; background: #eee; color: #555; padding: 3px 9px; border-radius: 10px; margin-left: 10px; font-weight: 500; vertical-align: middle; }
.portal-review .pr-meta { font-size: 0.9rem; color: #888; margin-top: 6px; }
.portal-review .pr-domains { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; }
.domain-link {
    display: inline-flex; align-items: center; gap: 8px;
    background: #f0f5ff; border: 1px solid #c5d5f0;
    border-radius: 8px; padding: 8px 14px;
    font-size: 0.9rem; color: #3a5fa0; text-decoration: none;
    transition: background 0.15s;
}
.domain-link:hover { background: #dceaff; text-decoration: none; }
.store-tag {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    background: #3a5fa0; color: #fff; padding: 2px 7px; border-radius: 4px;
}
.portal-review .pr-note {
    background: #fffbf0; border-left: 4px solid #f0a500;
    padding: 12px 16px; border-radius: 0 8px 8px 0;
    font-size: 0.95rem; font-style: italic; color: #555; margin-top: 16px;
}
.pr-header-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.btn-visit-site {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.82rem; font-weight: 600; color: #3a5fa0;
    background: #f0f5ff; border: 1px solid #c5d5f0;
    border-radius: 20px; padding: 5px 14px;
    text-decoration: none; transition: background 0.15s; white-space: nowrap;
}
.btn-visit-site:hover { background: #dceaff; text-decoration: none; }

/* ── Description truncation ── */
.portal-index .pr-description {
    font-size: 0.9rem; color: #555; margin-top: 10px; padding-top: 10px;
    border-top: 1px solid #eee; line-height: 1.5;
    max-height: 22.5em; overflow: hidden;
}
.portal-review .pr-description {
    font-size: 1rem; color: #444; margin-top: 12px; padding-top: 12px;
    border-top: 1px solid #eee; line-height: 1.6;
    max-height: 24em; overflow: hidden;
}
.pr-description p { margin: 0 0 6px; }
.pr-description p:last-child { margin-bottom: 0; }
.pr-description ol, .pr-description ul { padding-left: 1.4em; margin: 4px 0; }
.pr-description li { margin: 2px 0; }
.pr-description.expanded { max-height: none !important; }
.pr-desc-toggle {
    display: none; font-size: 0.82rem; color: #3a5fa0;
    background: none; border: none; padding: 4px 0 0; margin-top: 2px;
    cursor: pointer; font-family: inherit;
}
.pr-desc-toggle:hover { text-decoration: underline; }

/* ── Status badges ── */
.status-badge {
    display: inline-block; border-radius: 20px;
    font-size: 0.8rem; font-weight: 700; white-space: nowrap;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.portal-index .status-badge { padding: 7px 16px; flex-shrink: 0; }
.portal-review .status-badge { padding: 6px 14px; }
.status-review   { background: #fff3cd; color: #7d5a00; }
.status-approved { background: #d1e7dd; color: #0a5c36; }
.status-changes  { background: #f8d7da; color: #842029; }
.status-info     { background: #fff0cc; color: #7a4800; }

/* ── Staff edit controls (shared) ── */
.pr-edit-panel { display: none; margin-top: 16px; padding-top: 16px; border-top: 1px solid #e8eaee; }
.pr-edit-panel.open { display: block; }
.edit-field-label {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: #999; margin-bottom: 6px;
}
.edit-title-input {
    width: 100%; font-size: 1rem; font-family: inherit;
    border: 1px solid #cdd3db; border-radius: 6px;
    padding: 8px 12px; margin-bottom: 16px; transition: border-color 0.15s;
}
.edit-title-input:focus { outline: none; border-color: #3a5fa0; box-shadow: 0 0 0 3px rgba(58,95,160,0.1); }
.quill-wrapper { margin-bottom: 16px; }
.quill-wrapper .ql-container { font-family: inherit; font-size: 0.95rem; min-height: 120px; }
.edit-btn-row { display: flex; gap: 10px; align-items: center; }
.btn-save-edit {
    padding: 8px 20px; border-radius: 6px; border: none;
    background: #3a5fa0; color: #fff; font-size: 0.9rem;
    font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-save-edit:hover { background: #2e4d85; }
.btn-cancel-edit {
    padding: 8px 20px; border-radius: 6px; border: 1px solid #cdd3db;
    background: #fff; color: #555; font-size: 0.9rem;
    font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-cancel-edit:hover { background: #f5f5f5; }
.portal-index .edit-feedback { font-size: 0.85rem; margin-left: auto; align-self: center; }
.portal-review .edit-feedback { font-size: 0.85rem; margin-left: 6px; }

/* ── Test results (review only) ── */
.test-grid { display: flex; flex-direction: column; gap: 10px; }
.test-file-row { border: 1px solid #e4e8ee; border-radius: 8px; overflow: hidden; }
.test-file-header {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px; background: #f7f8fa;
    cursor: pointer; user-select: none; transition: background 0.15s;
}
.test-file-header:hover { background: #eef0f4; }
.toggle-icon { font-size: 1.1rem; color: #aaa; transition: transform 0.2s; flex-shrink: 0; }
.toggle-icon.open { transform: rotate(90deg); }
.test-file-name { font-size: 1rem; font-weight: 600; flex: 1; color: #222; }
.store-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.store-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.8rem; padding: 4px 10px; border-radius: 12px; font-weight: 600;
}
.store-name { opacity: 0.65; font-weight: 400; }
.test-file-body { display: none; padding: 16px 18px; border-top: 1px solid #e8eaee; background: #fff; }
.test-file-body.open { display: block; }

/* ── Video grid (review only) ── */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.video-block { background: #f7f8fa; border-radius: 8px; overflow: hidden; border: 1px solid #e4e8ee; }
.video-label {
    padding: 10px 14px; font-size: 0.85rem; font-weight: 600; color: #444;
    background: #eef0f4; border-bottom: 1px solid #e4e8ee;
    display: flex; align-items: center; justify-content: space-between;
}
.video-label a { font-size: 0.8rem; font-weight: 400; }
video { width: 100%; display: block; background: #000; max-height: 280px; }
.no-video { padding: 32px; text-align: center; color: #bbb; font-size: 0.9rem; }
.no-results { color: #aaa; font-size: 1rem; text-align: center; padding: 32px 0; }

/* ── Test descriptions (review only) ── */
.spec-describe { font-size: 0.8rem; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.spec-test-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.spec-test-list li { font-size: 0.9rem; color: #555; padding: 3px 0 3px 16px; position: relative; }
.spec-test-list li::before { content: '–'; position: absolute; left: 0; color: #bbb; }

/* ── Comment history (review only) ── */
.comment-list { display: flex; flex-direction: column; gap: 14px; }
.comment-item { display: flex; gap: 14px; }
.comment-avatar {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700; color: #fff;
}
.avatar-developer { background: #146ff8; }
.avatar-client     { background: #28a745; }
.comment-bubble { flex: 1; background: #f7f8fa; border-radius: 0 10px 10px 10px; padding: 12px 16px; }
.comment-meta { font-size: 0.82rem; color: #999; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comment-text { font-size: 0.95rem; color: #333; line-height: 1.55; }

/* ── Review action panel ── */
.review-panel-inner { display: flex; flex-direction: column; gap: 16px; }
.review-panel-inner label { font-size: 0.9rem; font-weight: 600; color: #444; display: block; margin-bottom: 6px; }
.review-panel-inner textarea {
    width: 100%; border: 1px solid #cdd3db; border-radius: 8px;
    padding: 12px 14px; font-size: 0.95rem; font-family: inherit;
    resize: vertical; min-height: 100px; line-height: 1.55; transition: border-color 0.15s;
}
.review-panel-inner textarea:focus { outline: none; border-color: #3a5fa0; box-shadow: 0 0 0 3px rgba(58,95,160,0.1); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
    padding: 12px 28px; border-radius: 8px; border: none;
    font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: background 0.15s, opacity 0.15s; font-family: inherit;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-approve { background: #198754; color: #fff; }
.btn-approve:hover:not(:disabled) { background: #157347; }
.btn-changes { background: #dc3545; color: #fff; }
.btn-changes:hover:not(:disabled) { background: #b02a37; }
.feedback-msg { font-size: 0.9rem; padding: 10px 14px; border-radius: 8px; display: none; }
.feedback-msg.success { background: #d1e7dd; color: #0a5c36; display: block; }
.feedback-msg.error   { background: #f8d7da; color: #842029; display: block; }
.already-reviewed { font-size: 1rem; text-align: center; padding: 12px 0; font-weight: 500; }

/* ── Footer ── */
.portal-footer { text-align: center; padding: 30px 20px; color: rgba(0,0,0,0.5); font-size: 13px; margin-top: 40px; }
.portal-footer a { color: #146ff8; text-decoration: none; font-weight: 600; }
.portal-footer a:hover { text-decoration: underline; }

/* ── Auth / Sign-in page ── */
body.portal-auth {
    background: #0f0f1a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e0e0e0;
}
.login-card {
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.logo-wrap {
    background: #fff;
    border-radius: 8px;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    margin-bottom: 28px;
}
.logo-wrap img { height: 32px; width: auto; display: block; }
.portal-auth h1 { font-size: 1.4rem; font-weight: 700; color: #fff; margin-bottom: 6px; }
.subtitle { font-size: 0.9rem; color: rgba(255,255,255,0.45); margin-bottom: 36px; line-height: 1.5; }
.google-btn-wrap { display: flex; justify-content: center; margin-bottom: 20px; min-height: 44px; }
.domain-note { font-size: 0.78rem; color: rgba(255,255,255,0.3); margin-top: 8px; }
.error-msg {
    background: rgba(220,53,69,0.15);
    border: 1px solid rgba(220,53,69,0.4);
    color: #f8a0a8;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.875rem;
    margin-bottom: 20px;
    display: none;
}
.error-msg.visible { display: block; }
.spinner-wrap {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.5);
    font-size: 0.875rem;
}
.spinner-wrap.visible { display: flex; }
.spinner {
    width: 28px; height: 28px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #4a9eff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── review.php: misc layout & components ──────────────────────────────────── */
.pr-info-main { flex: 1; min-width: 0; }
.portal-review .status-badge-sm { font-size: 0.7rem; padding: 3px 8px; }
.label-hint { font-weight: 400; color: #999; }

/* ── review.php: already-reviewed state messages ── */
.already-reviewed { margin-bottom: 20px; }
.already-reviewed--approved { color: #0a5c36; }
.already-reviewed--changes  { color: #842029; }
.already-reviewed--info     { color: #7a4800; }

/* ── review.php: test card content ── */
.test-card-title { font-size: 1rem; font-weight: 700; color: #222; margin: 0 0 8px; }
.test-card-desc  { font-size: 0.9rem; color: #555; margin: 0 0 16px; line-height: 1.6; }
