/* Счетчик изображений в модальном окне */
.image-modal-counter {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(32,32,32,0.7);
  color: #fff;
  padding: 2px 12px;
  border-radius: calc(0.7 * 12px);
  font-size: 1.05em;
  z-index: 10;
  pointer-events: none;
  min-width: 56px;
  text-align: center;
  display: none;
}
/* Стрелки для модального окна изображений */
.image-modal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  padding: 10px 15px;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 2010;
  border-radius: calc(0.7 * 5px);
  transition: background 0.18s, color 0.18s;
}
.image-modal-arrow-left { left: 24px; }
.image-modal-arrow-right { right: 24px; }
.image-modal-arrow:hover {
  background: #fff0f0;
  color: #b30000;
}

/* Close button для модального окна */
.image-modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  z-index: 2020;
  background: rgba(24,24,30,.7);
  border-radius: 50%;
  padding: .1em .35em;
  transition: background .18s, color .18s;
  border: none;
}
.image-modal-close:hover {
  color: #b30000;
  background: #fff0f0;
}

/* Контент изображения */
.image-modal-content, .gallery-full-img {
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0 0 32px #000;
  border-radius: calc(0.7 * 0.5em);
  background: #18181e;
  object-fit: contain;
  display: block;
  margin: auto;
}
/* ==================== */
/* === МОДАЛЬНЫЕ ОКНА === */
/* ==================== */

.modal-content {
    background: var(--nexus-dark);
    border: var(--border-width) solid var(--nexus-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition-modal);
}

.modal.show .modal-content {
    opacity: 1;
    transform: translateY(0);
}

.modal-header {
    background: var(--nexus-light-bg);
    border-bottom: var(--border-width) solid var(--nexus-border);
    color: var(--nexus-gold);
    padding: var(--spacing-md) var(--spacing-lg);
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    font-weight: var(--font-weight-semi);
}

.modal-body {
    background: var(--nexus-dark);
    color: var(--nexus-text);
    padding: var(--spacing-lg);
    line-height: var(--line-height-base);
}

.modal-footer {
    background: var(--nexus-light-bg);
    border-top: var(--border-width) solid var(--nexus-border);
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(24,24,30,.92);
    justify-content: center;
    align-items: center;
    overflow: auto;
}

.image-modal-content {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    margin: auto;
    display: block;
  border-radius: calc(0.7 * 0.5em);
    box-shadow: 0 8px 32px #000a;
    background: var(--nexus-dark);
    object-fit: contain;
}

.image-modal-close {
    position: fixed;
    top: 32px;
    right: 48px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    background: rgba(24,24,30,.7);
  border-radius: 50%;
    padding: .1em .35em;
    transition: background .18s, color .18s;
}

.image-modal-close:hover {
    color: #ccc;
    background: #fff0f0;
    color: #b30000;
}

/* Ограничить размер главного изображения */
.img-general-image,
.img-general-image-nozoom {
    max-width: 100%;
    max-height: 320px;
    width: auto;
    height: auto;
    margin-left: auto;
    margin-right: auto;
    background: #18181e;
  border-radius: calc(0.7 * 0.5rem);
    object-fit: contain;
}

.gallery-search-wrapper,
.mod-search-wrapper {
  position: relative;
  width: 100%;
  display: block;
  box-sizing: border-box;
}

.mod-search-wrapper .form-search,
.gallery-search-wrapper .form-search,
.gallery-search-wrapper .form-control {
  width: 100%;
  font-size: 0.95rem;
  border: 1px solid #333;
  border-radius: 6px;
  background: #1a1a1a;
  color: #e0e0e0;
  transition: all 0.3s ease;
}

.mod-search-wrapper .form-search:focus,
.gallery-search-wrapper .form-search:focus,
.gallery-search-wrapper .form-control:focus {
  background: #1a1a1a;
  border-color: #f0c040;
  color: #f0f0f0;
  outline: none;
  box-shadow: 0 0 0 2px rgba(240, 192, 64, 0.1);
}

.mod-search-wrapper .form-search,
.gallery-search-wrapper .form-control {
  border-radius: 6px 6px 0 0;
}

.mod-search-wrapper .form-search::placeholder,
.gallery-search-wrapper .form-search::placeholder {
  color: #666;
}

