/* Стили для страницы Дневники Судеб — Destiny Hub */

.diaries-header {
  text-align: center;
  margin-bottom: 32px;
}

.diaries-header .page-title {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 30%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.diaries-header .page-subtitle {
  color: var(--muted);
  max-width: 650px;
  margin: 0 auto;
  font-size: 0.95rem;
  line-height: 1.6;
}

.drive-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 28px;
  min-width: 0;
}

@media (max-width: 992px) {
  .drive-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Виджеты боковой панели */
.drive-widget {
  background: rgba(15, 13, 22, 0.55);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.drive-widget-title {
  font-size: 1.1rem;
  font-weight: 800;
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
  padding-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.drive-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  padding: 4px 0;
}

.drive-list-num {
  font-weight: 900;
  color: var(--gold);
  width: 24px;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
}

.drive-list-text {
  flex: 1;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s ease;
  line-height: 1.4;
}

.drive-list-text:hover {
  color: var(--gold);
}

/* Панель публикации новой записи */
.publish-panel {
  background: rgba(15, 13, 22, 0.65);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(139, 92, 246, 0.03);
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.publish-panel *,
.diary-post-card * {
  box-sizing: border-box;
}

.publish-grid {
  grid-template-columns: minmax(0, 2fr) minmax(160px, 1fr) !important;
  min-width: 0;
}

.publish-actions {
  gap: 12px;
  min-width: 0;
}

.publish-panel input.form-input,
.publish-panel select.form-input,
.publish-panel textarea.form-textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  color: var(--text) !important;
  padding: 12px 16px !important;
  font-family: inherit !important;
  font-size: 0.9rem !important;
  outline: none !important;
  backdrop-filter: blur(8px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.publish-panel input.form-input:focus,
.publish-panel select.form-input:focus,
.publish-panel textarea.form-textarea:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 15px rgba(226, 184, 83, 0.35), inset 0 0 8px rgba(226, 184, 83, 0.1) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.publish-panel button[type="submit"] {
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  text-align: center;
  background: linear-gradient(135deg, var(--gold) 0%, var(--pink) 100%) !important;
  color: #000 !important;
  font-weight: 800 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none !important;
  padding: 12px 24px !important;
  border-radius: 12px !important;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(226, 184, 83, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.publish-panel button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(226, 184, 83, 0.4);
}

/* Лента постов блога */
.diary-feed {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.diary-post-card {
  background: rgba(15, 13, 22, 0.5);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.diary-post-card:hover {
  transform: translateY(-2px);
  border-color: rgba(226, 184, 83, 0.2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.diary-author-block {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-bottom: 16px;
}

.diary-author-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.diary-author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.diary-author-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  overflow-wrap: anywhere;
}

.diary-post-date {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 2px;
}

.diary-post-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 12px 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.diary-post-content {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 20px 0;
  overflow-wrap: anywhere;
}

/* Действия над постом */
.diary-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 16px;
}

.diary-action-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: normal;
}

.diary-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: translateY(-1px);
}

/* Блок комментариев и разборов мастеров */
.diary-comments-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.diary-comment {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  padding-top: 10px;
}

.diary-comment:not(:first-child) {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Выделение разбора от сертифицированного эксперта */
.diary-comment.master-expert {
  border: 1px solid rgba(226, 184, 83, 0.3) !important;
  background: rgba(226, 184, 83, 0.03) !important;
  box-shadow: 0 0 15px rgba(226, 184, 83, 0.05);
  border-radius: 14px;
  padding: 16px;
  margin-top: 12px;
}

.diary-comment-content {
  flex: 1;
}

.diary-comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.diary-comment-name {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--gold);
}

.diary-comment-text {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* Кнопки донатов и консультаций */
.diary-comment-content .btn-xs {
  font-size: 0.72rem !important;
  padding: 6px 12px !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
}

.diary-comment-content .btn-xs:not(.btn-ghost) {
  background: var(--gold) !important;
  color: #000 !important;
  border: none !important;
}

.diary-comment-content .btn-xs.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: var(--muted) !important;
}

.diary-comment-content .btn-xs.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #fff !important;
}

@media (max-width: 760px) {
  .portal-body-wrapper {
    margin-top: 100px !important;
    padding-top: 0 !important;
  }
}

/* ── CUSTOM RE-STYLES FOR SPACE GLASSMORPHISM ── */
.drive-widget {
  background: var(--card) !important;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2) !important;
}

.publish-panel {
  background: var(--card) !important;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2) !important;
}

.diary-post-card {
  background: var(--card) !important;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15) !important;
}

.diary-post-card:hover {
  transform: translateY(-4px) scale(1.01) !important;
  border-color: rgba(226, 184, 83, 0.3) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 15px rgba(226, 184, 83, 0.15) !important;
}

.diary-comment.master-expert {
  border: 1.5px solid rgba(226, 184, 83, 0.45) !important;
  background: rgba(226, 184, 83, 0.04) !important;
  box-shadow: 0 0 25px rgba(226, 184, 83, 0.1) !important;
  border-radius: 16px !important;
  padding: 20px !important;
  margin-top: 16px !important;
  transition: all 0.3s ease;
}

.diary-comment.master-expert:hover {
  border-color: var(--gold) !important;
  box-shadow: 0 0 30px rgba(226, 184, 83, 0.18) !important;
}

.diaries-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--muted);
  font-size: 1.1rem;
  gap: 16px;
}

.diaries-loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  border-top-color: var(--gold);
  animation: diariesSpin 1s linear infinite;
  box-shadow: 0 0 15px rgba(226, 184, 83, 0.2);
}

@keyframes diariesSpin {
  to { transform: rotate(360deg); }
}

.diaries-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  color: var(--pink);
  border: 1px dashed rgba(236, 72, 153, 0.3);
  background: rgba(236, 72, 153, 0.04);
  border-radius: 16px;
  text-align: center;
  gap: 12px;
  box-shadow: var(--glow-pink);
}

.diaries-error-icon {
  font-size: 2.2rem;
}
