/* ==========================================================================
   Knigoman.bg — Книжни клубове
   Споделен CSS файл за всички страници на модула "клубове".
   ========================================================================== */


:root {
  /* Палитра на платформата */
  --color-burgundy: #7B2D3E;
  --color-burgundy-dark: #5f2130;
  --color-teal: #1C7C74;
  --color-teal-dark: #155f59;
  --color-royal: #2955C4;
  --color-royal-dark: #1f3f98;

  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-border: #eeeeee;
  --color-border-strong: #d3d3d3;

  --color-text: #262626;
  --color-text-muted: #6b6b6b;
  --color-text-faint: #9a9a9a;

  --radius-sm: 6px;
  --radius-md: 8px;

  --container-max: 1140px;
  --gutter: 24px;
}


/* --------------------------------------------------------------------------
   Layout container — за преизползване във всички страници на модула
   -------------------------------------------------------------------------- */
   .club-share-section{margin-top: 15px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;}
   .club-share-section a{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    }
    .club-share-section i{font-size: 16px;    padding: 6px;}
    .club-share-section i:hover{opacity: 0.7;background: #f2f6fe;}
    .club-share-section button{ background:transparent; border:none; font-size: 16px; cursor: pointer;    padding: 0;}
.check-remove-avatar{    display: inline-block;
    padding: 2px;
    height: 15px;
    width: 15px;
    border: 2px solid #fffefe;
    box-shadow: 0 0 1px 1px rgba(51, 51, 51, 0.60);}
.clubs-page {
  background: var(--color-bg);
  min-height: 100vh;
  padding: 32px 16px 64px;
}

.clubs-container {
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.clubs-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin: 32px 0 35px 0;
    flex-direction: column;
}
.clubs-header i{font-size: 20px;
    color: #878787;}
.clubs-header h1 {
    font-size: 27px;
    font-weight: 600;
    display: flex;
    gap: 10px;
    align-items: center;
}

.clubs-section {
  margin-bottom: 40px;
}

.clubs-section h2 {
  /* font-size: 19px;
  font-weight: 600;
  margin-bottom: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border); */
}

.clubs-empty {
  color: var(--color-text-muted);
  padding: 32px 0;
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   Бутони — общи за целия модул
   -------------------------------------------------------------------------- */
.btn-create {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
  
  
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    justify-content: center;
}

.btn-create:hover {
  text-decoration: none;
}

.btn-create-primary {
  background: var(--color-teal);
  color: #fff;
}

.btn-create-primary:hover {
  background: var(--color-teal-dark);
  color: #fff;
}
   /*  */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    justify-content: center;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--color-teal);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-teal-dark);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--color-royal);
  border-color: var(--color-royal);
}

.btn-secondary:hover {
  background: var(--color-royal);
  color: #fff;
}

.clubs-limit-note {
    font-size: 13px;
    color: var(--color-text-faint);
    background: #fffcf7;
    display: flex;
    justify-content: center;
    padding: 20px 5px;
    border-radius: 10px;
    border: 1px solid #ede7e7;
}
.clubs-limit-full {
    font-size: 13px;
    color: var(--color-text-faint);
}
/* --------------------------------------------------------------------------
   Листинг с клубове — всеки клуб на собствен ред (не grid/колони)
   -------------------------------------------------------------------------- */

.club-list {
  display: flex;
  flex-direction: column;
  margin-top: 16px;
gap:10px;
}

.club-row {
display: flex;
    align-items: flex-start;
    gap: 16px;
    border: 1px solid #eeeeee;
    padding: 25px;
    transition: all 0.2s ease;
    background: #fff;
    border-radius: 10px;
}

.club-row:hover {
      box-shadow: 0 15px 30px 0 #dcdce5;
}

.club-avatar {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    flex-shrink: 0;
}

.club-avatar-placeholder {
  width: 100px;
    height: 100px;
  border-radius: 50%;
  background: #f0efe9;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.club-body {
  min-width: 0;
  flex: 1;
}

.club-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--color-burgundy);
}

.club-title a {
  color: var(--color-text);
}

.club-title a:hover {
  color: var(--color-teal);
}

.club-meta {
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin: 0 0 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
}

.club-meta .dot::before {
  content: "·";
  margin-right: 8px;
  color: var(--color-border-strong);
}

.club-creator {
  color: var(--color-text-faint);
}