.gallery-search-results,
.mod-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 9999;
  box-sizing: border-box;
  background-color: #1a1a1a;
  border: 0px;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
}

.gallery-search-results .list-group-item,
.mod-search-results .list-group-item {
  padding: 12px 16px;
  margin: 0;
  cursor: pointer;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
  box-sizing: border-box;
  background: transparent;
  color: #e0e0e0;
  border: none;
  transition: all 0.2s ease;
  border-bottom: 1px solid #2a2a2a;
}

.gallery-search-results .list-group-item:last-child,
.mod-search-results .list-group-item:last-child {
  border-bottom: none;
}

.gallery-search-results .list-group-item:hover,
.mod-search-results .list-group-item:hover {
  background-color: #2a2a2a;
  color: #f0c040;
  padding-left: 20px;
}

.gallery-search-results .list-group-item.active,
.mod-search-results .list-group-item.active {
  background-color: #333;
  color: #f0c040;
}

/* Скроллбар для выпадающего списка */
.gallery-search-results::-webkit-scrollbar,
.mod-search-results::-webkit-scrollbar {
  width: 6px;
}

.gallery-search-results::-webkit-scrollbar-track,
.mod-search-results::-webkit-scrollbar-track {
  background: transparent;
}

.gallery-search-results::-webkit-scrollbar-thumb,
.mod-search-results::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}

.gallery-search-results::-webkit-scrollbar-thumb:hover,
.mod-search-results::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.modal-header .btn-close {
  filter: invert(1); /* крестик белый */
}

/* Search input with icon styling */
.mod-search-wrapper .position-relative,
.gallery-search-wrapper .position-relative {
  position: relative;
  display: flex;
  align-items: center;
  height: 38px;
  
}

.search-icon {
  color: #666;
  pointer-events: none;
  font-size: 0.95rem;
  position: absolute;
  left: 14px;
  /* transform: translateY(-50%); */
  z-index: 10;
  line-height: 1;
}

.gallery-search-wrapper .form-control,
.mod-search-wrapper .form-search {
  padding-left: 36px;
  border-color: var(--nexus-gold, #f0c040);
}

/* Search results styling */
.search-results-loading,
.search-results-error,
.search-results-empty {
  padding: 12px 16px;
  text-align: center;
}

.search-results-loading {
  color: #999;
}

.search-results-error {
  color: #f08080;
}

.search-results-empty {
  color: #999;
}

/* ============ HIDDEN MOD PAGE ============ */

.hidden-mod-card {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  border: 3px solid #f0c040;
  padding: 60px 40px;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(240, 192, 64, 0.3);
}

.hidden-mod-icon {
  font-size: 64px;
  color: #f0c040;
  margin-bottom: 30px;
}

.hidden-mod-title {
  color: #f0c040;
  font-weight: bold;
  margin-bottom: 20px;
  font-size: 32px;
}

.hidden-mod-message {
  color: #d4a574;
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 30px;
}

.hidden-mod-submessage {
  color: #999;
  font-size: 14px;
  margin-bottom: 40px;
}

.hidden-mod-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.hidden-mod-btn-primary,
.hidden-mod-btn-secondary {
  display: inline-block;
  padding: 12px 30px;
  font-weight: bold;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.hidden-mod-btn-primary {
  background-color: #f0c040;
  color: #1a1a1a;
  border: none;
}

.hidden-mod-btn-primary:hover {
  background-color: #e0b030;
  color: #1a1a1a;
  text-decoration: none;
}

.hidden-mod-btn-secondary {
  background-color: #666;
  color: #f0c040;
  border: 2px solid #f0c040;
}

.hidden-mod-btn-secondary:hover {
  background-color: #777;
  color: #f0c040;
  text-decoration: none;
}

.hidden-mod-info-alert {
  background-color: rgba(240, 192, 64, 0.1);
  border-left: 4px solid #f0c040;
  color: #f0c040;
}

/* === MODLIST CREATION MODAL === */
#createModlistModal .form-check-input {
  pointer-events: auto !important;
  cursor: pointer !important;
}

#createModlistModal .form-check {
  pointer-events: auto !important;
  cursor: pointer !important;
}

#createModlistModal .form-check-input:not(:disabled) {
  cursor: pointer;
}

#createModlistModal .form-check-label {
  cursor: pointer;
}