/*
 * Hubmaster v4 visual refresh
 *
 * Loaded after custom.css. CSS only - no markup or page logic changes.
 * Remove the <link> to refresh.css in layouts/app.blade.php to undo it all.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --hm-navy: #2f3352;        /* sidebar, brand */
    --hm-navy-2: #3c4164;      /* v3 navy, hover/active surfaces */
    --hm-accent: #5468d4;      /* links, primary buttons, focus */
    --hm-accent-dark: #4255bd;
    --hm-bg: #f4f6fa;          /* page background */
    --hm-surface: #ffffff;     /* cards */
    --hm-border: #e4e8f0;
    --hm-text: #1f2433;
    --hm-muted: #6b7285;
    --hm-success: #1f9d6b;
    --hm-warning: #d9822b;
    --hm-danger: #d14343;
    --hm-radius: 10px;
    --hm-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .08);
}

/* ---------- Base ---------- */

body {
    font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 14px;
    color: var(--hm-text);
    background: var(--hm-navy);
    padding-top: 56px;
    -webkit-font-smoothing: antialiased;
}

#app, #page-wrapper {
    background: var(--hm-bg);
}
/* the sidebar lives in the fixed top bar, so if a wide table made the whole
   page scroll sideways the sidebar would slide over the content; keep any
   sideways scroll inside the content area instead */
#page-wrapper {
    overflow-x: auto;
}

