/* ==== Фиолетовый бренд и переопределение Bootstrap переменных ==== */
:root {
    /* Брендовая палитра */
    --brand-primary: #3414BC;
    --brand-primary-600: #2E12A9; /* hover */
    --brand-primary-700: #260F93; /* active */
    --brand-primary-rgb: 52, 20, 188;

    /* Bootstrap 5: перекрашиваем primary и ссылки через CSS-переменные */
    --bs-primary: var(--brand-primary);
    --bs-primary-rgb: var(--brand-primary-rgb);
    --bs-link-color: var(--brand-primary);
    --bs-link-hover-color: var(--brand-primary-600);
    --bs-focus-ring-color: rgba(var(--brand-primary-rgb), .25);
}

/* ===============================
   Глобальные ссылки (вне хедера)
   =============================== */
a {
    color: var(--brand-primary);
    text-decoration: none;
}

a:hover, a:focus {
    color: #2E12A9;
}

a:active {
    color: #260F93;
}

/* Меню/дропдауны/ссылки-пункты вне хедера (или по умолчанию) */
.nav-link, .dropdown-item, .btn-link, .pp-link {
    color: var(--brand-primary);
}

.dropdown-item:hover, .dropdown-item:focus,
.pp-link:hover, .pp-link:focus {
    background: rgba(52, 20, 188, .10);
    color: var(--brand-primary);
}

.dropdown-item:active, .pp-link:active {
    background: rgba(52, 20, 188, .16);
    color: var(--brand-primary);
}

/* ===============================
   ХЕДЕР: серые по умолчанию, фиолетовые при hover
   (более специфично, чтобы перебить глобальные)
   =============================== */

/* Горизонтальное меню (desktop) */
.header .navbar-nav .nav-link {
    color: rgba(0, 0, 0, .55);
    text-decoration: none;
}

.header .navbar-nav .nav-link:hover,
.header .navbar-nav .nav-link:focus {
    color: var(--brand-primary);
    background: transparent;
    text-decoration: none;
}

/* Кнопка "Меню" (mobile) */
.header .btn-menu-link {
    color: rgba(0, 0, 0, .55);
    text-decoration: none;
}

.header .btn-menu-link:hover,
.header .btn-menu-link:focus {
    color: var(--brand-primary);
}

/* Dropdown пункты внутри хедера */
.header .dropdown-menu .dropdown-item {
    color: rgba(0, 0, 0, .85);
    background: transparent;
}

.header .dropdown-menu .dropdown-item:hover,
.header .dropdown-menu .dropdown-item:focus {
    color: var(--brand-primary);
    background: rgba(52, 20, 188, .10);
}

.header .dropdown-menu .dropdown-item:active,
.header .dropdown-menu .dropdown-item.active {
    color: var(--brand-primary);
    background: rgba(52, 20, 188, .16);
}

/* Ссылки в мини-профиле (popover) внутри хедера */
.header .pp-link {
    color: rgba(0, 0, 0, .85);
}

.header .pp-link:hover,
.header .pp-link:focus {
    color: var(--brand-primary);
    background: rgba(52, 20, 188, .10);
}

/* Кнопка-инициалы */
.header .header-initials-btn {
    color: #343A40;
    border-color: #102F8C;
    background: #E9ECEF;
}

