/* FormEngine — S.C. Swiderski branding */
:root {
    --scs-black: #1a1a1a;
    --scs-gold: #cb9b2b;
    --scs-gold-light: #e8c964;
    --bs-primary: #cb9b2b;
    --bs-primary-rgb: 203, 155, 43;
    --app-navbar-height: 56px;
    --app-sticky-offset: calc(var(--app-navbar-height) + 0.75rem);
}

/* Override Bootstrap primary */
.btn-primary {
    background-color: var(--scs-gold);
    border-color: var(--scs-gold);
    color: #000;
}
.btn-primary:hover {
    background-color: var(--scs-gold-light);
    border-color: var(--scs-gold-light);
    color: #000;
}
.btn-outline-primary {
    color: var(--scs-gold);
    border-color: var(--scs-gold);
}
.btn-outline-primary:hover {
    background-color: var(--scs-gold);
    border-color: var(--scs-gold);
    color: #000;
}

/* Builder field cards */
.field-card {
    transition: box-shadow 0.15s ease;
}

.field-card-heading {
    border-color: #dbc79a;
    background-color: #f3eedf;
    border-left: 4px solid rgba(203, 155, 43, 0.65);
}

.field-card-heading .card-body {
    background-color: #f3eedf;
}

.field-card:hover {
    box-shadow: 0 0 0 2px var(--scs-gold) !important;
}
.field-card .drag-handle:hover {
    color: var(--scs-gold) !important;
}

.builder-context-menu {
    min-width: 260px;
    padding: 0.25rem 0;
}

.builder-context-menu .dropdown-item {
    white-space: nowrap;
}

.builder-context-group {
    position: relative;
}

.builder-context-group-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.builder-context-submenu {
    display: none;
    position: absolute;
    top: -0.25rem;
    left: calc(100% - 2px);
    margin: 0;
    min-width: 240px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 1090;
}

.builder-context-menu.submenu-left .builder-context-submenu {
    left: auto;
    right: calc(100% - 2px);
}

.builder-context-group:hover > .builder-context-submenu,
.builder-context-group:focus-within > .builder-context-submenu {
    display: block;
}

/* Sortable ghost */
.sortable-ghost {
    opacity: 0.4;
    border: 2px dashed var(--scs-gold);
}

/* Rich help text rendering */
.help-text-display p {
    margin-bottom: 0.25rem;
}

.help-text-display p:last-child {
    margin-bottom: 0;
}

.help-text-display ul,
.help-text-display ol {
    margin-bottom: 0.35rem;
    padding-left: 1.25rem;
}

.help-text-display table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
    font-size: 0.85em;
}

.help-text-display th,
.help-text-display td {
    border: 1px solid #dee2e6;
    padding: 0.25rem 0.5rem;
}

.help-text-display img {
    max-width: 100%;
    height: auto;
}

/* Top navigation */
.navbar-formengine {
    background-color: var(--scs-black);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-formengine .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.35);
}

.formengine-brand-icon {
    color: var(--scs-gold);
    font-size: 1.35rem;
}

.nav-task-badge {
    font-size: 0.7rem;
}

.avatar-initials {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--scs-gold);
    color: #111;
    font-weight: 700;
    font-size: 0.72rem;
}

/* Form builder sidebars */
@media (min-width: 992px) {
    .builder-title-sticky {
        position: sticky;
        top: var(--app-navbar-height);
        z-index: 1025;
        background-color: var(--bs-body-bg);
        margin-left: calc(var(--bs-gutter-x, 1rem) * -0.5);
        margin-right: calc(var(--bs-gutter-x, 1rem) * -0.5);
        border-bottom: 1px solid var(--bs-border-color-translucent);
        padding: 0.25rem calc(var(--bs-gutter-x, 1rem) * 0.5) 0.65rem;
        box-shadow: 0 6px 10px -10px rgba(0, 0, 0, 0.45);
    }

    .builder-sidebar-sticky {
        position: sticky;
        top: var(--app-sticky-offset);
        align-self: flex-start;
        max-height: calc(100vh - var(--app-sticky-offset) - 0.5rem);
        overflow-y: auto;
        padding-right: 0.25rem;
    }
}

/* Admin shell */
.admin-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 1rem;
}

.admin-sidebar {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.75rem;
    height: fit-content;
    position: sticky;
    top: var(--app-sticky-offset);
}

.admin-sidebar .nav-link {
    color: #495057;
    border-radius: 0.375rem;
}

.admin-sidebar .nav-link.active {
    background: rgba(203, 155, 43, 0.2);
    color: #000;
    font-weight: 600;
}

.admin-branding-logo-preview {
    max-height: 96px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
}

.form-render-logo {
    max-height: 72px;
    max-width: 220px;
    width: auto;
    object-fit: contain;
}

@media (max-width: 991.98px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
    }

    .form-render-logo {
        max-height: 56px;
        max-width: 160px;
    }
}

.likert-table th[scope="row"] {
    vertical-align: middle;
    background-color: transparent;
}

.likert-table thead th {
    border-bottom: 2px solid var(--bs-border-color);
}

.likert-table tbody tr:nth-of-type(odd) {
    background-color: var(--bs-light);
}

.likert-radio {
    width: 1.1rem;
    height: 1.1rem;
}

