/**FORUM**/
/* Main forum content */
.forum-main {
  flex: 1;
      margin-bottom: 40px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.forum-category-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 20px;
}

.forum-category-top h2 {
  font-size: 24px;
  color: #222;
  margin: 0;
}

.forum-category h2 {
  font-size: 24px;
  margin-bottom: 15px;
  color: #222;
  padding-left: 12px;
}

.forum-actions {
  text-align: right;
  margin-bottom: 20px;
}

.create-topic-btn {
  background: #784ba0;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.create-topic-btn:hover {
  background: #6a3d92;
}

.forum-section {
  padding: 20px 0;
  border-top: 1px solid #eee;
}

.forum-info {
  max-width: 55%;
}

.forum-info h3 a {
  font-size: 18px;
  color: #333;
  text-decoration: none;
}

.forum-info h3 a:hover {
  color: #784ba0;
}

.subforums {
  list-style: none;
  padding: 0;
  margin: 15px 0;
}

.subforums li {
  margin-bottom: 10px;
  font-size: 14px;
  color: #444;
}

.subforums .icon {
  margin-right: 6px;
}

.section-meta {
  font-size: 13px;
  color: #888;
}

.forum-last-post {
  max-width: 40%;
  text-align: right;
  font-size: 14px;
  color: #555;
}

.forum-last-post a {
  font-weight: 600;
  text-decoration: none;
  color: #222;
}

.forum-last-post a:hover {
  color: #784ba0;
}

.forum-last-post .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 6px;
}

.post-preview {
  margin-top: 6px;
  font-size: 13px;
  color: #777;
  font-style: italic;
}

.forum-online,
.forum-stats {
  background: #fff;
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 14px;
  color: #444;
}

.forum-online h3 {
  margin-bottom: 8px;
  font-size: 16px;
  color: #222;
  border-left: 4px solid #784ba0;
  padding-left: 10px;
}
.forum-category h2 {
  font-size: 20px;
  margin-bottom: 12px;
  color: #784ba0;
}

.forum-section {
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}

.forum-info {
  max-width: 65%;
}

.forum-info h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

.forum-info h3 a {
  color: #222;
  text-decoration: none;
}

.forum-info h3 a:hover {
  color: #784ba0;
}

.forum-info p {
  font-size: 14px;
  color: #555;
  margin-bottom: 4px;
}

.section-meta {
  font-size: 12px;
  color: #999;
}


/* Main forum content end */
.forum-latest {
    padding: 20px;
    margin-bottom: 30px;
    border-top: 1px solid #f2f2f2;
}

.forum-title {
  display: flex;
  align-items: center;
  font-size: 20px;
  margin-bottom: 16px;
  color: #333;
  font-weight: 600;
}

.forum-title .icon {
  width: 24px;
  height: 24px;
  margin-right: 8px;
  stroke: #784ba0;
}

.forum-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.forum-post {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.forum-post:last-child {
  border-bottom: none;
}

.forum-post a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #222;
  font-weight: 500;
  transition: color 0.2s ease;
}

.forum-post a:hover {
  color: #784ba0;
}

.forum-post .icon.small {
  width: 18px;
  height: 18px;
  margin-right: 6px;
  stroke: #999;
}

.meta {
  display: block;
  font-size: 13px;
  color: #888;
  margin-left: 24px;
  margin-top: 4px;
}


.forum-page {
width: 100%;
    max-width: 1400px;
    gap: 24px;
    padding: 20px;
    margin: 0 auto;
}
/**search panel**/
.forum-topbar {
  margin: 20px 0;
  text-align: right;
}

.forum-search {
  padding: 8px 14px;
  border: 1px solid #ccc;
  border-radius: 20px;
  width: 240px;
  font-size: 14px;
  transition: border 0.3s;
}

.forum-search:focus {
  outline: none;
  border-color: #784ba0;
}
/**search panel end*/

.forum-user-panel.compact {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  width: auto;
  gap: 20px;
  font-size: 14px;
}

.user-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  margin: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-weight: 600;
  color: #333;
}

.user-role {
  background: #784ba0;
  color: #fff;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 6px;
}

.user-status {
  font-size: 16px;
  color: #4CAF50;
  margin-left: 6px;
}