a {
    color: var(--hm-accent);
}
a:hover, a:focus {
    color: var(--hm-accent-dark);
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4 {
    font-family: inherit;
    color: var(--hm-text);
    font-weight: 600;
    letter-spacing: -0.01em;
}
h1, .h1 { font-size: 28px; }
h2, .h2 { font-size: 22px; }
h3, .h3 { font-size: 18px; }

.text-muted { color: var(--hm-muted); }

/* ---------- Top bar ---------- */

.navbar-default {
    background: var(--hm-surface);
    border: 0;
    border-bottom: 1px solid var(--hm-border);
    min-height: 56px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
/* Brand cell above the sidebar: white, so the navy/red HubMaster logo
   (images/hubmaster-logo-nav.png) reads; was navy for the old white logo */
.navbar-nav > li > a.navbar-brand {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hm-surface);
    border-right: 1px solid var(--hm-border);
    padding: 6px 16px;
}
.navbar-brand > img {
    max-height: 42px;
    max-width: 100%;
    width: auto;
}
.navbar-default .navbar-nav > li > a,
.navbar-default .navbar-text {
    color: var(--hm-text);
    font-size: 14px;
    font-weight: 500;
    line-height: 26px;
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:focus,
.navbar-default .navbar-nav > .open > a:hover {
    background: var(--hm-bg);
    color: var(--hm-text);
}
.dropdown-menu {
    border: 1px solid var(--hm-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .12);
    padding: 6px 0;
}
.dropdown-menu > li > a {
    padding: 7px 16px;
}

/* ---------- Sidebar ---------- */

.sidebar {
    background: var(--hm-navy);
    margin-top: 56px;
    border: 0;
}
.sidebar ul li {
    border-bottom: 0;
}
.sidebar .nav > li > a {
    color: rgba(255, 255, 255, .78);
    padding: 10px 18px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background .12s, color .12s;
}
.sidebar .nav > li > a .fa {
    width: 18px;
    margin-right: 6px;
    text-align: center;
    opacity: .85;
}
.sidebar .nav > li > a:hover,
.sidebar .nav > li > a:focus {
    color: #fff;
    background: rgba(255, 255, 255, .07);
}
.sidebar ul li a.active,
.sidebar .nav > li.active > a {
    color: #fff;
    background: rgba(255, 255, 255, .1);
    border-left-color: var(--hm-accent);
}
/* the < / v chevron kept Font Awesome's 14px line-height and sat high
   against the taller menu line */
.sidebar .nav a .fa.arrow {
    line-height: inherit;
}
/* second level (channels, sources) */
.sidebar .nav-second-level {
    background: rgba(0, 0, 0, .14);
}
.sidebar .nav-second-level li a {
    padding: 8px 18px 8px 46px;
    font-size: 13px;
    font-weight: 400;
}

/* ---------- Page header + cards ---------- */

.main-panel > .panel-heading {
    background: transparent;
    padding: 20px 24px 4px;
}
.main-panel .panel-title {
    color: var(--hm-text);
    font-size: 20px;
    font-weight: 600;
}
.main-panel .panel-title strong.bc {
    color: var(--hm-muted);
    font-weight: 500;
}
.main-panel > .panel-body {
    padding: 16px 24px 32px;
}

.panel {
    background: var(--hm-surface);
    border: 1px solid var(--hm-border);
    border-radius: var(--hm-radius);
    box-shadow: var(--hm-shadow);
}
.panel-default > .panel-heading {
    background: transparent;
    border-bottom: 1px solid var(--hm-border);
    color: var(--hm-text);
    padding: 14px 18px;
    border-radius: var(--hm-radius) var(--hm-radius) 0 0;
}
.panel-heading .panel-title,
.panel-heading h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}
/* some cards put a full h1/h2 in the heading bar (dashboard welcome, subscription) */
.panel-heading > h1,
.panel-heading > h2 {
    font-size: 18px;
    margin: 0;
}
/* charts render an empty heading bar; hide it rather than draw a blank strip */
.panel-heading:empty {
    display: none;
}
.panel-body > h4:first-child {
    margin-top: 0;
    font-size: 15px;
    font-weight: 600;
}
.subscription-price {
    display: inline-block;
    white-space: nowrap;
    margin: 0 0 10px 8px;
    color: var(--hm-muted);
    font-weight: 500;
}
.panel-body {
    padding: 18px;
}
.panel-footer {
    background: #fafbfd;
    border-top: 1px solid var(--hm-border);
    border-radius: 0 0 var(--hm-radius) var(--hm-radius);
}
.main-panel {
    border: 0;
    box-shadow: none;
    border-radius: 0;
}

/* channel page tiles (Create a Listing / Browse ...) */
.chan-box,
.chan-row-1 .chan-box {
    border: 1px solid var(--hm-border);
    border-radius: var(--hm-radius);
    box-shadow: var(--hm-shadow);
    font-size: 22px;
    font-weight: 500;
    transition: box-shadow .15s, transform .15s;
}
.chan-box:hover {
    box-shadow: 0 6px 16px rgba(16, 24, 40, .1);
    transform: translateY(-1px);
}
.chan-bar {
    background: var(--hm-surface);
    border: 1px solid var(--hm-border);
    border-radius: var(--hm-radius);
    box-shadow: var(--hm-shadow);
    padding: 14px 18px;
}
.chan-bar .bar-label {
    font-size: 12px;
    letter-spacing: .04em;
    color: var(--hm-muted);
}

/* ---------- Tables ---------- */

.table {
    background: var(--hm-surface);
    margin-bottom: 0;
}
.table > thead > tr > th {
    border-bottom: 1px solid var(--hm-border);
    color: var(--hm-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #fafbfd;
}
.table > thead > tr > th,
.table > tbody > tr > td,
.table > tbody > tr > th {
    padding: 9px 10px;
    vertical-align: middle;
    border-top-color: var(--hm-border);
}
.table-bordered,
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > td {
    border-color: var(--hm-border);
}
.table-bordered {
    border-radius: 8px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
}
.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #fafbfd;
}
/* Striped tables (most lists) get a light rounded frame so they read as one
   block inside their card. Corners are rounded on the cells rather than with
   overflow: hidden, which would clip dropdown menus opened inside a row. */
.table-striped {
    border: 1px solid var(--hm-border);
    border-radius: 8px;
    border-collapse: separate;
    border-spacing: 0;
}
.table-striped > thead + tbody > tr:first-child > td,
.table-striped > thead + tbody > tr:first-child > th {
    border-top: 0;
}
.table-striped > :first-child > tr:first-child > :first-child { border-top-left-radius: 7px; }
.table-striped > :first-child > tr:first-child > :last-child { border-top-right-radius: 7px; }
.table-striped > :last-child > tr:last-child > :first-child { border-bottom-left-radius: 7px; }
.table-striped > :last-child > tr:last-child > :last-child { border-bottom-right-radius: 7px; }
.table-hover > tbody > tr:hover {
    background-color: #f1f4fb;
}

/* Breathing room around tables: a button (or anything else) placed straight
   above a table sat flush on it, and so did the section after a button row
   below one, e.g. New Feed / View All Feeds on the SP-API channel page.
   Vertical margins collapse with a heading's, so this adds nothing there. */
* + .table-responsive,
* + table.table {
    margin-top: 12px;
}
.table-responsive + .text-right,
table.table + .text-right {
    margin: 10px 0 16px;
}
/* Same for a block placed straight after a button, directly or after a <br>
   (eBay seller events: Old Relist Page, Relist all Results) */
.btn + .container-fluid,
.btn + .panel,
.btn + br + * {
    margin-top: 12px;
}
/* Action buttons that wrap onto a second line in a row no longer touch */
.table td .btn {
    margin-top: 2px;
    margin-bottom: 2px;
}

/* Bootstrap 4/5 spacing helpers used by the SP-API views; Bootstrap 3 has none */
.mt-1 { margin-top: 4px !important; }  .mb-1 { margin-bottom: 4px !important; }
.mt-2 { margin-top: 8px !important; }  .mb-2 { margin-bottom: 8px !important; }
.mt-3 { margin-top: 16px !important; } .mb-3 { margin-bottom: 16px !important; }
.mt-4 { margin-top: 24px !important; } .mb-4 { margin-bottom: 24px !important; }

/* ---------- Buttons + forms ---------- */

.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 7px 14px;
    transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn-sm, .btn-group-sm > .btn { padding: 5px 10px; border-radius: 5px; }
.btn-xs, .btn-group-xs > .btn { padding: 2px 7px; border-radius: 4px; }
.btn-default {
    background: var(--hm-surface);
    border-color: #d5dae5;
    color: var(--hm-text);
}
.btn-default:hover, .btn-default:focus {
    background: #f3f5fa;
    border-color: #c4cad8;
}
.btn-primary {
    background: var(--hm-accent);
    border-color: var(--hm-accent);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: var(--hm-accent-dark);
    border-color: var(--hm-accent-dark);
}
.btn-success { background: var(--hm-success); border-color: var(--hm-success); }
.btn-warning { background: var(--hm-warning); border-color: var(--hm-warning); }
.btn-danger  { background: var(--hm-danger);  border-color: var(--hm-danger); }

.form-control {
    border-radius: 6px;
    border-color: #d5dae5;
    box-shadow: none;
    height: 36px;
}
textarea.form-control { height: auto; }
.form-control:focus {
    border-color: var(--hm-accent);
    box-shadow: 0 0 0 3px rgba(84, 104, 212, .15);
}
label, .control-label {
    font-weight: 500;
    color: var(--hm-text);
}
.select2-container--bootstrap .select2-selection {
    border-radius: 6px;
    border-color: #d5dae5;
}

/* ---------- Status colours ---------- */

.label { border-radius: 4px; font-weight: 600; padding: .3em .6em; }
.label-success { background: var(--hm-success); }
.label-warning { background: var(--hm-warning); }
.label-danger  { background: var(--hm-danger); }
.label-primary { background: var(--hm-accent); }

.alert {
    border-radius: 8px;
    border: 1px solid transparent;
}
.alert-success { background: #e8f6f0; border-color: #bfe6d5; color: #135e40; }
.alert-info    { background: #eaf0fd; border-color: #c9d5f7; color: #2b3f8f; }
.alert-warning { background: #fdf3e7; border-color: #f4d6b0; color: #8a4f12; }
.alert-danger  { background: #fbeaea; border-color: #f0c4c4; color: #8c2121; }

/* event log (dashboard) */
.log-time {
    white-space: nowrap;
    color: var(--hm-muted);
    font-variant-numeric: tabular-nums;
}
.log-level {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .03em;
    background: #eef1f6;
    color: var(--hm-muted);
}
.log-level-error, .log-level-critical, .log-level-emergency, .log-level-alert {
    background: #fbeaea;
    color: var(--hm-danger);
}
.log-level-warning {
    background: #fdf3e7;
    color: var(--hm-warning);
}
.log-level-notice {
    background: #eaf0fd;
    color: var(--hm-accent-dark);
}

/* ---------- Tabs + pagination ---------- */

.nav-tabs {
    border-bottom: 1px solid var(--hm-border);
}
.nav-tabs > li > a {
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--hm-muted);
    font-weight: 500;
    margin-right: 6px;
}
.nav-tabs > li > a:hover {
    background: transparent;
    color: var(--hm-text);
}
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
    border: 0;
    border-bottom: 2px solid var(--hm-accent);
    color: var(--hm-text);
    background: transparent;
}

.pagination > li > a,
.pagination > li > span {
    color: var(--hm-text);
    border-color: var(--hm-border);
    margin: 0 2px;
    border-radius: 6px !important;
    min-width: 34px;
    text-align: center;
}
.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover {
    background: var(--hm-accent);
    border-color: var(--hm-accent);
}
