/* =========================================
   app theme overrides (bootstrap 5, dark)
   goals:
   - reduce duplication
   - fix a few logic issues (focus/z-index, selectors)
   - keep bootstrap behavior predictable
   - match your ui patterns (soft borders, subtle hovers)
   ========================================= */

:root {
    --app-primary: #c23939;
    --app-primary-active: #ac3232;
    --app-focus: 0 0 0 0.25rem rgba(194,57,57,.25);

    /* brand */
    --bs-primary: #c23939;
    --bs-primary-rgb: 194, 57, 57;

    /* links */
    --bs-link-color-rgb: 194, 57, 57;
    --bs-link-hover-color-rgb: 212, 66, 66;

    /* app tokens */
    --app-radius: 6px;
    --app-radius-sm: 4px;
    --app-transition: 0.2s ease-in-out;

    --app-glow: 0 0 15px rgba(194, 57, 57, 0.30);
    --app-primary-soft: rgba(194, 57, 57, 0.10);
    --app-primary-soft-hover: rgba(194, 57, 57, 0.15);

    /* common border */
    --app-border: rgba(255, 255, 255, 0.10);
}

/* =========================================
   buttons
   ========================================= */

.btn {
    border-radius: var(--app-radius);
    font-weight: 600;
    transition:
            transform var(--app-transition),
            box-shadow var(--app-transition),
            background-color var(--app-transition),
            border-color var(--app-transition),
            color var(--app-transition);
}

/* micro-lift (only on devices that actually hover) */
@media (hover: hover) and (pointer: fine) {
    .btn:hover { transform: translateY(-1px); }
    .btn:active { transform: translateY(0); }
}

.btn-primary {
    --bs-btn-bg: #c23939;
    --bs-btn-border-color: #c23939;
    --bs-btn-color: #fff;

    --bs-btn-hover-bg: #d44242;
    --bs-btn-hover-border-color: #d44242;
    --bs-btn-hover-color: #fff;

    --bs-btn-active-bg: #ac3232;
    --bs-btn-active-border-color: #ac3232;
    --bs-btn-active-color: #fff;

    --bs-btn-disabled-bg: #c23939;
    --bs-btn-disabled-border-color: #c23939;
    --bs-btn-disabled-color: #fff;

    --bs-btn-focus-shadow-rgb: 194, 57, 57;
}

@media (hover: hover) and (pointer: fine) {
    .btn-primary:hover { box-shadow: var(--app-glow); }
}

.btn-primary:focus,
.btn-primary:focus-visible,
.btn-primary:active,
.btn-primary:focus:active {
    background-color: #ac3232 !important;
    border-color: #ac3232 !important;
    box-shadow: var(--app-focus) !important;
}

.btn-outline-primary {
    --bs-btn-color: #c23939;
    --bs-btn-border-color: #c23939;
    --bs-btn-bg: transparent;

    --bs-btn-hover-bg: #c23939;
    --bs-btn-hover-border-color: #c23939;
    --bs-btn-hover-color: #fff;

    --bs-btn-active-bg: #ac3232;
    --bs-btn-active-border-color: #ac3232;
    --bs-btn-active-color: #fff;

    --bs-btn-disabled-color: #c23939;
    --bs-btn-disabled-border-color: #c23939;
    --bs-btn-disabled-bg: transparent;

    --bs-btn-focus-shadow-rgb: 194, 57, 57;
}

.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary:focus:active,
.btn-outline-primary.active {
    background-color: var(--app-primary) !important;
    border-color: var(--app-primary) !important;
    color: #fff !important;
    box-shadow: var(--app-focus) !important;
}

@media (hover: hover) and (pointer: fine) {
    .btn-outline-primary:hover { box-shadow: var(--app-glow); }
}

/* fix: your selector used "--bs-btn-focus-shadow-rgb" which is not defined on :hover in many cases.
   use bootstrap's "--bs-btn-focus-shadow-rgb" *if present*, otherwise fall back to primary. */
@media (hover: hover) and (pointer: fine) {
    [class^="btn-outline-"]:hover,
    [class*=" btn-outline-"]:hover {
        box-shadow: 0 0 15px rgba(var(--bs-btn-focus-shadow-rgb, 194, 57, 57), 0.30);
    }
}

/* keep bootstrap focus colors intact for non-primary buttons */
.btn-secondary { --bs-btn-focus-shadow-rgb: var(--bs-secondary-rgb); }
.btn-danger    { --bs-btn-focus-shadow-rgb: var(--bs-danger-rgb); }
.btn-warning   { --bs-btn-focus-shadow-rgb: var(--bs-warning-rgb); }
.btn-info      { --bs-btn-focus-shadow-rgb: var(--bs-info-rgb); }
.btn-dark      { --bs-btn-focus-shadow-rgb: var(--bs-dark-rgb); }
.btn-light     { --bs-btn-focus-shadow-rgb: var(--bs-gray-500-rgb); }

/* =========================================
   forms
   ========================================= */

