/* ===== Alliance / Kingdom Code Theme (main.css) =====
   Palette:
   --bg:           #E9EDF2   (light gray page background)
   --surface:      #FFFFFF   (base surfaces)
   --card:         #FFFFFF   (cards / panels)
   --text:         #111827   (main text – almost black)
   --muted:        #6B7280   (muted text)
   --primary:      #2563EB   (primary blue)
   --primary-700:  #1D4ED8   (darker blue)
   --accent:       #2563EB   (accent now matches primary – NO GOLD)
   --line:         #D0D7E2   (subtle borders)
   --ring:         rgba(15,23,42,0.08)

   Header:
   --header-bg:        #3F5D7D (soft navy / slate blue)
   --header-bg-bottom: #364B66 (slightly deeper at the bottom)
   --header-text:      #F9FAFB
*/

/* Theme tokens */
:root {
    --bg: #E9EDF2;
    --surface: #FFFFFF;
    --card: #FFFFFF;
    --text: #111827;
    --muted: #6B7280;
    --primary: #2563EB;
    --primary-700: #1D4ED8;
    --accent: #2563EB;              /* was gold; now blue */
    --line: #D0D7E2;
    --ring: rgba(15, 23, 42, 0.08);

    --header-bg: #3F5D7D;
    --header-bg-bottom: #364B66;
    --header-text: #F9FAFB;
}

/* Base type & layout */
html,
body,
input,
textarea,
select,
button {
    font-size: 16.5px;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

html,
body {
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-y: scroll;
}

/* Page chrome */
/*header,*/
/*nav,*/
/*main,*/
/*footer {*/
/*    padding: 2px calc((100% - 1000px) / 2) 0;*/
/*}*/

@media (min-width: 992px) {
    header, nav, main, footer {
        padding-left: calc((100% - 1000px)/2);
        padding-right: calc((100% - 1000px)/2);
    }
}

@media (max-width: 991px) {
    header, nav, main, footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Main content */
main {
    margin-top: 48px;
    margin-bottom: 48px;
    min-height: calc(100vh - 320px);
    overflow: auto;
    padding-left: 50px !important;
    padding-right: 50px !important;
}

/* ===== HEADER (LOGO AREA) ===== */

header {
    padding-top: 24px;
    padding-bottom: 18px;
    background: linear-gradient(to bottom, var(--header-bg), var(--header-bg-bottom));
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    text-align: center;
    color: var(--header-text);
}

@media (max-width: 600px) {
    #wheel-svg {
        max-height: 260px;
    }
}

/* Logo title */
h1 a {
    display: inline-block;
    font-size: 32px;
    font-weight: 700;
    background-image: url("/static/img/logo.png");
    background-repeat: no-repeat;
    background-position: left center;
    background-size: auto 200px;
    height: 200px;
    line-height: 200px;
    padding-left: 210px;
    text-decoration: none;
    color: var(--accent);
    letter-spacing: 0.03em;
}

h1 a:hover {
    color: #ffffff;
    text-decoration: none;
}

/* Make all headings dark (no gold) */
h1, h2, h3, h4, h5, h6 {
    color: var(--text);
}

/* ===== NAVIGATION BAR ===== */

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    height: 56px;
    background: var(--surface);
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

nav a {
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
    transition: color 0.15s ease-in-out;
}

nav a:hover {
    color: var(--primary-700);
}

nav a.live {
    color: var(--primary-700);
    cursor: default;
}

nav a.live::after {
    content: "";
    display: block;
    position: relative;
    left: calc(50% - 10px);
    top: 6px;
    width: 20px;
    height: 3px;
    background: var(--primary);
    border-radius: 999px;
}

/* ===== LINKS ===== */

a,
a:link,
a:visited {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-700);
    text-decoration: underline;
}

/* Make any Bootstrap "light link" dark/blue on light background */
a.link-light,
.link-light {
    color: var(--primary) !important;
}
a.link-light:hover,
.link-light:hover {
    color: var(--primary-700) !important;
}

/* ===== BUTTONS ===== */

button {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    cursor: pointer;
}

button:hover {
    color: var(--primary-700);
    text-decoration: underline;
}

.btn-primary,
a.button,
input[type="submit"] {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: #f9fafb;
    border-radius: 0.6rem;
    padding: 0.65rem 1.2rem;
    font-weight: 700;
    box-shadow: 0 1px 0 var(--ring), 0 1px 3px var(--ring);
    display: inline-block;
}

.btn-primary:hover,
a.button:hover,
input[type="submit"]:hover {
    background: var(--primary-700);
    border-color: var(--primary-700);
    color: #ffffff;
    text-decoration: none;
}

.btn-outline-light {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 0.6rem;
    padding: 0.6rem 1.1rem;
}

.btn-outline-light:hover {
    border-color: var(--primary);
    color: var(--primary-700);
}

/* ===== FORMS ===== */

form div {
    margin-bottom: 14px;
}

form label,
.form-label {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--muted);
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="time"],
input[type="date"],
input[type="number"],
textarea,
select {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 0.6rem;
    padding: 0.6rem 0.8rem;
    outline: none;
    box-shadow: 0 1px 0 var(--ring) inset;
}

textarea {
    min-height: 180px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

/* Validation */
.error {
    color: #b42318;
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}

.error + textarea,
.error + input {
    border-color: #b42318 !important;
    border-width: 2px !important;
}

/* ===== CARDS ===== */

.card {
    background: var(--card) !important;
    color: var(--text) !important;
    border: 1px solid var(--line) !important;
    border-radius: 1rem !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12) !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease !important;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18) !important;
    border-color: var(--primary) !important;
}

.card-title {
    color: var(--text) !important;
    font-weight: 700;
}