.user-menu.compact-menu {
  display: flex;
      align-items: center;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.user-menu.compact-menu a {
  text-decoration: none;
  color: #333;
  position: relative;
}

.badge {
  background-color: #784ba0;
  color: white;
  font-size: 11px;
  border-radius: 10px;
  padding: 1px 5px;
  margin-left: 4px;
}

/* Drop-down menu */
  .user-dropdown {
    position: relative;
    display: inline-block;
  }

  .dropdown-toggle {
    background: none;
    color: #404040;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 4px;
  }

  .dropdown-content {
    display: none;
    position: absolute;
    top: 110%;
    right: 0;
    background-color: #fff;
    min-width: 220px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-radius: 6px;
    z-index: 1000;
    padding: 15px;
    color: #333;
  }

  .dropdown-content > div {
    margin-bottom: 15px;
  }

  .dropdown-content h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #784ba0;
  }

  .dropdown-content ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
  }

  .dropdown-content ul li {
    margin-bottom: 6px;
  }

  .dropdown-content ul li a {
    color: #784ba0;
    text-decoration: none;
  }

  .dropdown-content ul li a:hover {
    text-decoration: underline;
  }

  /* Show menu when class is active */
  .user-dropdown.open .dropdown-content {
    display: block;
  }
        .forum {
            margin: 0 auto;
            padding: 20px;
            min-height: 100vh;
        }

        .forum-section {
            background: white;
            border-radius: 12px;
            margin-bottom: 24px;
            overflow: hidden;
        }

        .forum-section__header {
            background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
            padding: 20px;
            border-bottom: 1px solid #e2e8f0;
            border-radius: 50px;
            text-align: center;
        }

        .forum-section__main-title {
            margin: 0;
        }

        .forum-section__main-title a {
            color: #525252;
            text-decoration: none;
            font-size: 18px;
            font-weight: 700;
            transition: color 0.2s ease;
        }

        .forum-section__main-title a:hover {
            color: #5a3576;
        }

        .forum-subforums {
            list-style: none;
            margin: 0;
            padding: 0;
        }

        .forum-subforum {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 20px;
            border-bottom: 1px solid #e1e1e1;
            transition: all 0.2s ease;
            gap: 20px;
        }

        .forum-subforum:hover {
            background-color: #f8fafc;
        }

        .forum-subforum:last-child {
            border-bottom: none;
        }

        .subforum__info {
            flex: 60%;
            min-width: 0;
        }

        .subforum__title {
            display: flex;
            align-items: flex-start;
            gap: 16px;
        }

        .subforum__icon {
            width: 48px;
            height: 48px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 18px;
            font-weight: 600;
            flex-shrink: 0;
            position: relative;
        }

        .subforum__header {
            flex: 1;
            min-width: 0;
        }

        .subforum__link {
            color: #4f4f4f;
            text-decoration: none;
            font-weight: 600;
            font-size: 16px;
            line-height: 1.4;
            display: block;
            margin-bottflex: 1;om: 6px;
            transition: color 0.2s ease;
        }

        .subforum__link:hover {
            color: #353535;
            text-decoration: underline;
        }

        .subforum__desc {
            color: #64748b;
            font-size: 14px;
            line-height: 1.5;
            margin: 0;
        }

        .subforum__stats {
            display: flex;
            gap: 16px;
            align-items: center;
            flex-shrink: 0;
        }

        .subforum__stat {
            text-align: center;
            min-width: 60px;
        }

        .subforum__stat div:first-child {
            font-weight: 700;
            font-size: 16px;
            color: #784ba0;
            line-height: 1.2;
        }

        .subforum__stat div:last-child {
            font-size: 12px;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-top: 2px;
        }

        .subforum__last-post {
          flex:20%;
            display: flex;
            align-items: center;
            min-width: 150px;
            justify-content: flex-end;
            text-align: right;
            flex-shrink: 0;
        }

        .subforum__last-post small {
            color: #94a3b8;
            font-size: 13px;
            font-style: italic;
        }

        .subforum__last-post a {
            color: #784ba0;
            text-decoration: none;
            font-size: 13px;
            transition: color 0.2s ease;
        }

        .subforum__last-post a:hover {
            color: #5a3576;
            text-decoration: underline;
        }

        /* Responsive Design */
        @media (max-width: 768px) {
            .forum {
                padding: 16px;
            }
            flex: 1;
            .subforum__last-post {
                width: 100%;
                justify-content: flex-start;
                text-align: left;
            }

            .subforum__title {
                flex-direction: column;
                align-items: center;
                text-align: center;
                gap: 12px;
            }

            .subforum__icon {
                width: 40px;
                height: 40px;
                font-size: 16px;
            }
        }

        @media (max-width: 480px) {
            .forum-section__header {
                padding: 16px;
            }
            
            .forum-section__main-title a {
                font-size: 16px;
            }
            
            .forum-subforum {
                padding: 16px;
            }
            
            .subforum__icon {
                width: 36px;
                height: 36px;
                font-size: 14px;
            }
            
            .subforum__link {
                font-size: 15px;
            }
            
            .subforum__desc {
                font-size: 13px;
            }
        }