/* keep your "no glow" focus, but don't kill accessibility:
   show the browser outline only when it is keyboard focus-visible */
.form-control:focus,
.form-select:focus {
    outline: none;
    box-shadow: none;
    border-color: var(--bs-border-color);
}

.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid rgba(194, 57, 57, 0.35);
    outline-offset: 2px;
}

/* fix: only raise z-index for the stacked one-page inputs */
.form-one-page .form-control:focus,
.form-one-page .form-select:focus {
    position: relative;
    z-index: 2;
}

/* one-page form helper */
.form-one-page {
    max-width: 330px;
    padding: 1rem;
}
.form-one-page .form-floating:focus-within { z-index: 2; }
.form-one-page .remove-border-top {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}
.form-one-page .remove-border-bottom {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: -1px;
}
.form-one-page .remove-border-bottom.remove-border-top { border-radius: 0; }

/* =========================================
   header / nav
   ========================================= */

header {
    position: relative;
    z-index: 1030;
}

.nav-link {
    color: #adadad;
    transition: color var(--app-transition), background-color var(--app-transition);
}

.nav-link i { font-size: 0.95rem; }

.nav-link:hover,
.nav-link:focus {
    color: #d44242 !important;
}

.nav-link.active {
    color: #c23939 !important;
    font-weight: 600;
}

.nav-link i { transition: color var(--app-transition); }
.nav-link:hover i { color: #d44242; }

.dropdown-toggle.active::after { color: #c23939; }

/* =========================================
   dropdowns
   ========================================= */

/* subtle, consistent dropdown surfaces */
.dropdown-menu {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* unify item behavior */
.dropdown-item {
    transition: background-color var(--app-transition), color var(--app-transition);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--app-primary-soft-hover) !important;
    color: #d44242 !important;
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--app-primary-soft) !important;
    color: #c23939 !important;
    font-weight: 600;
}

/* =========================================
   list groups
   ========================================= */

/* note: bootstrap uses different backgrounds per theme; keep your soft primary highlight */
.list-group-item.active {
    background-color: var(--app-primary-soft) !important;
    color: #c23939 !important;
    border-color: rgba(194, 57, 57, 0.20) !important;
    font-weight: 600;
    z-index: 2;
}

.list-group-item-action {
    transition: background-color var(--app-transition), color var(--app-transition);
}

.list-group-item-action:hover,
.list-group-item-action:focus {
    background-color: rgba(194, 57, 57, 0.05) !important;
    color: #d44242 !important;
}

/* =========================================
   badges / roles
   ========================================= */

.badge-role {
    font-weight: 700;
    padding: 0.5rem 0.8rem !important;
    border: 1px solid transparent;
    letter-spacing: 0.03rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    border-radius: var(--app-radius);

    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.badge-role-sm {
    display: inline-flex !important;
    width: auto !important;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.6rem !important;
    font-size: 0.65rem;
    border-radius: var(--app-radius-sm);
    align-self: center;
}

.badge-role-sm i {
    font-size: 0.7rem;
    margin-right: 0.3rem !important;
}

.role-1 {
    background-color: rgba(255, 174, 0, 0.10) !important;
    color: #ffae00 !important;
    border-color: rgba(255, 174, 0, 0.30) !important;
}
.role-2 {
    background-color: rgba(145, 71, 255, 0.10) !important;
    color: #9147ff !important;
    border-color: rgba(145, 71, 255, 0.30) !important;
}
.role-3 {
    background-color: rgba(255, 70, 85, 0.10) !important;
    color: #ff4655 !important;
    border-color: rgba(255, 70, 85, 0.30) !important;
}
.role-4 {
    background-color: rgba(245, 54, 92, 0.10) !important;
    color: #f5365c !important;
    border-color: rgba(245, 54, 92, 0.30) !important;
}
.role-5 {
    background-color: rgba(232, 62, 140, 0.10) !important;
    color: #e83e8c !important;
    border-color: rgba(232, 62, 140, 0.30) !important;
}
.role-6 {
    background-color: rgba(0, 123, 255, 0.10) !important;
    color: #007bff !important;
    border-color: rgba(0, 123, 255, 0.30) !important;
}

/* =========================================
   utilities
   ========================================= */

.uppercase { text-transform: uppercase; }

/* handy: consistent subtle dashed border you use in empty states */
.border-dashed {
    border-style: dashed !important;
}

/* handy: consistent transparent table cells without repeating inline styles */
.table-transparent > :not(caption) > * > * {
    background-color: transparent !important;
    box-shadow: none !important;
}

#home-slider .carousel-control-prev-icon,
#home-slider .carousel-control-next-icon,
#home-slider .carousel-indicators {
    filter: invert(1);
}

.page-item.active .page-link{
    background-color: rgba(194,57,57,.12) !important;
    border-color: rgba(194,57,57,.25) !important;
    color: #c23939 !important;
    font-weight: 700;
}
.page-link{
    color: #adadad;
}
.page-link:hover{
    color: #d44242;
    background-color: rgba(194,57,57,.08);
}