/* ============================================================
   MyWeb Hosting — Support Site
   Design tokens: navy / teal / amber, in keeping with existing
   MyWeb Hosting brand colours. Signature motif: LED-style status
   dots (a nod to server rack indicator lights) used both on the
   status page and as small accents elsewhere.
   ============================================================ */

:root {
    --navy: #0B2545;
    --navy-deep: #071A33;
    --navy-rgb: 11, 37, 69;
    --teal: #1C7C7C;
    --teal-light: #2D9C9C;
    --teal-rgb: 28, 124, 124;
    --amber: #E8A33D;
    --amber-deep: #93660f;
    --amber-rgb: 232, 163, 61;
    --bg: #F4F6F8;
    --message-bg: #EAF6F5;
    --message-bg-border: #BFD9D6;
    --card: #FFFFFF;
    --text: #1B2430;
    --muted: #5C6672;
    --border: #E1E5EA;
    --success: #2E9E63;
    --warning: #E8A33D;
    --danger: #D6493F;

    --font-display: "Space Grotesk", "Segoe UI", sans-serif;
    --font-body: "Inter", "Segoe UI", sans-serif;

    --radius: 10px;
    --shadow: 0 1px 2px rgba(var(--navy-rgb), 0.06), 0 6px 16px rgba(var(--navy-rgb), 0.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 0.4em;
    color: var(--navy-deep);
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

button, input, select { font-family: inherit; }

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Top nav ---------- */

.site-nav {
    background: var(--navy);
    position: relative;
}

.site-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-family: var(--font-display);
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.brand-sub {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.6);
    font-family: var(--font-body);
}

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-links a {
    color: rgba(255,255,255,0.78);
    font-size: 0.92rem;
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
    text-decoration: none;
}

.brand-logo {
    height: 36px;
    max-height: 36px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .brand-logo {
        height: 28px;
        max-height: 28px;
        max-width: 110px;
    }
}

.phone-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 99px;
    padding: 6px 14px;
    color: #fff !important;
    font-weight: 600;
    font-size: 0.86rem;
}

.phone-badge:hover {
    background: rgba(255,255,255,0.16);
    text-decoration: none;
}

.phone-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--amber);
    flex-shrink: 0;
}

/* signature hairline: amber/teal trace under the nav */
.nav-trace {
    height: 3px;
    background: linear-gradient(90deg, var(--amber) 0%, var(--teal) 55%, transparent 100%);
}

/* ---------- Page header ---------- */

.page-header {
    padding: 44px 0 28px;
}

.page-header p.lead {
    color: var(--muted);
    font-size: 1.02rem;
    max-width: 620px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 10px;
}

.eyebrow .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--amber);
}

/* ---------- Filter bar ---------- */

.filter-bar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 200px;
}

.field label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.field select,
.field input,
.field textarea {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.94rem;
    color: var(--text);
    background: #fff;
}

.field select:focus,
.field input:focus,
.field textarea:focus {
    border-color: var(--teal);
}

.result-count {
    color: var(--muted);
    font-size: 0.88rem;
    margin-left: auto;
    align-self: center;
}

/* ---------- Video grid ---------- */

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding-bottom: 56px;
}

@media (max-width: 880px) {
    .video-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .video-grid { grid-template-columns: 1fr; }
    .result-count { margin-left: 0; }
}

.video-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.video-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--navy-deep);
    overflow: hidden;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-badge::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 18px solid #fff;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    margin-left: 3px;
}

.play-badge::before {
    content: "";
    position: absolute;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(var(--navy-rgb), 0.55);
}

.video-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.video-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--navy-deep);
    line-height: 1.35;
}

.tag-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: auto;
}

.tag {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 3px 9px;
    border-radius: 99px;
    background: rgba(var(--teal-rgb), 0.1);
    color: var(--teal);
}

.tag.tag-amber {
    background: rgba(var(--amber-rgb), 0.15);
    color: var(--amber-deep);
}

.empty-state {
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    color: var(--muted);
    grid-column: 1 / -1;
}

/* ---------- Modal (video player) ---------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 26, 51, 0.78);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 100;
}

.modal-overlay.open { display: flex; }

.modal-box {
    background: #000;
    width: min(880px, 100%);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.modal-box .ratio {
    aspect-ratio: 16 / 9;
}

.modal-box iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.modal-close {
    position: absolute;
    top: -42px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}

/* ---------- Status page ---------- */

.status-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 56px;
}

.status-row {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
}

