/**
 * Единые стили Nodal (карточки ассетов).
 * Используется на сайте и в приложении для одинакового визуала.
 */
.nodal-assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
}

.asset-card {
  background: rgba(24, 24, 27, 0.92);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: 1px solid rgba(63, 63, 70, 0.55);
  position: relative;
  text-decoration: none;
  color: inherit;
}

.asset-card:hover {
  border-color: rgba(249, 115, 22, 0.5);
  background: rgba(24, 24, 27, 0.98);
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.1);
}

.asset-card.server-asset {
  border: 1px solid rgba(63, 63, 70, 0.55);
}

.asset-card.my-asset {
  border: 1px solid rgba(249, 115, 22, 0.55);
}

.asset-color-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 6px 10px;
  min-height: 34px;
  box-sizing: border-box;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(20, 20, 24, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.asset-color-bar-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.asset-color-bar-title-inner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.asset-color-bar-title-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-card-author {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
  margin-left: 6px;
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  max-width: 100px;
  overflow: hidden;
}

.asset-card-author-avatar {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
  flex-shrink: 0;
}

.asset-card-content {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  padding: 12px;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.asset-card-bg {
  position: absolute;
  inset: 0;
  background-size: 130%;
  background-position: center;
  filter: blur(14px);
  opacity: 0.45;
  z-index: 0;
}

.asset-card-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(18, 18, 22, 0.65);
}

.asset-card-content .asset-thumb-container,
.asset-card-content .asset-info {
  position: relative;
  z-index: 1;
}

.asset-thumb-container {
  position: relative;
  width: 103px;
  height: 58px;
  min-width: 103px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(50, 50, 60, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.asset-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.asset-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.asset-desc {
  font-size: 12px;
  color: #aaa;
  margin: 0;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.nodal-empty {
  color: #6b7280;
  font-size: 13px;
  padding: 24px 0;
  text-align: center;
}

.nodal-loading {
  color: #6b7280;
  font-size: 13px;
  padding: 24px 0;
  text-align: center;
}

/* Skeleton loading animation */
@keyframes nodal-skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}
.nodal-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
}
.nodal-skeleton-card {
  background: rgba(24, 24, 27, 0.92);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(63, 63, 70, 0.55);
  animation: nodal-skeleton-pulse 1.5s ease-in-out infinite;
}
.nodal-skeleton-card .nodal-skeleton-thumb {
  width: 100%;
  height: 120px;
  background: rgba(60, 60, 70, 0.6);
}
.nodal-skeleton-card .nodal-skeleton-content {
  padding: 12px;
  display: flex;
  gap: 12px;
}
.nodal-skeleton-card .nodal-skeleton-content .nodal-skeleton-line {
  flex: 1;
  height: 12px;
  background: rgba(80, 80, 90, 0.6);
  border-radius: 4px;
}
.nodal-skeleton-card .nodal-skeleton-bar {
  height: 28px;
  background: rgba(50, 50, 60, 0.8);
  margin-top: auto;
}

/* Asset Modal — 1:1 как в приложении */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.modal-overlay.hidden { display: none !important; }
.asset-modal-overlay .asset-modal-content {
  background: #282828;
  border-radius: 0;
  border: 1px solid rgb(0, 0, 0);
  width: 95vw;
  max-width: 1280px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.asset-modal-overlay.active .asset-modal-content { transform: scale(1); }
.asset-modal-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgb(0, 0, 0);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #212121;
  flex-shrink: 0;
}
.asset-modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-modal-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.asset-modal-header-actions .tool-btn {
  padding: 6px 14px;
  font-size: 12px;
  white-space: nowrap;
  background: #5a5a5a;
  border: 1px solid #444;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.asset-modal-header-actions .tool-btn:hover { background: #666; }
.asset-modal-header-actions .tool-btn.download-btn { background: var(--mb-accent, #f97316); border-color: var(--mb-accent, #f97316); }
.asset-modal-header-actions .tool-btn.download-btn:hover { background: #ea580c; border-color: #ea580c; }
.modal-close {
  width: 36px; height: 36px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: #888;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.modal-close:hover { background: rgba(255,255,255,0.12); color: #fff; }
.asset-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.asset-modal-body .item-view-layout {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}
.asset-modal-body .item-view-main { flex: 1; min-width: 0; }
.asset-modal-body .asset-inspector-panel {
  width: 300px;
  min-width: 280px;
  flex-shrink: 0;
  background: rgba(20, 21, 25, 0.8);
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  overflow: hidden;
}
.inspector-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 10px;
  font-weight: 800;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.inspector-panel-header i { color: var(--mb-accent, #f97316); font-size: 12px; }
.inspector-preview-content {
  padding: 12px;
  min-height: 120px;
  overflow-x: hidden;
  overflow-y: auto;
}
.page-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-title-with-fav { display: flex; align-items: center; gap: 12px; }
.page-title-row h2 { margin: 0; font-size: 28px; font-weight: 800; color: #fff; }
.asset-tabs-header { display: flex; gap: 20px; border-bottom: 1px solid rgba(255,255,255,0.06); margin-bottom: 20px; }
.asset-tab {
  padding: 10px 5px;
  font-size: 13px;
  font-weight: 700;
  color: #888;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.1s, border-color 0.1s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.asset-tab:hover { color: #eee; border-color: rgba(255,255,255,0.3); }
.asset-tab.active { color: var(--mb-accent, #f97316); border-bottom: 2px solid var(--mb-accent, #f97316); }
.asset-tab-content { display: none; }
.asset-tab-content.active { display: block; }
.page-full-story {
  color: #bbb;
  line-height: 1.7;
  font-size: 15px;
  margin-bottom: 30px;
}
.page-full-story p { margin-bottom: 20px; }
.asset-author-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  margin-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
}
.asset-author-compact .author-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
  flex-shrink: 0;
}
.asset-author-compact .author-label { color: #666; margin-right: 4px; }
.asset-author-compact .author-name { color: #bbb; font-weight: 600; }
.asset-reviews-below {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.asset-reviews-below .sidebar-panel-header {
  border-bottom: none;
  padding: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  font-weight: 800;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.reviews-container { padding: 10px; min-height: 80px; }
.reviews-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.reviews-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  font-size: 13px;
}
.reviews-item-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.reviews-item-body { flex: 1; min-width: 0; }
.reviews-item-author { font-weight: 600; color: #ddd; margin-bottom: 4px; }
.reviews-item-text { color: #aaa; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.reviews-item-actions { margin-top: 6px; }
.reviews-item-delete-btn {
  font-size: 11px; font-weight: 600; color: var(--mb-accent, #f97316); background: transparent; border: 1px solid rgba(249,115,22,0.45);
  padding: 4px 10px; border-radius: 6px; cursor: pointer; transition: background 0.2s, color 0.2s;
}
.reviews-item-delete-btn:hover { background: rgba(249,115,22,0.15); color: #fb923c; }
.reviews-form-wrap { margin-top: 8px; }
.reviews-textarea {
  width: 100%;
  padding: 10px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
  margin-bottom: 8px;
}
.reviews-form-actions { display: flex; gap: 8px; }
.reviews-login-hint { font-size: 12px; color: #666; font-style: italic; padding: 8px 0; }
.reviews-empty-unified { font-size: 12px; color: #555; text-align: center; padding: 10px 0; font-style: italic; }
.reviews-loading { font-size: 12px; color: #666; padding: 10px 0; }
.page-instructions h4 { margin: 0 0 12px; font-size: 14px; color: #888; }
.page-instructions div { color: #bbb; line-height: 1.6; white-space: pre-wrap; }
.asset-badge {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #ddd;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
@media (max-width: 900px) {
  .asset-modal-body .item-view-layout { flex-direction: column; }
  .asset-modal-body .asset-inspector-panel { width: 100%; min-width: 0; }
}

/* Полная страница ассета (/nodal/:id) */
.nodal-detail-back {
  font: inherit;
}
.nodal-detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
}
@media (min-width: 900px) {
  .nodal-detail-layout {
    grid-template-columns: 1fr minmax(260px, 300px);
    gap: 32px;
  }
}
.nodal-detail-main {
  min-width: 0;
}
.nodal-detail-aside {
  min-width: 0;
}

/* Полная страница ассета: бейдж «проверено администрацией» на превью */
.nodal-detail-preview-verified {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, rgba(29, 161, 242, 0.94), rgba(12, 108, 168, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  max-width: min(100% - 20px, 300px);
}
.nodal-detail-preview-verified-ico {
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
  opacity: 0.95;
}
.nodal-detail-preview-verified-text {
  min-width: 0;
}
@media (max-width: 400px) {
  .nodal-detail-preview-verified {
    padding: 5px 8px;
    gap: 4px;
    font-size: 10px;
    max-width: calc(100% - 16px);
  }
  .nodal-detail-preview-verified-ico {
    font-size: 15px;
  }
}

/* Лайки / дизлайки */
.nodal-vote-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.nodal-vote-row--detail {
  margin-top: 0;
  margin-bottom: 16px;
}
.nodal-detail-title-vote-row {
  width: 100%;
}
.nodal-vote-row--titlebar {
  margin-top: 0;
  margin-bottom: 0;
  flex-shrink: 0;
}
.nodal-vote-row--titlebar .nodal-vote-btn {
  border-color: rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.22);
}
.nodal-vote-row--titlebar .nodal-vote-btn:hover {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}
.nodal-vote-row--titlebar .nodal-vote-btn.nodal-vote-active {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.nodal-vote-row--titlebar .nodal-vote-down.nodal-vote-active {
  border-color: rgba(252, 165, 165, 0.55);
  background: rgba(248, 113, 113, 0.18);
  color: #fecaca;
}
.nodal-detail-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (min-width: 640px) {
  .nodal-detail-title-text {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
  }
}

/* Средний рейтинг на превью карточки (stories-style) */
.asset-thumb-container .nodal-card-rating-thumb {
  position: absolute;
  bottom: 3px;
  right: 3px;
  z-index: 2;
  max-width: calc(100% - 6px);
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #fff;
  white-space: nowrap;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}
.asset-thumb-container .nodal-card-rating-thumb[hidden] {
  display: none !important;
}

/* Дашборд: мини-превью Nodal (40×40) + бейдж рейтинга */
.dashboard-nodal-thumb-wrap {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: 0.5rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}
.dashboard-nodal-thumb-wrap > img,
.dashboard-nodal-thumb-wrap > .dashboard-nodal-thumb-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dashboard-nodal-thumb-wrap .nodal-dashboard-rating-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  z-index: 2;
  max-width: calc(100% - 4px);
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #fff;
  white-space: nowrap;
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}
.nodal-vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--mb-text-muted, #a1a1aa);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.nodal-vote-btn:hover {
  border-color: rgba(249, 115, 22, 0.45);
  color: var(--mb-text, #fafafa);
}
.nodal-vote-btn.nodal-vote-active {
  border-color: rgba(249, 115, 22, 0.65);
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
}
.nodal-vote-down.nodal-vote-active {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}
.nodal-vote-ico {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.85;
}
.nodal-preview-video,
.nodal-preview-img {
  display: block;
}

/* Отзывы Nodal: ховер-карточка как в чате */
.nodal-detail-comment .cw-hover-profile-trigger {
  cursor: pointer;
}
.nodal-detail-comment .cw-who.cw-hover-profile-trigger {
  color: var(--mb-text, #fafafa);
}
.nodal-detail-comment .cw-msg-avatar.cw-hover-profile-trigger {
  width: 2.25rem;
  height: 2.25rem;
}

.nodal-more-from-author-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nodal-more-asset-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  color: var(--mb-text, #fafafa);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.nodal-more-asset-btn:hover {
  border-color: rgba(249, 115, 22, 0.4);
  background: rgba(249, 115, 22, 0.06);
}
.nodal-more-asset-thumb {
  width: 56px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.35);
}
.nodal-more-asset-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
