/* css/ui.css
   Единые UI-компоненты, вынесенные из стилистики страницы "Информация".
   Подключается ПОСЛЕ style.css.
*/

:root{
  --ui-radius: 18px;
  --ui-radius-sm: 14px;
  --ui-shadow: 0 10px 24px rgba(0,0,0,.25);
  --ui-focus: 0 0 0 .2rem rgba(59,130,246,.18);
}

/* ===== Buttons ===== */
.ui-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--ui-radius-sm);
  color: var(--text);
  background: linear-gradient(180deg, rgba(109,94,252,.22), rgba(109,94,252,.10));
  border: 1px solid rgba(109,94,252,.35);
  box-shadow: var(--ui-shadow);
  text-decoration: none;
}
.ui-btn:hover{ background: linear-gradient(180deg, rgba(109,94,252,.28), rgba(109,94,252,.12)); color: var(--text); }
.ui-btn:disabled{ opacity: .55; cursor: not-allowed; }

.ui-btn-secondary{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--ui-radius-sm);
  color: var(--text);
  background: linear-gradient(180deg, rgba(53, 51, 71, 0.22), rgba(109,94,252,.10));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--ui-shadow);
}
.ui-btn-secondary:hover{ background: linear-gradient(180deg, rgba(62, 58, 97,.28), rgba(109,94,252,.12)); color: var(--text); }

.ui-btn-danger{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--ui-radius-sm);
  color: var(--text);
  background: linear-gradient(180deg, rgba(255,107,107,.18), rgba(255,107,107,.08));
  border: 1px solid rgba(255,107,107,.35);
  box-shadow: var(--ui-shadow);
}
.ui-btn-danger:hover{ background: linear-gradient(180deg, rgba(255,107,107,.22), rgba(255,107,107,.10)); }

/* Bootstrap buttons -> unified (минимально, без ломания разметки страниц) */
.btn{
  border-radius: var(--ui-radius-sm) !important;
  box-shadow: var(--ui-shadow);
}
.btn-primary{
  background: linear-gradient(180deg, rgba(109,94,252,.22), rgba(109,94,252,.10)) !important;
  border: 1px solid rgba(109,94,252,.35) !important;
  color: var(--text) !important;
}
.btn-primary:hover{ background: linear-gradient(180deg, rgba(109,94,252,.28), rgba(109,94,252,.12)) !important; }

.btn-success{
  background: linear-gradient(180deg, rgba(34,197,94,.18), rgba(34,197,94,.08)) !important;
  border: 1px solid rgba(34,197,94,.35) !important;
  color: var(--text) !important;
}
.btn-success:hover{ background: linear-gradient(180deg, rgba(34,197,94,.22), rgba(34,197,94,.10)) !important; }

.btn-outline-light{
  border-color: rgba(255,255,255,.14) !important;
  color: var(--text) !important;
}
.btn-outline-light:hover{
  background: rgba(255,255,255,.06) !important;
  color: var(--text) !important;
}

/* ===== Inputs / selects ===== */
.ui-input,
.form-control,
.form-select{
  background: rgba(255,255,255,.02) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: var(--ui-radius-sm) !important;
}
.ui-input::placeholder,
.form-control::placeholder{ color: rgba(255,255,255,.35) !important; }
.ui-input:focus,
.form-control:focus,
.form-select:focus{
  box-shadow: var(--ui-focus) !important;
  border-color: rgba(59,130,246,.55) !important;
}

/* ===== Panels / cards ===== */
.ui-panel{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--ui-radius);
  background: rgba(255,255,255,.02);
  overflow: hidden;
}
.ui-panel-top{
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ui-panel-title{ font-weight: 700; }
.ui-panel-meta{ color: var(--muted); font-size: 12px; }

.ui-empty{ padding: 14px; color: var(--muted); }

/* ===== Badges (похожие на скриншоты) ===== */
.ui-badge{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--text);
}
.ui-badge-purple{ border-color: rgba(109,94,252,.35); background: rgba(109,94,252,.10); }
.ui-badge-green{ border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.10); }
.ui-badge-red{ border-color: rgba(255,107,107,.35); background: rgba(255,107,107,.10); }
.ui-badge-amber{ border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.10); }

/* ===== Modals (в стиле info-modal) ===== */
.ui-modal,
.info-modal{
  background: linear-gradient(180deg, rgba(26,30,46,.96) 0%, rgba(26,30,46,.90) 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
}
.ui-modal .modal-header,
.info-modal .modal-header{ border-bottom: 1px solid var(--border); }
.ui-modal .modal-footer,
.info-modal .modal-footer{ border-top: 1px solid var(--border); }

/* ===== Small helpers ===== */
.ui-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.ui-head h1{ margin:0; }
.ui-head-actions{ display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-end; }

/* ===== Interviews page tweaks ===== */
#interviewsPage .interviews-tab{
  padding: 0 14px 14px;
}
#interviewsPage .info-catbar{
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ===== Custom dropdown for native <select> (site-wide) =====
   We keep the original <select> in DOM for backward compatibility,
   but it must be visually hidden to avoid "double" controls.
*/
.sp-select-hidden{
  display: none !important;
}

.sp-select-dd{ position: relative; }