.forum-topic-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

  .forum-topics {
            border-radius: 12px;
            margin-bottom: 24px;
            overflow: hidden;
        }

        .forum-restricted {
            background: linear-gradient(135deg, #fef3cd 0%, #fde68a 100%);
            border: 1px solid #f59e0b;
            color: #92400e;
            padding: 16px 20px;
            margin: 20px;
            border-radius: 8px;
            font-size: 14px;
            text-align: center;
        }

        .forum-restricted a {
            color: #784ba0;
            text-decoration: none;
            font-weight: 600;
        }

        .forum-restricted a:hover {
            color: #5a3576;
            text-decoration: underline;
        }

        .forum-actions {
            padding: 20px;
            border-bottom: 1px solid #e2e8f0;
        }

        .forum-actions:last-child {
            border-bottom: none;
            border-top: 1px solid #e2e8f0;
        }
        .topic-section {
            border-bottom: 1px solid #e2e8f0;
        }

        .topic-section:last-child {
            border-bottom: none;
        }

        .forum-section-title {
            background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
            color: #784ba0;
            font-size: 16px;
            font-weight: 700;
            padding: 16px 20px;
            margin: 0;
            border-bottom: 1px solid #e2e8f0;
        }

        .forum-topic-list {
            list-style: none;
            margin: 0;
            padding: 0;
        }

        .forum-topic {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin: 0px 15px;
            border-bottom: 1px solid #f1f5f9;
            transition: all 0.2s ease;
            gap: 16px;
        }
li.forum-topic:first-child {
  padding: 15px 0;
}
        .forum-topic:hover {
            background-color: #f8fafc;
        }

        .forum-topic:last-child {
            border-bottom: none;
        }

        .forum-topic__main {
            min-width: 0;
            flex: 60%;
        }

        .forum-topic__title {
            color: #414141;
            text-decoration: none;
            font-weight: 600;
            font-size: 16px;
            line-height: 1.4;
            display: block;
            margin-bottom: 4px;
            transition: color 0.2s ease;
        }

        .forum-topic__title:hover {
            color: #5a3576;
        }

        .forum-topic__meta {
            font-size: 13px;
            color: #64748b;
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .forum-topic__meta a {
            color: #784ba0;
            text-decoration: none;
            transition: color 0.2s ease;
        }

        .forum-topic__meta a:hover {
            color: #5a3576;
            text-decoration: underline;
        }

        .subforum__stats {
            display: flex;
            gap: 16px;
            align-items: center;
            flex: 20%;
        }

        .subforum__stat {
            text-align: center;
            min-width: 60px;
        }

        .subforum__stat div:first-child {
            font-weight: 700;
            font-size: 16px;
            color: #3e3e3e;
            line-height: 1.2;
        }

        .subforum__stat div:last-child {
            font-size: 10px;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .forum-topic__last {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 13px;
            color: #64748b;
            min-width: 150px;
            justify-content: flex-end;
            text-align: right;
        }

        .forum-topic__last .icon {
            color: #784ba0;
            flex-shrink: 0;
        }

        .forum-topic__last a {
            color: #784ba0;
            text-decoration: none;
            transition: color 0.2s ease;
        }

        .forum-topic__last a:hover {
            color: #5a3576;
            text-decoration: underline;
        }
.forum-topic__last {
      flex: 20%;
  background-color: #f9f9f9;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 500px;
}

.forum-topic__last-message {
  font-style: italic;
  color: #444;
  padding-left: 20px;
  position: relative;
}
.forum-topic__last-info {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #666;
}

.forum-topic__last-info svg {
  flex-shrink: 0;
}

.forum-topic__last-info a {
  color: #007acc;
  text-decoration: none;
}

.forum-topic__last-info a:hover {
  text-decoration: underline;
}

        .forum-pagination {
            padding: 20px;
            display: flex;
            justify-content: center;
        }

        .forum-pagi {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .forum-pagi a {
            padding: 8px 12px;
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            color: #64748b;
            text-decoration: none;
            font-weight: 500;
            transition: all 0.2s ease;
            min-width: 40px;
            text-align: center;
        }

        .forum-pagi a:hover {
            background: #f8fafc;
            border-color: #cbd5e1;
            color: #784ba0;
        }

        .forum-pagi a.active {
            background: #784ba0;
            border-color: #784ba0;
            color: white;
        }

        .forum-online {
    background: white;
    padding: 20px;
    border-top: 2px dashed #d1d1d1;
        }

        .forum-online h3 {
            color: #784ba0;
            font-size: 16px;
            font-weight: 700;
            margin: 0 0 12px 0;
        }

        .forum-online p {
            color: #64748b;
            font-size: 14px;
            margin: 8px 0;
            line-height: 1.5;
        }

        .forum-online strong {
            color: #784ba0;
            font-weight: 600;
        }

        .forum-stats {
            background: white;
            border-radius: 12px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 16px;
        }

        .stat-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 16px;
            border-radius: 8px;
            border: 1px solid #e2e8f0;
            transition: all 0.2s ease;
        }
        .stat-text {
            color: #595959;
            font-weight: 600;
            font-size: 14px;
        }

        .online-indicator {
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            position: relative;
            flex-shrink: 0;
        }

        .online-indicator::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 8px;
            height: 8px;
            background: white;
            border-radius: 50%;
        }

        @media (max-width: 768px) {
            .forum {
                padding: 16px;
            }
            
            .forum-topic {
                flex-direction: column;
                align-items: flex-start;
                gap: 12px;
            }
            
            .subforum__stats {
                width: 100%;
                justify-content: space-around;
            }
            
            .forum-topic__last {
                width: 100%;
                justify-content: flex-start;
                text-align: left;
            }
            
            .forum-stats {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 480px) {
            .forum-section-title {
                font-size: 14px;
                padding: 12px 16px;
            }
            
            .forum-topic {
                padding: 12px 16px;
            }
            
            .forum-topic__title {
                font-size: 15px;
            }
        }

.breadcrumbs {
    font-size: 14px;
    margin: 16px;
    color: #666;
    border-top: 1px dashed #cdcdcd;
    border-bottom: 1px dashed #cdcdcd;
    padding: 10px 0 10px 10px;
}
.breadcrumbs a {
  color: var(--main);
  text-decoration: none;
}
.breadcrumbs a:hover {
  text-decoration: underline;
}

.topic-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.topic-title {
    font-size: 24px;
    font-weight: bold;
    color: #474747;
    margin: 25px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 10px;
    text-align: center;
}
.topic-actions .btn-create,
.topic-actions .btn-reply {
  background: var(--main);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  margin-left: 8px;
}
.topic-actions .btn-create:hover,
.topic-actions .btn-reply:hover {
  background: #7526ba;
  color:#fff
}

.message {
    display: flex;
    border: 1px solid #ececec;
    border-radius: 8px;
    padding: 16px;
    gap: 20px;
    margin: 20px auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    box-shadow: 0 0px 12px rgb(0 0 0 / 0.08);
}

.message-card {
  width:100%;
  background: #fff;
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e3e3e3;
  padding-bottom: 12px;
}

.user-avatar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-weight: 700;
  font-size: 20px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  box-shadow: 0 0 8px rgb(102 126 234 / 0.5);
}

.online-indicator {
  width: 12px;
  height: 12px;
  background-color: #4caf50;
  border: 2px solid #fff;
  border-radius: 50%;
  position: absolute;
  bottom: 0;
  right: 0;
  box-shadow: 0 0 5px #4caf50;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-weight: 600;
  font-size: 16px;
  color: #2c3e50;
}

.user-role {
  font-size: 13px;
  color: #888;
  font-style: italic;
}

.message-meta {
  text-align: right;
  font-size: 13px;
  color: #999;
  min-width: 130px;
}

.message-meta a.message-date {
  color: #555;
  text-decoration: none;
  font-weight: 500;
}

.message-meta a.message-date:hover {
  text-decoration: underline;
}

.message-id {
  margin-top: 4px;
  font-weight: 700;
  color: #bbb;
  user-select: none;
}

.message-content {
  padding-top: 8px;
}

.message-text {
  font-size: 15px;
  line-height: 1.5;
  color: #444;
  white-space: pre-wrap;
}

.message-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.action-buttons {
  display: flex;
  gap: 10px;
}

.action-button .icon {
  width: 16px;
  height: 16px;
  stroke: #777;
  stroke-width: 2;
  fill: none;
  transition: stroke 0.3s;
}

.action-button:hover {
  background-color: #7d30d0;
  color: #fff;
}

.action-button:hover .icon {
  stroke: #fff;
  fill:#fff;
}

.vote-buttons {
  display: flex;
  gap: 10px;
}

.action-button {
  background: #f5f5f5;
  border: none;
  color: #555;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 5px 10px;
    border-radius: 10px;
}
.topic-messages-answer {
    margin: 0 0 40px 0;
}
.vote-button {
    display: flex;
  gap: 8px;
  margin-left: auto;
  background: #e1e4ea;
  border: none;
  border-radius: 6px;
  width: 42px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background-color 0.3s;
  user-select: none;
}


.like-button,
.dislike-button {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: #784ba0;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.like-button:hover,
.dislike-button:hover {
  color: #f04c2f;
}

.vote-button:hover {
  background-color: #a6b1ff;
}

.vote-icon {
  stroke: #555;
  width: 20px;
  height: 20px;
  fill: none;
  stroke-width: 2;
  transition: stroke 0.3s;
}

.vote-button:hover .vote-icon {
  stroke: #fff;
}

.vote-button span {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #e5e5e5;
  color: #000;
  font-size: 12px;
  font-weight: 700;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  user-select: none;
}
.message-text {
    overflow-wrap: anywhere;
    padding: 0 25px;
}
.message-text {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  line-height: 1.6;
}

.message-text h1, .message-text h2, .message-text h3 {
  margin-top: 1em;
  margin-bottom: 0.5em;
  font-weight: 700;
  color: #222;
}

.message-text h1 {
  font-size: 1.8em;
}

.message-text h2 {
  font-size: 1.5em;
}

.message-text p {
  margin-bottom: 1em;
}

.message-text strong {
  font-weight: 700;
}

.message-text em {
  font-style: italic;
}

.message-text a {
  color: #1a73e8;
  text-decoration: underline;
}

.message-text ul, .message-text ol {
  margin-left: 1.5em;
  margin-bottom: 1em;
}

.message-text blockquote {
  margin: 1em 0;
  padding-left: 1em;
  border-left: 3px solid #ccc;
  color: #666;
  font-style: italic;
  background: #f9f9f9;
}

.message-text pre {
  background: #272822;
  color: #f8f8f2;
}

.message-text code {
  font-family: Consolas, Monaco, 'Courier New', monospace;
  font-size: 0.95em;
}

.message-text.frm img {
    width: 100%;
}
.message-user {
  width: 150px;
  text-align: center;
}
.avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-bottom: 8px;
}
.username {
  font-weight: bold;
  color: #0077cc;
  text-decoration: none;
}
.user-role {
  font-size: 13px;
  color: #999;
}

.message-content {
  flex: 1;
}
.message-meta {
  font-size: 13px;
  color: #999;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}
.message-date {
  color: #888;
  text-decoration: none;
}
.message-id {
  font-weight: bold;
}
.message-text p {
  font-size: 15px;
  color: #333;
}
.message-signature {
  margin-top: 12px;
  font-size: 13px;
  color: #777;
}
.message-signature hr {
  border: none;
  border-top: 1px solid #eee;
  margin-bottom: 6px;
}
.message-actions {
  margin-top: 10px;
  font-size: 13px;
  color: #666;
}
.message-actions .action-link {
  color: #0077cc;
  text-decoration: none;
  margin-right: 8px;
}
.message-actions .action-link:hover {
  text-decoration: underline;
}
.message.answer-message {
    margin: 25px 10px;
}
.message-user {
  width: 120px;
  text-align: center;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
      margin: 0 auto;
  margin-bottom: 10px;
}

.username {
  font-weight: bold;
  color: #333;
  display: block;
  margin-bottom: 4px;
  text-decoration: none;
}

.user-role {
  font-size: 0.85rem;
  color: #ffffff;
}

.message-content {
  flex-grow: 1;
}

.message-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 10px;
}


.message-text p {
    margin: 0 10px;
    color: #3e3e3e;
    font-size: 16px;
}
.message-signature {
  font-size: 0.8rem;
  color: #999;
  margin: 25px 10px;
}

.message-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}


.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 30px 0;
}
.page-link {
  padding: 6px 12px;
  background: #f1f1f1;
  color: #333;
  border-radius: 4px;
  text-decoration: none;
}
.page-link.active {
  background: var(--main);
  color: white;
}
.page-link:hover {
  background: #0077cc;
  color: white;
}
.page-ellipsis {
  padding: 6px 12px;
  color: #888;
}

