/**
 * Fanatically — Admin Stylesheet
 *
 * Layout matches Rotationally: top bar + sidebar + content area.
 * Colour palette:
 *   Page background:  45° diagonal gradient, sky blues → terracotta, fixed
 *   Accent / headings: #C75900 (burnt orange)
 *   Links:            #C55A18
 *   Font:             Open Sans Condensed, Verdana fallback
 */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans+Condensed:wght@300&display=swap');

/* ── Reset & base ─────────────────────────────────────────────── */
* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Open Sans Condensed', Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #2a1a00;
    background-color: #9bd1fb;
    background-image: linear-gradient(45deg,
        rgba(155,209,251,1) 0%,
        rgba(180,218,247,1) 24%,
        rgba(215,233,247,1) 28%,
        rgba(155,209,251,1) 59%,
        rgba(189,223,249,1) 73%,
        rgba(193,116,77,1)  100%);
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Text selection */
::selection      { background: #AFD8F6; color: #000; }
::-moz-selection { background: #AFD8F6; color: #000; }

hr {
    border: none;
    border-top: 1px solid rgba(193,116,77,0.2);
    margin: 16px 0;
}

/* ── Links ────────────────────────────────────────────────────── */
a:link, a:visited { color: #C55A18; text-decoration: none; }
a:hover, a:active { color: #a04610; }

/* ── Typography ───────────────────────────────────────────────── */
h1 {
    font-size: 1.7em;
    font-weight: normal;
    font-variant: small-caps;
    color: #C75900;
    margin: 4px 0 18px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(193,116,77,0.35);
}

h2 {
    font-size: 1.25em;
    font-weight: normal;
    font-variant: small-caps;
    color: #C75900;
    margin: 20px 0 8px 0;
}

h3 {
    font-size: 1.05em;
    font-weight: bold;
    font-variant: small-caps;
    color: #8a3a00;
    margin: 14px 0 5px 0;
}

p  { margin: 0.4em 0 0.8em 0; }
em { color: #C75900; font-style: normal; }
ul, ol { margin: 0.5em 0 1em 1.4em; }
ul li  { margin-bottom: 4px; }

code {
    font-family: monospace;
    background: rgba(255,255,255,0.55);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.88em;
}

blockquote {
    background: rgba(255,255,255,0.4);
    border-left: 4px solid #DC945A;
    padding: 10px 16px;
    margin: 10px 0;
    border-radius: 0 4px 4px 0;
    font-size: 0.93em;
}

.small { font-size: 0.82em; color: #666; }

/* ── Top bar ──────────────────────────────────────────────────── */
.top-bar {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.32);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 0 24px;
    height: 48px;
}

.top-bar .site-name {
    flex: 1;
    font-family: 'Open Sans Condensed', Verdana, sans-serif;
    font-size: 1.45em;
    font-variant: small-caps;
    color: #fff;
    text-decoration: none;
    letter-spacing: 1px;
}

.top-bar .admin-badge {
    font-size: 0.6em;
    opacity: 0.7;
    font-variant: small-caps;
    vertical-align: middle;
}

.top-bar a.nav-link {
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    padding: 0 14px;
    line-height: 48px;
    font-size: 0.88em;
    font-variant: small-caps;
    border-left: 1px solid rgba(255,255,255,0.12);
    transition: background 0.15s, color 0.15s;
}

.top-bar a.nav-link:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* ── Page layout ──────────────────────────────────────────────── */
#container {
    display: flex;
    align-items: flex-start;
    width: 94%;
    max-width: 1280px;
    margin: 0 auto;
    padding-bottom: 40px;
    min-height: calc(100vh - 48px);
}

/* ── Sidebar ──────────────────────────────────────────────────── */
#sidebar {
    width: 210px;
    flex-shrink: 0;
    padding: 20px 0;
}

.nav-group {
    margin-bottom: 14px;
}

.nav-label {
    display: block;
    font-variant: small-caps;
    font-size: 0.72em;
    font-weight: bold;
    color: #C75900;
    letter-spacing: 1px;
    padding: 8px 14px 3px;
    text-transform: uppercase;
}

#sidebar a {
    display: block;
    font-variant: small-caps;
    font-size: 0.9em;
    color: rgba(0,0,0,0.6);
    text-decoration: none;
    padding: 6px 12px 6px 16px;
    border-left: 3px solid transparent;
    border-bottom: 1px solid rgba(193,116,77,0.12);
    transition: color 0.1s, border-color 0.1s, background 0.1s;
}

#sidebar a:last-child { border-bottom: none; }

#sidebar a:hover,
#sidebar a.active {
    color: #C75900;
    border-left-color: #C75900;
    background: rgba(255,255,255,0.35);
}


.nav-disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}
.nav-soon {
    font-size: 0.8em;
    font-style: italic;
    font-weight: normal;
}

