/* ==================== */
/* === КАРТОЧКИ МОДОВ === */
/* ==================== */

.mods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    justify-content: center;
    gap: 15px;
    margin: 20px auto 0;
    max-width: calc(100% - 40px);
    align-items: stretch;
}

.mod-card {
    background: #23232b;
    border-radius: .75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    will-change: transform;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: auto;
    min-width: 290px;
    max-width: 290px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.13);
    transition: box-shadow .2s;
    font-size: .92em;
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.mod-thumb-wrapper {
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-top-left-radius: .75rem;
    border-top-right-radius: .75rem;
    background: #18181e;
    display: block;
    position: relative;
}

.mod-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #18181e;
    transition: transform .35s cubic-bezier(.4,2,.6,1);
    display: block;
}

.mod-thumb-wrapper:hover .mod-thumb {
    transform: scale(1.04);
}

.mod-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.7rem var(--spacing-md) var(--spacing-sm);
}

.mod-title {
    font-size: 1.08em;
    font-weight: var(--font-weight-semi, 600);
    margin: 0 0 0.2em 0;
    color: var(--nexus-white);
    line-height: var(--line-height-tight, 1.2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.6em;
}

.mod-title a {
    color: var(--nexus-white);
    text-decoration: none;
}

.mod-title a:hover {
    color: var(--nexus-white);
    text-decoration: underline;
}

.mod-author-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs, 0.4em);
    margin-bottom: 0.15em;
    font-size: 0.92em;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.mod-author-link,
.mod-category-link {
    color: #b0b0b0!important;
    text-decoration: none;
    font-weight: 400;
    font-size: .92em;
    transition: color .2s;
}

.mod-author-link:hover,
.mod-category-link:hover {
    color: #f7ce42;
    text-decoration: underline;
}

.mod-hr {
    border: none;
    border-top: var(--border-width, 1px) solid var(--nexus-card-bg, #3e3e46);
    margin: 0.4em 0;
    opacity: var(--opacity-muted, 0.5);
}

.mod-meta2 {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs, 0.4em);
    font-size: 0.85em;
    color: var(--nexus-text-muted, #b0b0b0);
    margin-bottom: var(--spacing-xs, 0.4em);
    flex-wrap: wrap;
}

.mod-desc {
    font-size: 0.91em;
    color: var(--nexus-description, #a2a3a8);
    margin-bottom: var(--spacing-sm, 0.5em);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 7;
    line-clamp: 7;
    -webkit-box-orient: vertical;
    min-height: 6.5em;
}

.no-border-shadow-bg {
    border: none!important;
    box-shadow: none!important;
    background: 0 0!important;
}

.mod-footer {
  background: #3E3E46;
  border-bottom-left-radius: 0.75rem;
  border-bottom-right-radius: 0.75rem;
  padding: 0.4em 1em 0.4em 1em;
  border-top: 1px solid #2e2e33;
  display: flex;
  align-items: center;
  min-height: 2em;
}

.mod-rating {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 0;
    margin: 0;
    background: 0 0;
    border: none;
}

.mod-rating .badge,
.mod-rating .downloads-badge,
.mod-rating .like-button {
    min-width: 28px;
    text-align: center;
    font-size: .78em;
    padding: .25em .5em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.6em;
    border-radius: .5em;
    box-sizing: border-box;
    box-shadow: none;
    margin: 0;
    line-height: 1;
    vertical-align: middle;
}

.mod-rating i {
    font-size: .9em;
    line-height: 1;
}

/* Новые базовые элементы для карточек */
.mod-downloaded-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    align-items: center;
}

.update-available-label {
    background: #fff;
    color: var(--nexus-dark);
    border-radius: 4px;
    padding: 0.3em;
    margin-right: 0.2em;
    font-size: 0.85em;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
    border: 1px solid #e0e0e0;
    letter-spacing: .01em;
}

.downloaded-checkmark {
    background: #fff;
    border-radius: 6px;
    padding: 3px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
    border: 1px solid #e0e0e0;
}

/* Кнопка скачивания (badge downloads) — сделать как в style.css */
.badge.bg-info,
.downloads-badge {
    color: var(--nexus-white);
}

.bg-info {
    --bs-bg-opacity:0;
    background-color: transparent!important;
}

.badge.bg-success {
    display: none;
}

.badge.bg-danger {
    font-family: Rajdhani, sans-serif;
    font-weight: 600;
    letter-spacing: .04em;
    background: #902c2b!important;
    align-items: center;
}

.badge.bg-secondary {
    background: #6c757d;
    color: #f3f3f3;
    display: inline-flex;
    align-items: center;
    font-size: 1em;
    min-width: 36px;
    height: 32px;
}

/* .separator — color, margin, font-weight */
.separator {
    color: #444;
    margin: 0 0.3em;
    font-weight: 700;
}

/* mod-author-row — убрать лишние стили, не делать фон, не делать границу */
.mod-author-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs, 0.4em);
    margin-bottom: 0.15em;
    font-size: 0.92em;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.mod-author-row img {
    width: 1.2em;
    height: 1.2em;
    border-radius: 50%;
    object-fit: cover;
    margin-right: .5em;
    vertical-align: middle;
    box-shadow: 0 0 0 2px #23232a;
}