.reply-bar {
  text-align: center;
  margin-bottom: 30px;
}
.reply-bar .btn-reply {
  background: #28a745;
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.reply-bar .btn-reply:hover {
  background: #1e7e34;
}

.register-notice {
  background: #fff3cd;
  color: #856404;
  padding: 14px 18px;
  border: 1px solid #ffeeba;
  border-radius: 6px;
  margin-top: 40px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.register-notice .icon {
  width: 20px;
  height: 20px;
  fill: #856404;
}
.register-notice a {
  color: #0077cc;
  text-decoration: underline;
}
.comment-user .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.comment-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.comment-textarea {
  width: 95% !important;
  padding: 12px;
  font-size: 15px;
  resize: vertical;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  min-height: 120px;
  margin-bottom: 10px;
}

.comment-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
  color: #666;
}

.toolbar-left {
  display: flex;
  gap: 6px;
}
.toolbar-btn {
  padding: 6px 10px;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}
.toolbar-btn:hover {
  background: #e0e0e0;
}

.char-count {
  font-size: 13px;
  color: #999;
}

.comment-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.btn-submit {
  background: #28a745;
  color: white;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}
.btn-submit:hover {
  background: #218838;
}

.btn-cancel {
  background: #f8f9fa;
  color: #333;
  padding: 10px 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
}
.btn-cancel:hover {
  background: #e2e6ea;
}

.forum-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-family: sans-serif;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-icon {
  flex-shrink: 0;
}

.custom-select-wrapper {
  position: relative;
  max-width: 300px;
  user-select: none;
  cursor: pointer;
}
.custom-select {
  border: 1px solid #ccc;
  padding: 8px 12px;
  background: white;
  border-radius: 4px;
}
.custom-select__selected {
      width: 100%;
  min-height: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.custom-select__arrow {
  display: inline-block;
  width: 0; 
  height: 0; 
  margin-left: 10px;
  vertical-align: middle;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #333;
  transition: transform 0.3s ease;
}
.custom-select-wrapper[aria-expanded="true"] .custom-select__arrow {
  transform: rotate(180deg);
}

.custom-select__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 400px;
  overflow-y: auto;
  background: white;
  border: 1px solid #ccc;
  border-top: none;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.custom-select__group {
  padding: 6px 0;
}
.custom-select__group-label {
  font-weight: bold;
  padding: 6px 12px;
  background: #f0f0f0;
  border-bottom: 1px solid #ddd;
}
.custom-select__option {
  padding: 6px 12px;
}
.custom-select__option:hover,
.custom-select__option.selected {
  background: #784ba0;
  color: white;
}
.pagination.frm button {
    font-size: 12px;
}
.pagination.frm a {
    font-size: 12px;
}
.pagination.frm {
    justify-content: flex-end;
}
.fstat-top {
  padding: 0 0 10px 0;
    border-bottom: 1px solid #e4e4e4;
}
.fstats-elem {
  display: inline-block;
}
.fstats-elem.first {
  margin-right:10px;
}
/**FORUM END**/
.comment-form-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-form:hover {
    border-color: #cbd5e0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.comment-user {
    flex-shrink: 0;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e2e8f0;
    transition: border-color 0.3s ease;
}

.avatar:hover {
    border-color: #3b82f6;
}

.comment-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.textarea-container {
    position: relative;
}

.comment-textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.3s ease;
    background: #fff;
}

.comment-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment-textarea::placeholder {
    color: #9ca3af;
}

.char-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 12px;
    color: #6b7280;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.comment-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-btn {
    background: none;
    border: none;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #4b5563;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.toolbar-btn:hover {
    background: #e2e8f0;
    color: #1f2937;
    transform: translateY(-1px);
}