.nav-badge {
    display: inline-block;
    background: #c06000;
    color: #fff;
    border-radius: 10px;
    font-size: 0.72em;
    font-variant: normal;
    font-weight: bold;
    padding: 1px 6px;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1.5;
}

/* ── Content area ─────────────────────────────────────────────── */
#content {
    flex: 1;
    padding: 24px 32px;
    min-width: 0;
}

/* ── Admin footer ─────────────────────────────────────────────── */
#admin-footer {
    border-top: 1px solid rgba(193,116,77,0.3);
    padding: 14px 32px;
    font-size: 0.78em;
    color: rgba(0,0,0,0.45);
    text-align: right;
    clear: both;
}

#admin-footer a { color: rgba(0,0,0,0.45); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 860px) {
    #container { flex-direction: column; width: 96%; }
    #sidebar {
        width: 100%;
        padding: 10px 0 4px;
        display: flex;
        flex-wrap: wrap;
        gap: 4px 0;
        align-items: flex-start;
    }
    .nav-group { margin-bottom: 4px; display: flex; flex-wrap: wrap; align-items: center; }
    .nav-label { padding: 4px 8px; }
    #sidebar a {
        display: inline-block;
        border: 1px solid rgba(193,116,77,0.3);
        border-left: 3px solid transparent;
        border-radius: 3px;
        margin: 2px;
        padding: 4px 10px;
    }
#content { padding: 14px 8px; }
}

/* ── Forms ────────────────────────────────────────────────────── */
input, textarea, select {
    font-family: Verdana, sans-serif;
    font-size: 1em;
    padding: 5px 8px;
    color: #C75900;
    border: 1px solid #DC945A;
    border-radius: 3px;
    background: #fff;
    width: 100%;
    max-width: 500px;
}

input:focus,
textarea:focus,
select:focus {
    background: #D8E9F6;
    border-color: #2e7ce1;
    outline: none;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    max-width: none;
}

input[type="submit"],
input[type="button"],
button {
    width: auto;
    max-width: none;
    cursor: pointer;
}

option {
    color: #C75900;
    padding: 3px;
}