.header .header-initials-btn:hover,
.header .header-initials-btn:focus {
    color: #fff;
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* ===== HEADER: серый по умолчанию, фиолетовый при hover (перебиваем всё) ===== */
.header a,
.header .nav-link,
.header .btn-menu-link,
.header .dropdown-item,
.header .pp-link {
    color: rgba(0, 0, 0, .55) !important;
    text-decoration: none !important;
}

.header a:hover, .header a:focus,
.header .nav-link:hover, .header .nav-link:focus,
.header .btn-menu-link:hover, .header .btn-menu-link:focus,
.header .pp-link:hover, .header .pp-link:focus {
    color: var(--brand-primary) !important;
    background: transparent !important;
    text-decoration: none !important;
}

/* dropdown внутри хедера — фиолетовый при hover + фон-акцент */
.header .dropdown-menu .dropdown-item {
    color: rgba(0, 0, 0, .85) !important;
    background: transparent !important;
}

.header .dropdown-menu .dropdown-item:hover,
.header .dropdown-menu .dropdown-item:focus {
    color: var(--brand-primary) !important;
    background: rgba(52, 20, 188, .10) !important;
}

.header .dropdown-menu .dropdown-item:active,
.header .dropdown-menu .dropdown-item.active {
    color: var(--brand-primary) !important;
    background: rgba(52, 20, 188, .16) !important;
}

/* .btn-primary */
.btn-primary {
    color: #fff !important;
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}

.btn-primary:hover {
    color: #fff !important;
    background-color: var(--brand-primary-600) !important;
    border-color: var(--brand-primary-600) !important;
}

.btn-primary:active,
.btn-primary.active,
.show > .btn-primary.dropdown-toggle {
    color: #fff !important;
    background-color: var(--brand-primary-700) !important;
    border-color: var(--brand-primary-700) !important;
}

.btn-primary:focus,
.btn-primary:active:focus,
.btn-primary:focus-visible {
    box-shadow: 0 0 0 .25rem rgba(var(--brand-primary-rgb), .25) !important;
    outline: none !important;
}

.btn-primary.disabled,
.btn-primary:disabled {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    opacity: .65;
}

/* .btn-outline-primary */
.btn-outline-primary {
    color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    background-color: transparent !important;
}

.btn-outline-primary:hover {
    color: #fff !important;
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}

.btn-outline-primary:active,
.btn-outline-primary.active,
.show > .btn-outline-primary.dropdown-toggle {
    color: #fff !important;
    background-color: var(--brand-primary-700) !important;
    border-color: var(--brand-primary-700) !important;
}

.btn-outline-primary:focus,
.btn-outline-primary:active:focus,
.btn-outline-primary:focus-visible {
    box-shadow: 0 0 0 .25rem rgba(var(--brand-primary-rgb), .25) !important;
    outline: none !important;
}

.btn-outline-primary.disabled,
.btn-outline-primary:disabled {
    color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    opacity: .65;
}

/* Дополнительно: утилиты, если где-то используешь bg/text/border-primary */
.bg-primary {
    background-color: var(--brand-primary) !important;
}

.text-primary {
    color: var(--brand-primary) !important;
}

.border-primary {
    border-color: var(--brand-primary) !important;
}

/* Поддержка .btn-check для toggle-кнопок */
.btn-check:checked + .btn-primary,
.btn-check:active + .btn-primary {
    color: #fff !important;
    background-color: var(--brand-primary-700) !important;
    border-color: var(--brand-primary-700) !important;
}

.btn-check:checked + .btn-outline-primary,
.btn-check:active + .btn-outline-primary {
    color: #fff !important;
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}


/* Header initials button: прибираем синий бордер по умолчанию */
.header .header-initials-btn {
    border-color: #6C757D; /* neutral gray */
}

/* Nav pills active */
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
    color: #fff !important;
    background-color: var(--brand-primary) !important;
}

/* Pagination */
.page-item.active .page-link {
    color: #fff !important;
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}
.page-link {
    color: var(--brand-primary) !important;
}
.page-link:hover {
    color: var(--brand-primary-600) !important;
}
.page-link:focus {
    box-shadow: 0 0 0 .25rem rgba(var(--brand-primary-rgb), .25) !important;
}

/* Form controls */
.form-check-input:checked {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}
.form-check-input:focus {
    box-shadow: 0 0 0 .25rem rgba(var(--brand-primary-rgb), .25) !important;
    border-color: var(--brand-primary) !important;
}

/* Badges, alerts (primary) */
.badge.bg-primary { background-color: var(--brand-primary) !important; }
.alert-primary { 
    color: #fff; 
    background-color: rgba(var(--brand-primary-rgb), .85) !important; 
    border-color: var(--brand-primary) !important; 
}