.toolbar-btn:active {
    transform: translateY(0);
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background: #d1d5db;
    margin: 0 8px;
}

.toolbar-right {
    display: flex;
    align-items: center;
}

.markdown-hint {
    font-size: 12px;
    color: #6b7280;
    background: #e0e7ff;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #c7d2fe;
}

.image-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-top: 8px;
}

.image-preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #4b5563;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    background: #f3f4f6;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.image-item:hover .image-remove {
    opacity: 1;
}

.image-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 6px;
    font-size: 10px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comment-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 8px;
}

.actions-left {
    display: flex;
    gap: 12px;
}

.btn-submit {
    background: linear-gradient(135deg, #784ba0 0%, #8642c2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-submit:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-cancel {
    background: #f8fafc;
    color: #4b5563;
    border: 1px solid #e2e8f0;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: #f1f5f9;
    border-color: #cbd5e0;
}

.actions-right {
    display: flex;
    align-items: center;
}

.keyboard-hint {
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
}

kbd {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-family: monospace;
    color: #374151;
}

.help-card {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 16px;
}

.help-card h3 {
    color: #1e40af;
    margin-bottom: 12px;
    font-size: 16px;
}

.help-card ul {
    list-style: none;
    color: #1e40af;
    font-size: 14px;
}

.help-card li {
    margin-bottom: 4px;
}

.help-card code {
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 12px;
}

/* Adaptive */
@media (max-width: 768px) {
    .comment-form {
        flex-direction: column;
        gap: 12px;
    }
    
    .avatar {
        width: 40px;
        height: 40px;
        align-self: flex-start;
    }
    
    .comment-toolbar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .toolbar-left {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .comment-actions {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .actions-left {
        justify-content: center;
    }
    
    .keyboard-hint {
        justify-content: center;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.image-preview {
    animation: fadeIn 0.3s ease;
}

.image-item {
    animation: fadeIn 0.3s ease;
}

/* Download status */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading .btn-submit {
    background: #9ca3af;
    cursor: not-allowed;
}

.loading .btn-submit::before {
    content: "⏳";
    margin-right: 8px;
}

/* Validation */ 
.preview {
      margin-top: 15px;
      max-width: 300px;
      max-height: 300px;
      display: block;
      border: 1px solid #ccc;
      padding: 5px;
    }
    input[type="file"] {
      display: none;
    }
    label {
      cursor: pointer;
      display: inline-block;
    }

.comment-textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}
  .attach-img-preview {
      margin-top: 15px;
      max-width: 300px;
      max-height: 300px;
      display: block;
      border: 1px solid #ccc;
      padding: 5px;
    }
   .attach-img-preview input[type="file"] {
      display: none;
    }
   .attach-img-preview label {
      cursor: pointer;
      display: inline-block;
    }
 .attach-img-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }

  .attach-img-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
  }

  .attach-img-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid #ccc;
    border-radius: 8px;
  }

  .attach-img-remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
  }
  .attach-img-remove-all-btn {
  background: #ef4444;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 10px;
  transition: background-color 0.3s ease;
}