.nexus-comment-card {
    border-left: 4px solid #f0c040;
    border-radius: .6rem;
    box-shadow: 0 2px 8px 0 #18181e33;
    margin-bottom: 1.2rem;
    color: #f3f3f3;
    border: none;
    position: relative;
    background: #2d2d35;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.nexus-comment-header {
    font-size: 1em;
    color: #f0c040;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .7em;
    padding-bottom: 0.5rem;
}

.nexus-comment-author {
    color: #e0e0e0;
    font-weight: 600;
    font-size: 1em;
}

.nexus-comment-author i.bi-person-circle {
    color: #f0c040!important;
}

.nexus-comment-date {
    color: #b0b0b0;
    font-size: .92em;
    font-weight: 400;
    color: #a0a0a0;
    font-size: 0.9em;
}

.nexus-comment-content {
    color: #e0e0e0;
    font-size: 1.04em;
    margin-top: .3em;
    word-break: break-word;
    padding-bottom: 1rem;
    padding-left: 1rem;
    color: #e0e0e0;
    line-height: 1.5;
}

.nexus-comment-card .delete-cross-form {
    margin-left: auto;
    display: inline;
}

.nexus-comment-card .delete-cross-btn {
    margin-left: .7em;
    vertical-align: middle;
}

.nexus-comment-card .delete-cross-btn i {
    vertical-align: middle;
}

.mod-detail-content .nexus-comment-card,
.mod-detail-content .nexus-comment-card .custom-card-body {
    background: #8884762b!important;
    color: #f3f3f3!important;
    border-left: 4px solid #f0c040!important;
    border-radius: .6rem!important;
    box-shadow: 0 2px 8px 0 #18181e33!important;
    margin-bottom: 1.2rem!important;
    padding: 1rem 1.2rem .7rem 1.2rem!important;
    position: relative!important;
}

.changelog-card {
    background: var(--nexus-light-bg);
    border-radius:.4em;
    
}

.extra-image-card {
  background-color: #23232a;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
  height: 100%;
}

.extra-image-card:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.extra-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: 0;
  border: none;
}

.mod-rating-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.mod-rating-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.mod-rating-right {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.endorse-mod-form {
  display: inline-block;
  margin: 0;
}

.gallery-thumb-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
}

.gallery-thumb {
  transition: transform 0.3s ease, filter 0.3s ease;
  display: block;
  width: 100%;
  height: auto;
}

.gallery-thumb:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.delete-cross-btn {
  opacity: 0;
  transition: opacity 0.2s;
}

.gallery-thumb-wrapper:hover .delete-cross-btn {
  opacity: 1;
}

.max-width-container {
  max-width: 1800px;
  margin: 0 auto;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* строго 4 в ряд */
  gap: 1rem;
}

.gallery-item {
  width: 100%;
}

.gallery-card-16-9 {
  position: relative;
  overflow: hidden;
}

.gallery-thumb-16-9 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.gallery-thumb-16-9 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-thumb-16-9 img:hover {
  transform: scale(1.05);
}

.pagination-btn {
  min-width: 40px;
  padding: .25rem .75rem;
  font-weight: 600;
}

.active-page {
  font-weight: 600;
}

/* Адаптив */
@media (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr); /* 3 в ряд на планшетах */
  }
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 в ряд на маленьких экранах */
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr; /* 1 в ряд на телефонах */
  }
}

.gallery-full-img {
  display: block;
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  margin: auto;
  object-fit: contain;
  background: #18181e;
  border-radius: 0.5rem;
}

.image-modal-close {
  position: absolute;
  top: 24px;
  right: 32px;
  color: #fff;
  font-size: 2.2rem;
  font-weight: 700;
  background: none;
  border: none;
  box-shadow: none;
  opacity: 0.85;
  z-index: 10000;
  padding: 0.1em 0.3em;
  transition: color .18s, opacity .18s;
}

.image-modal-close:hover {
  color: #f0c040;
  opacity: 1;
  background: none;
}