/** Legacy blue (#102F8C) → brand violet overrides for app-specific styles (loaded after main.css) **/
/* Layout/login left pane */
.logo-container { background-color: var(--brand-primary) !important; }
.container-flex-left { background-color: var(--brand-primary) !important; }

/* Generic buttons in forms */
.btn-sign-up,
.form-further,
.form-submit,
.form-log-submit {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: #fff !important;
}

/* Footer */
.footer { background-color: var(--brand-primary) !important; }

/* Emphasis links/text previously in blue */
.span-container-flex-right,
.authorization-span,
.political-of-confidentional-span,
.course-unwrap-span { color: var(--brand-primary) !important; }

/* Header nav underline */
.header-left-nav-item.active { border-bottom: 4px solid var(--brand-primary) !important; }

/* Header mini-button hover */
.header-right-naming-item:last-child:hover {
    background-color: var(--brand-primary) !important;
    color: #fff !important;
    border-color: var(--brand-primary) !important;
}

/* Progress bar */
.main-item-right-progressbar .progress-bar { background-color: var(--brand-primary) !important; }

/* Radios in simple slider */
.radio-form-container-item { border: 1px solid var(--brand-primary) !important; }
.radio-form-container-item:first-child { background-color: var(--brand-primary) !important; }

/* Chapters side nav */
.chapters-container-item.active { border-left: 4px solid var(--brand-primary) !important; }
.chapters-container-item.active > .chapters-container-item-text { color: var(--brand-primary) !important; }

/* Inputs focus ring to match brand */
.form-control:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 .25rem rgba(var(--brand-primary-rgb), .25) !important;
}

/* Video player controls */
input[type="range"] { color: var(--brand-primary) !important; }
#time-display { color: var(--brand-primary) !important; }

/* Custom radio states in quiz */
.form-item-answer-input:not(:disabled):active + .form-item-answer-label::before {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}
.form-item-answer-input:checked + .form-item-answer-label::before {
    border-color: var(--brand-primary) !important;
    background-color: var(--brand-primary) !important;
}

/* Checkbox/radio accent color */
.form-item-answer-checkbox:checked { accent-color: var(--brand-primary) !important; }

/* Knowledge form buttons */
.knowledge-form-submit {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}
.knowledge-form-submit:hover {
    background: #fff !important;
    color: var(--brand-primary) !important;
}
.knowledge-form-link {
    color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}
.knowledge-form-link:hover {
    background: var(--brand-primary) !important;
    color: #fff !important;
}

/* Calendar theme overrides originally using rgba(16, 47, 140, 1) */
[data-vc-theme=light] .vc-date[data-vc-date-selected] .vc-date__btn {
    background-color: var(--brand-primary) !important;
}
.date-calendar .vanilla-calendar-week__day,
.date-calendar .vanilla-calendar-day__btn,
.date-calendar .vanilla-calendar-header__content,
.date-calendar .vanilla-calendar-month,
.date-calendar .vanilla-calendar-year,
.date-calendar .vanilla-calendar-month:hover,
.date-calendar .vanilla-calendar-year:hover,
.date-calendar .vanilla-calendar-month.vanilla-calendar-month_disabled,
.date-calendar .vanilla-calendar-year.vanilla-calendar-year_disabled {
    color: var(--brand-primary) !important;
}
.date-calendar .vanilla-calendar-day__btn_selected,
.date-calendar .vanilla-calendar-day__btn_selected:hover,
.date-calendar .vanilla-calendar-months__month.vanilla-calendar-months__month_selected,
.date-calendar .vanilla-calendar-months__month.vanilla-calendar-months__month_selected:hover,
.date-calendar .vanilla-calendar-years__year.vanilla-calendar-years__year_selected,
.date-calendar .vanilla-calendar-years__year.vanilla-calendar-years__year_selected:hover {
    color: #fff !important;
    background-color: var(--brand-primary) !important;
}
.date-calendar .vanilla-calendar-day__btn_today,
.date-calendar .vanilla-calendar-day__btn_today:hover {
    color: #fff !important;
    background-color: var(--brand-primary) !important;
}