.card-text {
    color: #4b5563 !important;
}

.custom-card-text {
    color: #475569 !important;
    font-size: 16px;
    line-height: 1.55;
}

/* ===== HEADINGS (section titles) ===== */

h2 {
    color: var(--text);
    font-size: 22px;
    margin-bottom: 20px;
}

/* ===== FLASH MESSAGES ===== */

div.flash {
    color: #07211a;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    padding: 0.75rem 1rem;
    border-radius: 0.6rem;
    text-align: center;
    font-weight: 700;
    margin-bottom: 24px;
}

div.error {
    color: #ffffff;
    background: #b42318;
    border: 1px solid #a61b12;
    padding: 0.75rem 1rem;
    border-radius: 0.6rem;
    text-align: center;
    font-weight: 700;
    margin-bottom: 24px;
}

/* ===== TABLES ===== */

table {
    background: var(--surface);
    border: 1px solid var(--line);
    border-collapse: collapse;
    width: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
}

td,
th {
    text-align: left;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
}

tr {
    border-bottom: 1px solid var(--line);
}

tr:nth-child(2n) {
    background: #f5f7fb;
}

th {
    color: #111827;
    font-weight: 700;
    background: #eef1f7;
}

th:last-child,
td:last-child {
    text-align: right;
    color: var(--muted);
}

/* Override when template uses Bootstrap .table-dark */
.table-dark {
    background: var(--surface) !important;
    color: var(--text) !important;
}

.table-dark thead th {
    background: #eef1f7 !important;
    color: #111827 !important;
}

.table-dark.table-striped tbody tr:nth-of-type(odd) {
    background: #f5f7fb !important;
}

/* ===== FOOTER ===== */

footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
}

/* ===== DATATABLES ALIGNMENT HELPERS ===== */

.dataTables_wrapper,
.dataTables_scroll {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    width: auto !important;
    overflow-x: visible !important;
    text-align: left !important;
}

#warehouseTable {
    margin-left: 0 !important;
    margin-right: auto !important;
    width: auto !important;
    display: table !important;
}

/* ===== ACCENT UTILITIES ===== */

/* Anything that used to be "gold-text" is now just normal dark text
   (so your big titles like "Father Daughter" won’t be orange). */
.gold-text {
    color: var(--text) !important;
}

/* You can also use this if you ever want blue-tinted headers:
   .accent-text { color: var(--primary); } */

/* ===== ACCORDIONS (<details>) ===== */

.kk-accordion {
    border: 1px solid var(--line);
    border-radius: 0.6rem;
    padding: 0.5rem 0.75rem;
    background: #f1f4f9;
}

.kk-accordion > summary {
    cursor: pointer;
    list-style: none;
    color: var(--text);
    position: relative;
    font-weight: 600;
}

.kk-accordion > summary::-webkit-details-marker {
    display: none;
}

.kk-accordion > summary::after {
    content: "▸";
    position: absolute;
    right: 0;
    transition: transform 0.15s ease-in-out;
    color: var(--muted);
}

.kk-accordion[open] > summary::after {
    transform: rotate(90deg);
}

/* ===== BALANCE WHEEL CONTAINER ===== */

#wheel-container {
    background: #f4f5f7;
    border-radius: 1rem;
    border: 1px solid var(--line);
}


/* Range sliders for Balance Wheel */
input[type="range"] {
    accent-color: var(--primary);
}

output {
    color: var(--muted);
}
/* Balance Wheel score buttons */
.bw-score-btn {
    border-radius: 0.4rem;
    border: 1px solid #cbd5e1;        /* stronger border */
    background: #ffffff;
    color: #0f172a;                   /* dark text */
    min-width: 2rem;
    font-size: 0.8rem;
}

.bw-score-btn:hover {
    border-color: var(--primary);
    color: var(--primary-700);
}

.bw-score-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}


/* Balance Wheel panel */
.bw-panel {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 1rem;
    min-height: 420px;
}

#wheel-svg {
    background: transparent;
}
/* Balance Wheel score buttons */
.bw-score-btn {
    border-radius: 0.4rem;
    border: 1px solid #cbd5e1;        /* visible border */
    background: #ffffff;
    color: #0f172a;                   /* dark text */
    min-width: 2.1rem;
    min-height: 2.1rem;
    font-size: 0.8rem;
    padding: 0;
}

.bw-score-btn:hover {
    border-color: var(--primary);
    color: var(--primary-700);
    background: #eff6ff;
}

.bw-score-btn.active {
    background: var(--primary);       /* your existing blue accent */
    border-color: var(--primary);
    color: #ffffff;
}

.faithful-step-item {
    color: #212529 !important;                  /* dark text */
    background-color: transparent !important;   /* no override */
    border-color: rgba(0,0,0,0.15) !important;  /* subtle divider */
}

.faithful-step-item .text-muted {
    color: #6c757d !important;   /* normal muted gray */
}

.faithful-step-item .badge {
    color: #fff !important;
}

.bw-checklist input[type="checkbox"] {
    display: none !important;
}

.bw-checklist li {
    list-style-type: disc;
    margin-left: 1.2rem;
}



     /* History snapshot wheel label sizes */
 #history-wheel-svg text {
     font-size: 7px !important;   /* default / md+ */
 }

@media (max-width: 992px) {
    #history-wheel-svg text {
        font-size: 6px !important;
    }
}

@media (max-width: 576px) {
    #history-wheel-svg text {
        font-size: 5px !important;
    }
}

.btn-group.flex-wrap {
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .card {
        padding: 1rem !important;
    }
}


/* Reduce left/right padding on mobile */
@media (max-width: 576px) {
    .container,
    main .container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    /* OPTIONAL: if your card has extra padding */
    .card {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}