option:hover,
option:focus,
option:checked,
option[selected] {
    background: #D8E9F6;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 4px;
    color: #333;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label { margin-bottom: 4px; }

.form-hint {
    font-size: 0.82em;
    color: #888;
    margin-top: 3px;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 7px 18px;
    font-family: Verdana, sans-serif;
    font-size: 0.9em;
    font-variant: small-caps;
    border: 1px solid #DC945A;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    background: #fff;
    color: #C75900;
}

.btn:hover {
    background: #AFD8F6;
    color: #C75900;
    border-color: #2e7ce1;
}

.btn-primary {
    background: #C75900;
    color: #fff;
    border-color: #C75900;
}

/* a:link has specificity (0,0,1,1) which beats .btn-primary (0,0,1,0).
   These rules match at the same level and restore white text on anchor buttons. */
a.btn-primary,
a.btn-primary:link,
a.btn-primary:visited {
    color: #fff;
}

.btn-primary:hover,
a.btn-primary:hover {
    background: #a84b00;
    color: #fff;
    border-color: #a84b00;
}

.btn-secondary {
    background: #f0f0f0;
    color: #555;
    border-color: #ccc;
}

.btn-secondary:hover {
    background: #AFD8F6;
    color: #000;
    border-color: #2e7ce1;
}

.btn-danger {
    background: #fff;
    color: #a00;
    border-color: #c00;
}

.btn-danger:hover {
    background: #fee;
    color: #700;
    border-color: #700;
}

.btn-sm {
    padding: 3px 10px;
    font-size: 0.8em;
}

.btn-success {
    background: #fff;
    color: #155724;
    border-color: #28a745;
}

.btn-success:hover {
    background: #d4edda;
    color: #0b3d1f;
    border-color: #1e7e34;
}

/* ── Data tables ──────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.data-table th {
    background: rgba(199,89,0,0.08);
    color: #C75900;
    font-variant: small-caps;
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(199,89,0,0.25);
}

.data-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f0e0d0;
    vertical-align: middle;
}

.data-table tr:hover td { background: #f9f3ef; }

.data-table .actions { white-space: nowrap; }

/* ── Status badges ────────────────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-variant: small-caps;
    border: 1px solid transparent;
}

.status-badge.current  { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.status-badge.upcoming { background: #fff3cd; color: #856404; border-color: #ffeeba; }
.status-badge.pending  { background: #fde8d8; color: #C75900; border-color: #DC945A; }

/* ── Alerts ───────────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    font-size: 0.9em;
}

.alert-success  { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.alert-error    { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.alert-warning  { background: #fff3cd; color: #856404; border-color: #ffeeba; }
.alert-info     { background: #d1ecf9; color: #0c5460; border-color: #bee5eb; }

/* ── Donation / support notice (top banner) ───────────────────── */
.donation-notice {
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(199,89,0,0.18);
    border-radius: 6px;
    margin: 0 0 14px;
    padding: 7px 14px;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    color: #555;
}
.donation-notice .notice-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.donation-notice a:link,
.donation-notice a:visited { color: #C75900; text-decoration: none; }
.donation-notice a:hover { text-decoration: underline; }
.notice-dismiss-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 1px 8px;
    font-size: 0.9em;
    color: #888;
    cursor: pointer;
}
.notice-dismiss-btn:hover { border-color: #999; color: #555; }

/* ── Stale listing warning ────────────────────────────────────── */
.stale-warning td { background: #fff8f3 !important; }

.stale-indicator {
    display: inline-block;
    color: #C75900;
    font-size: 0.82em;
    margin-left: 6px;
    font-variant: small-caps;
}

/* ── Pagination ───────────────────────────────────────────────── */
.pagination {
    margin: 16px 0;
    text-align: center;
}

.page-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.pagination a:link,
.pagination a:visited,
.pagination .page-current {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid #DC945A;
    border-radius: 3px;
    font-size: 0.9em;
    color: #2e7ce1;
    background: #fff;
    text-decoration: none;
}

.pagination .page-current {
    background: #C75900;
    color: #fff;
    border-color: #C75900;
    cursor: default;
}

.pagination a:hover {
    background: #AFD8F6;
    color: #C75900;
    border-color: #2e7ce1;
}

/* ── Settings tabs ────────────────────────────────────────────── */
.tab-list {
    list-style: none;
    margin: 0 0 -1px;
    padding: 0;
    display: flex;
    gap: 4px;
    border-bottom: 1px solid rgba(199,89,0,0.3);
}

.tab-list li a:link,
.tab-list li a:visited {
    display: block;
    padding: 8px 16px;
    border: 1px solid #DC945A;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    font-size: 0.9em;
    font-variant: small-caps;
    color: #C75900;
    background: #f9f3ef;
    text-decoration: none;
}

.tab-list li a:hover,
.tab-list li a.active {
    background: #fff;
    color: #2e7ce1;
}

.tab-list li a.active {
    border-bottom-color: #fff;
    position: relative;
    bottom: -2px;
}

.tab-panel { display: none; padding: 20px 0; }
.tab-panel.active { display: block; }

/* ── Image / affiliate grid ───────────────────────────────────── */
.image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.image-grid img {
    border: 2px solid #DC945A;
    padding: 2px;
    background: #fff;
}

.image-grid img:hover { border-color: #2e7ce1; background: #AFD8F6; }

/* ── Utility ──────────────────────────────────────────────────── */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: #888; }
.text-accent  { color: #C75900; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }

.inline-form { display: contents; }
.hidden { display: none !important; }

/* Button rows — forms inside flex containers shouldn't break alignment */
.data-table td form,
.col-actions form {
    display: contents;
}

/* Mark-as-updated inline confirmation */
.updated-confirm {
    font-size: 0.82em;
    color: #155724;
    font-style: italic;
    margin-left: 8px;
}

/* ── Custom fields editor ─────────────────────────────────────── */
.custom-fields-list { margin-bottom: 10px; }

.custom-field-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.custom-field-row input { max-width: 250px; }

/* ── Install wizard (reused inside admin too) ─────────────────── */
.wizard-steps {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(199,89,0,0.3);
    padding-bottom: 0;
    flex-wrap: wrap;
}

.wizard-step {
    padding: 10px 20px;
    font-size: 0.85em;
    font-variant: small-caps;
    color: #888;
    border-bottom: 3px solid transparent;
    position: relative;
    bottom: -2px;
}

.wizard-step.done    { color: #2e7ce1; }
.wizard-step.current { color: #C75900; border-bottom-color: #C75900; font-weight: bold; }

/* ── Public credit link ───────────────────────────────────────── */
.fanatically-credit {
    font-size: 0.75em;
    text-align: center;
    margin-top: 12px;
    color: #888;
}

.fanatically-credit a:link,
.fanatically-credit a:visited { color: #2e7ce1; background: none; }
.fanatically-credit a:hover   { color: #C75900; background: #AFD8F6; }

/* ── Admin card (glass) ───────────────────────────────────────── */
.admin-card {
    background: rgba(255,255,255,0.52);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 10px;
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}

.admin-card h2:first-child { margin-top: 0; }

/* ── Stat grid + cards (glass) ────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(255,255,255,0.52);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

.stat-number {
    font-size: 2.2em;
    font-weight: bold;
    color: #C75900;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.78em;
    color: #555;
    font-variant: small-caps;
    letter-spacing: 0.5px;
}

/* ── Form layout ──────────────────────────────────────────────── */
.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-row .form-group { flex: 1; min-width: 180px; }

.field-hint {
    font-size: 0.82em;
    color: #888;
    margin-top: 3px;
    line-height: 1.4;
}

/* ── Tabs (URL-based, options page) ──────────────────────────── */
.tabs-nav {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid rgba(199,89,0,0.3);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-link,
a.tab-link:link,
a.tab-link:visited {
    display: inline-block;
    padding: 7px 16px;
    border: 1px solid rgba(199,89,0,0.3);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    font-size: 0.9em;
    font-variant: small-caps;
    color: #C75900;
    background: rgba(255,255,255,0.3);
    text-decoration: none;
    position: relative;
    bottom: -1px;
    transition: background 0.12s, color 0.12s;
}

.tab-link:hover {
    background: rgba(255,255,255,0.5);
    color: #a84b00;
}

.tab-link.active {
    background: rgba(255,255,255,0.7);
    color: #333;
    border-bottom-color: rgba(255,255,255,0.7);
    font-weight: bold;
}

/* ── Responsive misc ──────────────────────────────────────────── */
@media (max-width: 620px) {
    .data-table { font-size: 0.82em; }
    input, textarea, select { max-width: 100%; }
    .tab-list { flex-direction: column; }
    .tab-list li a:link,
    .tab-list li a:visited { border-radius: 0; border-bottom: 1px solid #DC945A; }
    .tab-list li a.active { bottom: 0; border-bottom-color: #DC945A; }
}
