/* ============================================================
   MQLPro M7.1 — Community Modern UI
   Visual reference: supplied MQLPro Community dashboard image.
   Fully scoped. No global WordPress/Elementor selectors.
   ============================================================ */

.mqlpro-community-page,
.mqlpro-community-page * {
  box-sizing: border-box;
}

.mqlpro-community-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0 0 28px;
  color: #172b4d;
  font-family: inherit;
  background: #f5f8fc;
}

.mqlpro-community-page a {
  color: inherit;
  text-decoration: none;
}

.mqlpro-community-page button,
.mqlpro-community-page input,
.mqlpro-community-page select {
  font: inherit;
}

/* Hero */
.mqlpro-community-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px 24px;
  border: 1px solid #e2eaf4;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fbff 0%, #eef5fd 100%);
  box-shadow: 0 2px 10px rgba(30, 75, 125, .05);
}

.mqlpro-community-hero-copy {
  min-width: 0;
}

.mqlpro-community-eyebrow {
  display: inline-block;
  margin-bottom: 7px;
  color: #2879df;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mqlpro-community-hero h1 {
  margin: 0;
  color: #172b4d;
  font-size: 31px;
  line-height: 1.15;
  font-weight: 700;
}

.mqlpro-community-hero p {
  margin: 7px 0 0;
  color: #627895;
  font-size: 13px;
  line-height: 1.5;
}

.mqlpro-community-primary {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 10px 17px;
  border: 1px solid #1675e8;
  border-radius: 6px;
  background: #1675e8;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(22, 117, 232, .18);
}

.mqlpro-community-primary:hover {
  background: #0f67d1;
  border-color: #0f67d1;
}

.mqlpro-community-primary span {
  font-size: 18px;
  line-height: 1;
}

/* Filter bar */
.mqlpro-community-filter-card {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 180px 140px 160px;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 15px;
  border: 1px solid #dfe8f3;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(30, 75, 125, .04);
}

.mqlpro-community-search {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 40px;
  border: 1px solid #d9e3ef;
  border-radius: 5px;
  background: #fff;
}

.mqlpro-community-search-icon {
  flex: 0 0 auto;
  width: 38px;
  color: #6584a8;
  font-size: 23px;
  line-height: 1;
  text-align: center;
}

.mqlpro-community-search input {
  width: 100%;
  min-width: 0;
  height: 38px;
  margin: 0;
  padding: 0 10px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #243b5a;
  font-size: 12px;
}

.mqlpro-community-search input::placeholder {
  color: #91a2b8;
}

.mqlpro-community-filter-card select {
  width: 100%;
  min-width: 0;
  height: 40px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid #d9e3ef;
  border-radius: 5px;
  background: #fff;
  color: #385271;
  font-size: 12px;
  outline: none;
}

/* Main two-column body */
.mqlpro-community-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.mqlpro-community-discussions,
.mqlpro-community-side-card {
  min-width: 0;
  border: 1px solid #dfe8f3;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(30, 75, 125, .04);
}

.mqlpro-community-panel-head,
.mqlpro-community-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 15px 18px;
  border-bottom: 1px solid #e7edf5;
}

.mqlpro-community-panel-head > div,
.mqlpro-community-side-head {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}

.mqlpro-community-panel-head h2,
.mqlpro-community-side-head h2 {
  margin: 0;
  color: #1d3557;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 650;
}

.mqlpro-community-panel-head > a {
  flex: 0 0 auto;
  color: #1675e8;
  font-size: 11px;
  font-weight: 600;
}

.mqlpro-community-section-icon,
.mqlpro-community-side-head .side-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  border-radius: 5px;
  background: #eaf3ff;
  color: #1675e8;
  font-size: 13px;
}

/* Discussion rows */
.mqlpro-community-list {
  padding: 0 18px;
}

.mqlpro-community-discussion {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  min-width: 0;
  padding: 16px 0;
  border-bottom: 1px solid #e8eef5;
}

.mqlpro-community-discussion:last-child {
  border-bottom: 0;
}

.mqlpro-community-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
}

.mqlpro-community-avatar.small {
  flex-basis: 30px;
  width: 30px;
  height: 30px;
  font-size: 9px;
}