.attach-img-remove-all-btn:hover {
  background: #dc2626;
}
div#editor {
    flex: 100% 1 1;
    width: 100%;
    margin: 0 0 0 25px;
}
.indx-forum-section {
  flex: 30%;
  background: #fff;
  border-radius: 12px;
  padding: 24px 30px;
  max-width: 480px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #2c2c2c;
  text-align: center;
}

.indx-forum-section__title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #666666;
  border-bottom: 3px solid #784ba0;
  padding-bottom: 8px;
}

.indx-forum-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.indx-forum-list__item {
    padding: 14px 0;
    border-bottom: 1px solid #e3e3e3;
    transition: background-color 0.3s ease;
    border: 1px solid #dcdcdc;
    border-radius: 10px;
    margin: 10px 0;
}

.indx-forum-list__item:hover {
  background-color: #f9f0ff;
  cursor: pointer;
}

.indx-forum-list__link {
  font-size: 1rem;
  color: #4a2361;
  text-decoration: none;
  transition: color 0.3s ease;
}

.indx-forum-list__link:hover {
  color: #784ba0;
  text-decoration: underline;
}

.indx-forum-list__meta {
  font-size: 0.85rem;
  color: #666;
  display: block;
  margin-top: 6px;
  line-height: 1.3;
}