.club-description {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
    .detail-header-row {
    flex-direction: column;
}

  .clubs-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .club-row {
    gap: 12px;
  }

  .club-avatar,
  .club-avatar-placeholder {
    width: 60px;
    height: 60px;
    font-size: 18px;
  }

  .club-title {
    font-size: 16px;
  }

  .club-description {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

/* ==========================================================================
   Допълнителни бутони (club_view.html и нататък)
   ========================================================================== */

:root {
  --color-danger: #c0392b;
  --color-danger-dark: #9c2e21;
}

.btn-royal {
  background: var(--color-royal);
  color: #fff;
}

.btn-royal:hover {
  background: var(--color-royal-dark);
  color: #fff;
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}

.btn-danger:hover {
  background: var(--color-danger-dark);
  color: #fff;
}

.btn-ghost-sm {
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-muted);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-ghost-sm:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

.badge-neutral {
  display: inline-block;
  background: #efefef;
  color: var(--color-text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Хлебни трохи (breadcrumb)
   -------------------------------------------------------------------------- */

.breadcrumb {
  margin-bottom: 20px;
  font-size: 13px;
}

.breadcrumb-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb-link {
  color: var(--color-text-muted);
}

.breadcrumb-link:hover {
  color: var(--color-teal);
}

.breadcrumb-sep {
  color: var(--color-border-strong);
}

.breadcrumb-current {
  color: var(--color-text);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Заглавен ред на секция (h2 + бутон вдясно, обща лента)
   -------------------------------------------------------------------------- */

.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.section-toolbar h2 {
  font-size: 19px;
  font-weight: 600;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Детайлна страница на клуб — горен блок с информация
   -------------------------------------------------------------------------- */

.club-detail {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.club-detail-avatar {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.club-detail-avatar-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #f0efe9;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}

.club-detail-body {
  flex: 1;
  min-width: 220px;
}
.edit-link{   
        display: flex;
    align-items: center;
    font-size: 12px;
    /* color: #424242; */
    margin: 0 0 10px 0;
    gap: 5px;
    background: #fbf4f6;
    padding: 5px 8px;
    color: #ad003b;
    cursor: pointer;
    width: 100px;
    border-radius: 50px;
    border: 1px solid #e590ad;
    justify-content: center;
}

.club-detail-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.club-detail-title {
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.club-detail-meta {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--color-text-muted);
      display: flex;
    gap: 10px;
}

.club-detail-meta strong {
  color: var(--color-text);
  font-weight: 600;
}

.club-detail-meta a {
  color: var(--color-royal);
  font-weight: 600;
}

.club-detail-meta a:hover {
  color: var(--color-teal);
}


.meta-sep {
  color: var(--color-text-muted);
  margin: 0 8px;
}

.club-detail-description {
font-size: 13px;
    line-height: 1.6;
    color: var(--color-text-muted);
}

.club-membership-action {
  flex-shrink: 0;
  text-align: center;
}

.club-membership-hint {
  font-size: 11px;
  color: var(--color-text-faint);
  margin-top: 6px;
}

/* --------------------------------------------------------------------------
   Теми/дискусии
   -------------------------------------------------------------------------- */

.topics-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.topic-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: all .2s;
  
}
.topic-card:hover {
    box-shadow: 0 15px 30px 0 #dcdce5;
}
.topic-card--new {
border-color: #e7d7c5;
    border-left: 4px solid #e7d7c5;
    background: #fffcf7;
}
.club-card--new {
border-color: #e7d7c5;
    border-left: 4px solid #e7d7c5;
    background: #fffcf7;
}
.topic-title {
  margin: 0 0 5px;
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topic-title a {
  color: var(--color-text);
}

.topic-title a:hover {
  color: var(--color-teal);
}

/* .badge-new {
  background: var(--color-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
} */
.badge-new i{color: var(--color-danger);}

.topic-meta {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.topics-empty {
  color: var(--color-text-muted);
  font-style: italic;
  padding: 24px 0;
}

/* --------------------------------------------------------------------------
   Модал
   -------------------------------------------------------------------------- */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.is-open {
  display: flex;
}

.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  width: 450px;
  max-width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
      left: auto;
    top: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 18px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-faint);
  padding: 0;
}

.modal-close:hover {
  color: var(--color-text-muted);
}

.modal-body {
  overflow-y: auto;
  flex-grow: 1;
  padding-right: 4px;
}

.modal-loading {
  text-align: center;
  color: var(--color-text-muted);
  padding: 24px 0;
}

/* --------------------------------------------------------------------------
   Responsive — детайлна страница
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  .club-detail {
    padding: 16px;
    gap: 16px;
  }
.club-detail-meta {
    flex-direction: column;
}
  .club-detail-avatar,
  .club-detail-avatar-placeholder {
    width: 72px;
    height: 72px;
    font-size: 24px;
  }

  .club-detail-title {
    font-size: 19px;
  }

  .club-membership-action {
    width: 100%;
    text-align: left;
  }
}



/* --------------------------------------------------------------------------
   Форми
   -------------------------------------------------------------------------- */

.form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group:last-of-type {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-royal);
}

textarea.form-control {
  resize: vertical;
}

.form-file {
  width: 100%;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Съобщения / известия (грешки, ограничения)
   -------------------------------------------------------------------------- */

.alert {
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 20px;
}

.alert-danger {
  background: #fdf2f1;
  border: 1px solid #f1c2bd;
  color: var(--color-danger);
}

.alert-title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
}

.alert-text {
  margin: 0 0 10px;
  font-size: 14px;
  color: inherit;
}

.alert-list {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: inherit;
}

.alert-note {
  margin: 15px 0 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Линк "Назад"
   -------------------------------------------------------------------------- */

.back-link {

  font-size: 14px;
  color: var(--color-text);
}

.back-link:hover {
  color: var(--color-teal);
}

/* --------------------------------------------------------------------------
   Широк контейнер (тема + коментари)
   -------------------------------------------------------------------------- */

.clubs-container--wide {
  max-width: 1140px;
}

/* --------------------------------------------------------------------------
   Съобщения — успех (в допълнение на вече съществуващия .alert-danger)
   -------------------------------------------------------------------------- */

.alert-success {
  background: #eef8f0;
  border: 1px solid #b9e3c2;
  color: #1f6e37;
}

/* --------------------------------------------------------------------------
   Обобщена карта със съдържание (тема, коментар форма и т.н.)
   -------------------------------------------------------------------------- */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 0 0 35px 0;
}
#topic-title-text {display: flex;    gap: 10px;
    align-items: center;}
.detail-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.detail-header-row h1{font-size: 22px;}
.detail-meta {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 22px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 10px;
}

.detail-meta a {
  color: var(--color-royal);
}

.detail-meta a:hover {
  color: var(--color-teal);
}

.detail-content {
  color: var(--color-text);
  line-height: 1.6;
  font-size: 14px;
}
.main-title {
    font-size: 26px;
    color: #000;
    font-family: Roboto Condensed;
    font-weight: 500;
    padding: 0px 0 15px 0;
    border-bottom: 1px solid #e9e9e9;
    display: flex;
    align-items: center;
    gap: 10px;
}
.main-title i{    font-size: 22px;
    color: #979797;}
/* --------------------------------------------------------------------------
   Малки бутон/линк варианти
   -------------------------------------------------------------------------- */

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-muted {
  background: var(--color-border);
  color: var(--color-text-muted);
}

.btn-muted:hover {
  background: var(--color-border-strong);
  color: var(--color-text);
}

.link-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 12px;
}

.link-btn--danger {
  color: var(--color-danger);
}

.link-btn--primary {
  color: var(--color-royal);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Скрити по подразбиране форми (редакция, отговор) — JS превключва
   -------------------------------------------------------------------------- */

.hidden-form {
  display: none;
  margin-top: 15px;
}

/* --------------------------------------------------------------------------
   Коментари
   -------------------------------------------------------------------------- */

.comments-empty {
  color: var(--color-text-muted);
  font-style: italic;
  background: #fafafa;
  padding: 15px;
  border-radius: var(--radius-sm);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
 margin: 30px 0;
}

.comment-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 15px;
  border-radius: var(--radius-md);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  background: var(--color-border-strong);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #fff;
  font-size: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

.comment-avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-author-name {
  font-size: 14px;
  color: var(--color-text);
}
.comment-author-name a{color: var(--color-text);}
.comment-date {
  font-size: 12px;
  color: var(--color-text-faint);
  margin-left: 8px;
}

.comment-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.comment-actions form {
  margin: 0;
}

.comment-body {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  padding-left: 42px;
}

.comment-reply-toggle {
  padding-left: 42px;
}

.replies-list {
  margin-top: 15px;
  margin-left: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-left: 2px solid var(--color-border);
  padding-left: 15px;
}

.reply-card {
  background: #fdfdfd;
  border: 1px solid var(--color-border);
  padding: 12px;
  border-radius: var(--radius-sm);
}

.reply-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.reply-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reply-author-name {
  font-size: 13px;
  color: var(--color-text);
}

.reply-date {
  font-size: 11px;
  color: var(--color-text-faint);
}

.reply-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.reply-actions form {
  margin: 0;
}

.reply-body {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Форма за нов коментар / login prompt
   -------------------------------------------------------------------------- */
.topic-club-meta{    margin-top: 6px;
    font-size: 14px;
    color: #666;}
.comment-form-box {
  background: #f5f5f5;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.comment-form-box h3 {
      margin: 0 0 10px 0;
  font-size: 16px;
}

.login-prompt {
  text-align: center;
  padding: 20px;
  background: #f5f5f5;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.login-prompt p {
  margin: 0;
  color: var(--color-text-muted);
}

.login-prompt a {
  color: var(--color-royal);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Малък модал вариант + бутонна лента вдясно (report modal)
   -------------------------------------------------------------------------- */

.modal--sm {
  width: 400px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}