.sp-dd-btn{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sp-dd-btn .dd-text{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-dd-menu{
  /* Меню должно подстраиваться под ширину текста, но не вылезать за экран */
  width: max-content;
  min-width: 100%;
  max-width: 90vw;

  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sp-dd-menu .dropdown-item{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-dd-menu .dropdown-item.active{
  font-weight: 600;
}

/* ===== Scrollbar theme (dark UI) ===== */
.sp-dd-menu,
.modal-content,
.app-scroll,
* {
  scrollbar-width: thin;
  scrollbar-color: #3b82f6 #0b1220; /* Firefox */
}

/* Chrome / Edge / Safari */
.sp-dd-menu::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.app-scroll::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.sp-dd-menu::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track,
.app-scroll::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
  background: #0b1220;
  border-radius: 8px;
}

.sp-dd-menu::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
.app-scroll::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #3b82f6, #6366f1);
  border-radius: 8px;
  border: 2px solid #0b1220;
}

.sp-dd-menu::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover,
.app-scroll::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #60a5fa, #818cf8);
}

/* ===== Events (Ивентёрская) ===== */
.events-page h1{ font-size: 28px; font-weight: 800; }
.events-card{
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  overflow: hidden;
}
.events-card__head{
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  font-weight: 800;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
}
.events-calendar{ padding: 12px; }

.sp-stat{
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--ui-radius);
  padding: 16px;
  box-shadow: var(--ui-shadow);
  display:flex;
  flex-direction:column;
  gap: 6px;
  min-height: 110px;
}
.sp-stat__icon{ opacity:.8; }
.sp-stat__num{ font-size: 28px; font-weight: 900; }
.sp-stat__label{ color: rgba(255,255,255,.55); font-weight: 600; font-size: 12px; }

.events-filters{
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--ui-radius);
  padding: 14px;
}

.events-upcoming{ padding: 12px 16px; }
.ev-up-item{
  display:flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.ev-up-item:last-child{ border-bottom: none; }
.ev-up-dot{ width:10px; height:10px; border-radius:999px; margin-top: 6px; flex:0 0 auto; }
.ev-up-title{ font-weight: 800; }
.ev-up-meta{ color: rgba(255,255,255,.55); font-size: 12px; }

.sp-modal{
  background: #121a2a;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--ui-radius);
  color: rgba(255,255,255,.92);
}
.sp-modal .modal-header{ border-bottom: 1px solid rgba(255,255,255,.07); }
.sp-modal .modal-footer{ border-top: 1px solid rgba(255,255,255,.07); }

.ev-colors{ display:flex; gap:10px; flex-wrap:wrap; padding: 6px 0; }
.ev-color{
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.2);
  cursor: pointer;
}
.ev-color.active{ border-color: rgba(255,255,255,.9); box-shadow: 0 0 0 2px rgba(0,0,0,.2) inset; }

.ev-participants{ display:flex; flex-direction:column; gap:8px; padding: 6px 0; max-height: 240px; overflow:auto; }
.ev-participants .form-check-label{ color: rgba(255,255,255,.85); }

/* точечный фикс модалки баллы (выдача) */
#giveModal .modal-dialog {
    max-width: 560px !important;
    width: calc(100% - 32px) !important;
    margin: 60px auto !important;
}

#giveModal .modal-content {
    background: #0f172a !important;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
    border-radius: 18px !important;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65) !important;
    overflow: visible !important;
    max-height: none !important;
}

#giveModal .modal-header {
    padding: 20px 20px 12px 20px !important;
    border-bottom: none !important;
}

#giveModal .modal-title {
    font-size: 20px !important;
    font-weight: 700 !important;
}

#giveModal .modal-body {
    padding: 16px 20px 18px 20px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 16px 18px !important;
    overflow: visible !important;
    max-height: none !important;
}

#giveModal .modal-body > div {
    margin-bottom: 0 !important;
}

#giveModal .modal-body .form-group,
#giveModal .modal-body .mb-3 {
    width: 100% !important;
    margin-bottom: 0 !important;
}

#giveModal .modal-body .form-group:nth-child(1),
#giveModal .modal-body .mb-3:nth-child(1),
#giveModal .modal-body .form-group:nth-child(2),
#giveModal .modal-body .mb-3:nth-child(2) {
    width: calc(50% - 9px) !important;
}

#giveModal label {
    display: block !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
    color: #e5e7eb !important;
}

#giveModal input,
#giveModal select,
#giveModal textarea,
#giveModal .dropdown-toggle {
    width: 100% !important;
    height: 42px !important;
    min-height: 42px !important;
    border-radius: 12px !important;
    background: rgba(30, 41, 59, 0.95) !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
    color: #e5e7eb !important;
    box-shadow: none !important;
}

#giveModal input::placeholder,
#giveModal textarea::placeholder {
    color: rgba(229, 231, 235, 0.45) !important;
}

#giveModal .dropdown-toggle {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#giveModal .dropdown-menu {
    z-index: 3000 !important;
    width: 100% !important;
    max-height: 220px !important;
    overflow-y: auto !important;
    background: #111827 !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
    border-radius: 12px !important;
}

#giveModal .modal-footer {
    padding: 14px 20px 20px 20px !important;
    border-top: none !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 10px !important;
}

@media (max-width: 640px) {
    #giveModal .modal-dialog {
        width: calc(100% - 20px) !important;
        margin: 20px auto !important;
    }

    #giveModal .modal-body {
        display: block !important;
    }

    #giveModal .modal-body .form-group,
    #giveModal .modal-body .mb-3 {
        width: 100% !important;
        margin-bottom: 14px !important;
    }
}

#giveModal .dropdown-toggle,
#giveModal button.dropdown-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    text-align: left !important;
    padding: 0 14px !important;
}

#giveModal .dropdown-toggle::after {
    margin-left: auto !important;
}

#giveModal .dropdown-toggle .filter-option,
#giveModal .dropdown-toggle .filter-option-inner,
#giveModal .dropdown-toggle .filter-option-inner-inner {
    text-align: left !important;
    width: 100% !important;
}