.indx-forum-list__author {
  color: #7a4fa3;
  font-weight: 700;
}

.indx-forum-list__replies {
  background: #784ba0;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 12px;
  vertical-align: middle;
  display: inline-block;
}
.indx-latest-posts {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  margin-bottom: 24px;
}

.indx-latest-posts__title {
  color: #1f2937;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #3b82f6;
}

.indx-latest-posts__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.indx-post-item {
  background: #f9fafb;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.indx-post-item:hover {
  background: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.indx-post-link {
  color: #1f2937;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.5;
  display: block;
  margin-bottom: 12px;
  transition: color 0.2s ease;
}

.indx-post-link:hover {
  color: #3b82f6;
}

.indx-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 10px;
  font-size: 0.875rem;
  color: #6b7280;
}

.indx-post-author {
  display: flex;
  align-items: center;
  gap: 4px;
}

.indx-post-author strong {
  color: #374151;
  font-weight: 600;
}

.indx-post-time {
  color: #6b7280;
  font-weight: 500;
}

.indx-post-topic {
  font-size: 0.875rem;
  color: #6b7280;
  padding: 8px 12px;
  background: #f3f4f6;
  border-radius: 6px;
  border-left: 3px solid #d1d5db;
}

.indx-post-topic-link {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.indx-post-topic-link:hover {
  color: #1d4ed8;
}

/* Responsive Design */
@media (max-width: 768px) {
  .indx-latest-posts {
    padding: 16px;
    border-radius: 8px;
  }
  
  .indx-latest-posts__title {
    font-size: 1.25rem;
    margin-bottom: 16px;
  }
  
  .indx-post-item {
    padding: 12px;
  }
  
  .indx-post-link {
    font-size: 1rem;
    margin-bottom: 10px;
  }
  
  .indx-post-meta {
    flex-direction: column;
    gap: 8px;
  }
  
  .indx-post-topic {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}

/* Modal window */
.forum-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;

  justify-content: center;
  align-items: center;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.forum-modal.show {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

/* Modal window content */
.forum-modal-content {
  position: relative;
  background: #fff;
  border-radius: 8px;
  padding: 20px 25px;
  width: 400px;
  max-width: 90%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  font-family: Arial, sans-serif;
}

/* Spacing between groups of fields */
.forum-form-group {
  margin-bottom: 15px;
}

/* Tags */
.forum-form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #333;
}

/* Input fields and textarea */
.forum-form-group input[type="text"],
.forum-form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
  font-family: inherit;
}

/* Buttons */
.forum-form-buttons {
  text-align: right;
}

.forum-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  transition: background-color 0.2s ease;
}

.forum-btn-primary {
  background-color: #007bff;
  color: white;
}

.forum-btn-primary:hover {
  background-color: #0056b3;
}

.forum-btn-secondary {
  background-color: #6c757d;
  color: white;
  margin-right: 8px;
}

.forum-btn-secondary:hover {
  background-color: #565e64;
}

.forum-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #333;
    font-weight: bold;
    padding: 0;
    user-select: none;
    transition: color 0.2s ease;
}

.forum-close-btn:hover {
  color: #007bff;
}