.led {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-operational .led {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(46, 158, 99, 0.18), 0 0 8px rgba(46, 158, 99, 0.7);
}
.status-degraded .led {
    background: var(--warning);
    box-shadow: 0 0 0 4px rgba(232, 163, 61, 0.2), 0 0 8px rgba(232, 163, 61, 0.7);
}
.status-down .led {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(214, 73, 63, 0.2), 0 0 8px rgba(214, 73, 63, 0.7);
}

@media (prefers-reduced-motion: no-preference) {
    .status-operational .led { animation: pulse-soft 2.6s ease-in-out infinite; }
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.status-row-main { flex: 1; min-width: 0; }

.status-row-name {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--navy-deep);
    font-size: 1.02rem;
}

.status-row-message {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 2px;
}

.status-pill {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 5px 11px;
    border-radius: 99px;
    white-space: nowrap;
}
.status-operational .status-pill { background: rgba(46, 158, 99, 0.12); color: var(--success); }
.status-degraded .status-pill { background: rgba(232, 163, 61, 0.18); color: #93660f; }
.status-down .status-pill { background: rgba(214, 73, 63, 0.12); color: var(--danger); }

.status-updated {
    color: var(--muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

/* ---------- Homepage welcome message (admin WYSIWYG content) ---------- */

.homepage-message {
    background: var(--message-bg);
    border: 1px solid var(--message-bg-border);
    border-left: 4px solid var(--teal);
    border-radius: var(--radius);
    padding: 22px 26px;
    margin: 28px 0 8px;
    overflow: hidden; /* contain floated images so the border wraps them */
}

.homepage-message::after { content: ""; display: block; clear: both; }

.homepage-message > *:first-child { margin-top: 0; }
.homepage-message > *:last-child { margin-bottom: 0; }
.homepage-message p { margin: 0 0 12px; color: var(--text); }
.homepage-message img { max-width: 100%; border-radius: 8px; margin: 10px 0; }
.homepage-message h1, .homepage-message h2, .homepage-message h3 { margin-top: 18px; }
.homepage-message ul, .homepage-message ol { padding-left: 22px; margin: 0 0 12px; }
.homepage-message blockquote {
    border-left: 3px solid var(--border);
    padding-left: 14px;
    margin: 12px 0;
    color: var(--muted);
}
.homepage-message a { color: var(--teal); }

/* Quill formats that need to render correctly outside the editor too
   (Quill's own stylesheet only scopes these to .ql-editor) */
.ql-size-small { font-size: 0.75em; }
.ql-size-large { font-size: 1.5em; }
.ql-size-huge { font-size: 2.5em; }
.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }

/* Image wrap options set via the editor's image alignment buttons —
   roughly a 1/3-image, 2/3-text split, with the paragraph text wrapping
   around the image. */
.ql-image-float-left,
.ql-image-float-right {
    width: 33%;
    margin: 4px 0 14px;
}
.ql-image-float-left { float: left; margin-right: 20px; }
.ql-image-float-right { float: right; margin-left: 20px; }
.ql-image-full { display: block; float: none; width: 100%; margin: 14px 0; }
.ql-image-selected { outline: 2px solid var(--teal); outline-offset: 2px; }

@media (max-width: 600px) {
    .ql-image-float-left,
    .ql-image-float-right {
        float: none;
        width: 100%;
        margin: 10px 0;
    }
}

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 22px 0 40px;
    color: var(--muted);
    font-size: 0.84rem;
}

/* ---------- Admin ---------- */

.admin-shell { min-height: 100vh; }

.admin-nav {
    background: var(--navy-deep);
}

.admin-nav .container {
    display: flex;
    align-items: center;
    height: 60px;
    gap: 26px;
}

.admin-nav .brand-name { color: #fff; font-size: 1.02rem; }

.admin-nav a {
    color: rgba(255,255,255,0.72);
    font-size: 0.9rem;
}
.admin-nav a:hover, .admin-nav a.active { color: #fff; }

.admin-main {
    padding: 32px 0 60px;
}

.admin-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.admin-table th {
    text-align: left;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
}

.admin-table td {
    border-bottom: 1px solid var(--border);
    padding: 12px;
    vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--navy);
    color: #fff;
}

.btn:hover { background: var(--navy-deep); }

.btn-secondary {
    background: #fff;
    color: var(--navy);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg); }

.btn-danger {
    background: #fff;
    color: var(--danger);
    border: 1px solid var(--border);
}
.btn-danger:hover { background: #fdf1f0; }

.btn-sm { padding: 6px 12px; font-size: 0.82rem; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
}

.form-grid .field-full { grid-column: 1 / -1; }

.alert {
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
    margin-bottom: 18px;
}
.alert-success { background: rgba(46, 158, 99, 0.12); color: #1d6e44; }
.alert-error { background: rgba(214, 73, 63, 0.1); color: var(--danger); }

.muted-link { color: var(--muted); font-size: 0.86rem; }

.priority-hint { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }

/* ---------- Toggle switch (e.g. show/hide support phone) ---------- */

.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 99px;
    transition: background 0.15s ease;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--teal);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

/* ---------- Color picker fields ---------- */

.color-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-field input[type="color"] {
    width: 44px;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.color-field input[type="text"] {
    width: 110px;
    font-family: monospace;
    text-transform: uppercase;
}

/* ---------- Logo preview / upload ---------- */

.logo-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.logo-preview img {
    max-height: 60px;
    max-width: 200px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 6px;
}

.logo-preview .no-logo {
    color: var(--muted);
    font-size: 0.88rem;
}