.avatar-blue { background: #5b93e8; }
.avatar-green { background: #25b890; }
.avatar-orange { background: #f2a71b; }
.avatar-cyan { background: #13a6ca; }
.avatar-purple { background: #8050df; }

.mqlpro-community-discussion-main {
  min-width: 0;
}

.mqlpro-community-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.mqlpro-community-title-line h3 {
  margin: 0;
  color: #1b3557;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 650;
}

.mqlpro-community-discussion-main p {
  margin: 5px 0 7px;
  color: #69809e;
  font-size: 11px;
  line-height: 1.5;
}

.mqlpro-community-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  color: #7187a2;
  font-size: 10px;
  line-height: 1.3;
}

.mqlpro-community-tag {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 3px 8px;
  border-radius: 11px;
  font-size: 9px;
  line-height: 1.2;
  font-weight: 600;
  white-space: nowrap;
}

.tag-general { background: #eaf3ff; color: #2677d8; }
.tag-trading { background: #e5f8f3; color: #159473; }
.tag-risk { background: #f0e9ff; color: #7650ce; }
.tag-technical { background: #e4f6fb; color: #168aa8; }
.tag-strategy { background: #fff1df; color: #c47b1a; }

.mqlpro-community-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  min-width: 55px;
  padding-top: 4px;
  color: #7a90aa;
  font-size: 10px;
  white-space: nowrap;
}

/* Sidebar */
.mqlpro-community-sidebar {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.mqlpro-community-side-card {
  overflow: hidden;
}

.mqlpro-community-category-list {
  padding: 4px 14px 9px;
}

.mqlpro-community-category-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 15px;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border-bottom: 1px solid #edf1f6;
  color: #415b7b;
  font-size: 11px;
}

.mqlpro-community-category-list a:last-child {
  border-bottom: 0;
}

.mqlpro-community-category-list a > span {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.mqlpro-community-category-list b {
  min-width: 33px;
  padding: 4px 6px;
  border-radius: 11px;
  background: #f1f5f9;
  color: #68809c;
  font-size: 9px;
  font-weight: 600;
  text-align: center;
}

.mqlpro-community-category-list em {
  color: #7890aa;
  font-size: 17px;
  font-style: normal;
  text-align: center;
}

.cat-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  font-style: normal;
  font-size: 10px;
}

.cat-general { background: #eaf3ff; color: #2879df; }
.cat-trading { background: #e6f8ef; color: #20a476; }
.cat-strategy { background: #fff2df; color: #db8a1c; }
.cat-risk { background: #f0e9ff; color: #7b55d3; }
.cat-tech { background: #e2f6fb; color: #148eab; }
.cat-platform { background: #e8efff; color: #3f66d5; }
.cat-other { background: #edf2f7; color: #71839a; }

.mqlpro-community-contributor-list {
  padding: 4px 14px 9px;
}

.mqlpro-community-contributor-list > div {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  border-bottom: 1px solid #edf1f6;
  color: #405978;
  font-size: 11px;
}

.mqlpro-community-contributor-list > div:last-child {
  border-bottom: 0;
}

.mqlpro-community-contributor-list b {
  color: #6f86a0;
  font-size: 9px;
  font-weight: 500;
}

/* Pagination */
.mqlpro-community-pagination {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  padding: 11px 18px 13px;
  border-top: 1px solid #e7edf5;
}

.mqlpro-community-pagination button {
  display: inline-grid;
  place-items: center;
  min-width: 31px;
  height: 31px;
  padding: 0 7px;
  border: 1px solid #dbe5ef;
  border-radius: 5px;
  background: #fff;
  color: #56708e;
  font-size: 11px;
  cursor: pointer;
}

.mqlpro-community-pagination button:hover,
.mqlpro-community-pagination button.is-current {
  border-color: #1675e8;
  background: #1675e8;
  color: #fff;
}

.mqlpro-community-pagination span {
  margin-left: auto;
  color: #7188a2;
  font-size: 10px;
}

/* Footer notice */
.mqlpro-community-disclaimer {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #e1e8f1;
  border-radius: 6px;
  background: #f9fbfd;
  color: #7a8da5;
  font-size: 10px;
  line-height: 1.5;
}

/* Tablet */
@media (max-width: 1050px) {
  .mqlpro-community-filter-card {
    grid-template-columns: minmax(220px, 1fr) 150px 125px;
  }

  .mqlpro-community-filter-card select:last-child {
    grid-column: 1 / -1;
  }

  .mqlpro-community-body {
    grid-template-columns: minmax(0, 1fr) 270px;
  }
}

/* Small tablet / large mobile */
@media (max-width: 820px) {
  .mqlpro-community-hero {
    align-items: flex-start;
    padding: 23px;
  }

  .mqlpro-community-body {
    grid-template-columns: 1fr;
  }

  .mqlpro-community-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 640px) {
  .mqlpro-community-page {
    padding-bottom: 20px;
  }

  .mqlpro-community-hero {
    flex-direction: column;
    gap: 15px;
    padding: 20px;
  }

  .mqlpro-community-hero h1 {
    font-size: 25px;
  }

  .mqlpro-community-primary {
    width: 100%;
  }

  .mqlpro-community-filter-card {
    grid-template-columns: 1fr;
    padding: 11px;
  }

  .mqlpro-community-filter-card select:last-child {
    grid-column: auto;
  }

  .mqlpro-community-body {
    margin-top: 12px;
  }

  .mqlpro-community-sidebar {
    grid-template-columns: 1fr;
  }

  .mqlpro-community-panel-head,
  .mqlpro-community-side-head {
    padding: 13px 14px;
  }

  .mqlpro-community-list {
    padding: 0 14px;
  }

  .mqlpro-community-discussion {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    padding: 14px 0;
  }

  .mqlpro-community-avatar {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
    font-size: 11px;
  }

  .mqlpro-community-stats {
    grid-column: 2;
    flex-direction: row;
    align-items: center;
    padding-top: 0;
    min-width: 0;
  }

  .mqlpro-community-title-line h3 {
    font-size: 12px;
  }

  .mqlpro-community-pagination {
    padding-left: 14px;
    padding-right: 14px;
  }

  .mqlpro-community-pagination span {
    width: 100%;
    margin: 5px 0 0;
  }
}

@media (max-width: 390px) {
  .mqlpro-community-hero {
    padding: 17px;
  }

  .mqlpro-community-filter-card {
    padding: 9px;
  }

  .mqlpro-community-panel-head h2,
  .mqlpro-community-side-head h2 {
    font-size: 14px;
  }

  .mqlpro-community-discussion-main p {
    font-size: 10px;
  }
}
