@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700&family=Lora:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Merriweather:wght@300;400;700&display=swap');

:root{
    /* Byzantine palette */
    --byz-deep: #2b0236;    /* very deep purple */
    --byz-indigo: #3b0b5f;  /* indigo */
    --byz-rose: #8b1e3f;    /* deep rose */
    --byz-gold: #d4af37;    /* gold accent */
    --byz-teal: #2a7f7b;    /* supporting teal */
    --bg-cream: #fbf8f2;    /* soft background */
    --muted: #a9a0a7;
    --transition-fast: 180ms;
    /* Avatar palette (accessible, small set) */
    --avatar-p0: #6c5ce7;
    --avatar-p1: #00b894;
    --avatar-p2: #0984e3;
    --avatar-p3: #e17055;
    --avatar-p4: #fdcb6e;
    --avatar-p5: #a29bfe;
    --avatar-p6: #00cec9;
    --avatar-p7: #ff7675;

    /* row divider color */
    --row-divider: rgba(43,37,48,0.06);
    --row-hover: rgba(43,37,48,0.03);
}

html, body {
    /* Inter for UI text (clean, highly readable), Merriweather for headings */
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    background-color: var(--bg-cream);
    color: #2b2730;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 768px) {
    html, body {
        font-size: 16px;
    }
}

/* Headings use Merriweather for a classic, readable serif tone */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', Georgia, 'Times New Roman', serif;
    color: var(--byz-deep);
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
    letter-spacing: 0.2px;
    font-weight: 700;
}

h1 { font-size: 1.65rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

/* Brand styling for navigation */
.navbar-brand {
    font-family: 'Merriweather', Georgia, serif;
    letter-spacing: 0.6px;
    color: var(--byz-gold);
}

a, .btn-link {
    color: var(--byz-deep);
    transition: color var(--transition-fast) ease, text-decoration var(--transition-fast), opacity var(--transition-fast);
}

/* stronger hover/focus for links to ensure contrast */
a:hover, a:focus, .btn-link:hover, .btn-link:focus {
    color: var(--byz-rose);
    text-decoration: underline;
    opacity: 0.95;
}

.btn-primary {
    color: var(--byz-gold);
    background-color: var(--byz-deep);
    border-color: rgba(212,175,55,0.12);
    transition: transform var(--transition-fast) ease, box-shadow var(--transition-fast);
    box-shadow: 0 2px 10px rgba(43,2,54,0.12);
    padding: 0.35rem 0.85rem;
    font-size: 0.9rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(43,2,54,0.18);
    color: var(--byz-gold);
    /* explicitly keep Byzantine background and border on hover (override bootstrap default blues) */
    background-color: var(--byz-indigo) !important;
    border-color: rgba(59,11,95,0.28) !important;
}

.btn-primary:active,
.btn-primary.active {
    background-color: var(--byz-indigo) !important;
    border-color: rgba(43,2,54,0.22) !important;
    transform: translateY(0) !important;
}

/* prevent generic buttons from taking default blue on hover */
.btn:hover {
    opacity: 0.96;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.12rem rgba(212,175,55,0.25), 0 0 0 0.25rem rgba(59,11,95,0.06);
  outline: none;
}

.content {
    padding-top: 0.75rem;
}

/* Slim form controls globally */
.form-control,
.form-select {
    padding: 0.35rem 0.65rem;
    font-size: 0.9rem;
}

.form-control-sm,
.form-select-sm {
    padding: 0.25rem 0.55rem;
    font-size: 0.85rem;
}

.form-label {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.input-group-text {
    padding: 0.35rem 0.65rem;
    font-size: 0.9rem;
}

/* Slim buttons globally */
.btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.9rem;
}

.btn-sm {
    padding: 0.25rem 0.55rem;
    font-size: 0.82rem;
}

/* Slim badges - center content both vertically and horizontally */
.badge {
    display: inline-flex;
    align-items: center; /* vertical centering */
    justify-content: center; /* horizontal centering */
    padding: 0.22em 0.55em;
    font-size: 0.8rem;
    line-height: 1; /* ensure consistent centering across browsers */
    vertical-align: middle; /* aligns with surrounding text */
    border-radius: 0.5rem; /* slightly rounded pills */
}

/* Slim cards */
.card-body {
    padding: 0.85rem;
}

.card-header {
    padding: 0.55rem 0.85rem;
}

.card-footer {
    padding: 0.55rem 0.85rem;
}

/* Slim tables */
.table th,
.table td {
    padding: 0.4rem 0.55rem;
    font-size: 0.9rem;
}

.table-sm th,
.table-sm td {
    padding: 0.3rem 0.45rem;
    font-size: 0.85rem;
}

/* Slim alerts */
.alert {
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
}

/* Ensure dismiss button in alerts is aligned to the right and vertically centered */
.alert .btn-close {
    margin-left: auto;
    align-self: center;
}

/* Ensure all dismissible alerts are laid out with flex so the close button stays right-aligned */
.alert.alert-dismissible {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.75rem;
}

.alert.alert-dismissible .btn-close {
    margin-left: 0 !important;
    position: relative !important;
}

/* Slim modals */
.modal-body {
    padding: 0.75rem;
}

.modal-header,
.modal-footer {
    padding: 0.5rem 0.75rem;
}

/* Slim pagination */
.page-link {
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
}

/* Slim definition lists used in detail panels */
dl.row dt,
dl.row dd {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Container padding adjustments for mobile */
.container-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

@media (min-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Avatar helpers */
.avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.7rem;
}
.avatar--p0 { background: var(--avatar-p0); }
.avatar--p1 { background: var(--avatar-p1); }
.avatar--p2 { background: var(--avatar-p2); }
.avatar--p3 { background: var(--avatar-p3); }
.avatar--p4 { background: var(--avatar-p4); }
.avatar--p5 { background: var(--avatar-p5); }
.avatar--p6 { background: var(--avatar-p6); }
.avatar--p7 { background: var(--avatar-p7); }

/* Subtle alternating row dividers and hover */
.table tbody tr {
    border-bottom: 1px solid var(--row-divider);
    transition: background-color var(--transition-fast) ease;
}
.table tbody tr:nth-child(odd) {
    background-color: transparent;
}
.table tbody tr:nth-child(even) {
    background-color: rgba(43,37,48,0.01);
}
.table tbody tr:hover {
    background-color: var(--row-hover);
}

/* Clickable table rows */
table.table-hover tbody tr[role="button"] {
    cursor: pointer;
}

/* Active row highlight (selected row) */
table .table-active {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--byz-teal);
}

.invalid {
    outline: 1px solid var(--byz-rose);
}

.validation-message {
    color: var(--byz-rose);
}

.blazor-error-boundary {
    background: linear-gradient(90deg, rgba(139,30,63,0.98), rgba(43,2,54,0.95));
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-left: 4px solid var(--byz-gold);
    box-shadow: 0 4px 18px rgba(43,2,54,0.28);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* small utility for subtle fades */
.fade-in { animation: fadeIn var(--transition-fast) ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: none; } }
