/* components.css — переиспользуемые UI-компоненты (инфраструктура уровня main.css) */

/* === DROPDOWN === */

.dropdown {
  position: relative;
}

/* Fallback для .dropdown-menu без data-component (catmenu вложенные, extendSelect) */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  float: left;
  min-width: 10rem;
  padding: 0.8rem 0;
  margin: 0 0 0;
  font-size: 1rem;
  color: #96afc0;
  text-align: left;
  list-style: none;
  background-color: hsla(240, 7%, 12%, 0.95);
  background-clip: padding-box;
  border-bottom-left-radius: 0.45rem;
  border-bottom-right-radius: 0.45rem;
}

/* Для lib.js — добавляет .show к вложенным catmenu и extendSelect */
.dropdown-menu.show {
  display: block;
}

[data-component="dropdown-menu"] {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  display: none;
  float: left;
  min-width: 10rem;
  padding: 0.8rem 0;
  margin: 0 0 0;
  font-size: 1rem;
  color: #96afc0;
  text-align: left;
  list-style: none;
  background-color: hsla(240, 7%, 12%, 0.95);
  background-clip: padding-box;
  border-bottom-left-radius: 0.45rem;
  border-bottom-right-radius: 0.45rem;
}

[data-component="dropdown-menu"].is-open {
  display: block;
}

[data-component="dropdown-menu"].is-right {
  right: 0;
  left: auto;
}

.dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.255em;
  vertical-align: 0.255em;
  content: "";
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-bottom: 0;
  border-left: 0.3em solid transparent;
}

/* === COLLAPSE === */

[data-component="collapse"] {
  display: none;
}

[data-component="collapse"].is-open {
  display: block;
}

/* === MODAL === */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  width: 100%;
  height: 100%;
  overflow: hidden;
  outline: 0;
}

.modal.show {
  display: block;
}

body.modal-open {
  overflow: hidden;
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: 0.5rem;
  pointer-events: none;
}

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 1rem);
}

@media (min-width: 576px) {
  .modal-dialog {
    max-width: 500px;
    margin: 1.75rem auto;
  }
  .modal-dialog-centered {
    min-height: calc(100% - 3.5rem);
  }
  .modal-lg {
    max-width: 800px;
  }
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-clip: padding-box;
  outline: 0;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem 1rem;
}

.modal-title {
  margin-bottom: 0;
  line-height: 1.5;
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1rem;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  padding: 0.75rem;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  width: 100vw;
  height: 100vh;
  background-color: #000;
  opacity: 0.5;
}

/* === FADE (глобально — заменяет bootstrap.css) === */

.fade { transition: opacity 0.15s linear; }
@media (prefers-reduced-motion: reduce) { .fade { transition: none; } }
.fade:not(.show) { opacity: 0; }

/* === COLLAPSE (глобально — заменяет bootstrap.css) === */

.collapse:not(.show) { display: none; }

.collapsing {
  position: relative;
  height: 0;
  overflow: hidden;
  transition: height 0.35s ease;
}
@media (prefers-reduced-motion: reduce) { .collapsing { transition: none; } }

/* === TABS === */

.tab-pane { display: none; }
.tab-pane.active { display: block; }
.tab-pane.fade { opacity: 0; transition: opacity .15s linear; }
.tab-pane.fade.show { opacity: 1; }

/* === MODAL DIALOG ANIMATION === */

.modal.fade .modal-dialog {
  -webkit-transition: -webkit-transform 0.3s ease-out;
  transition: -webkit-transform 0.3s ease-out;
  transition: transform 0.3s ease-out;
  transition: transform 0.3s ease-out, -webkit-transform 0.3s ease-out;
  -webkit-transform: translate(0, -50px);
  -ms-transform: translate(0, -50px);
  transform: translate(0, -50px);
}
@media (prefers-reduced-motion: reduce) {
  .modal.fade .modal-dialog { transition: none; }
}
.modal.show .modal-dialog {
  -webkit-transform: none;
  -ms-transform: none;
  transform: none;
}

/* === TEXT UTILITIES === */

.text-uppercase { text-transform: uppercase !important; }

/* === SCROLLBAR (перенесено из ech.css) === */

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-button {
  background-image: url('');
  background-repeat: no-repeat;
  width: 5px;
  height: 0px;
}

::-webkit-scrollbar-track {
  background-color: #10163a;
}

::-webkit-scrollbar-thumb {
  -webkit-border-radius: 0px;
  border-radius: 0px;
  background-color: #5ab9ea;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(90, 185, 234, 0.7);
}

::-webkit-resizer {
  background-image: url('');
  background-repeat: no-repeat;
  width: 4px;
  height: 0px;
}
