/* Scrollbars */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 5px;
  border: 2px solid #1e1e1e;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #888;
}

* {
  scrollbar-color: #555 #1e1e1e;
  scrollbar-width: thin;
}

html, body {
  height: 100%;
  background-color: #121212;
  color: white;
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  overflow: hidden;
}



body {
  display: flex;
  flex-direction: column;
}

.navbar-custom {
  min-height: 68px;
}

.navbar-item svg {
  vertical-align: middle;
}

.navbar-brand img {
  max-height: 40px;
  height: 40px;
}


.navbar-end {
  margin-left: auto;
  display: flex;
  align-items: center;
}


.navbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.section {
  flex-grow: 1;
  padding: 1.5rem;
  /*overflow-y: scroll;*/
  display:flex;
  justify-content:center;
}

.profile-button {
  background-color: #3273dc;
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-weight: bold;
  font-size: 16px;
  margin-left: 1rem;
  cursor: pointer;
}


/* ===== КОНТЕНТ ===== */
.container {
  max-width: 900px;
  margin: 0 auto;

}

.solution-item {
  /* background-color: #1e1e1e; */
  border: 1px solid #333;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.solution-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.author-icon {
  font-size: 1.4rem;
  color: white;
  background-color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border: 1px solid #4a4a4a;
  padding: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.author-icon img {
  border-radius: 50%;
  width: 100%;
  height: 100%;
  /*object-fit: cover;*/
}

.solution-title {
  font-weight: 600;
  color: #4ea3ff;
  font-size: 1.1rem;
  text-decoration: none;
}

.solution-title:hover {
  text-decoration: underline;
}

.solution-description {
  font-size: 0.95rem;
  color: #ccc;
  margin-bottom: 0.6rem;
  text-align: justify;
}

.solution-tags {
  margin-bottom: 0.6rem;
}

.solution-tags a {
  color: #ccc;
}

.solution-tags .tag {
  margin-right: 0.4rem;
  margin-bottom: 0.3rem;
}

.solution-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #ccc;
}

.component-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.component-tag {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 500;
}

.dot {
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
}

/* Цвета компонентов */
.logic .dot {
  background-color: #00d1b2;
  margin-right: 10px;
}
.handlers .dot {
  background-color: #3273dc;
  margin-right: 10px;
}
.roles .dot {
  background-color: #ff3860;
  margin-right: 10px;
}
.dashboards .dot {
  background-color: #ffdd57;
  margin-right: 10px;
}
.models .dot {
  background-color: #b86bff;
  margin-right: 10px;
}
.reports .dot {
  background-color: #48c774;
  margin-right: 10px;
}
.geofences .dot {
  background-color: #ff851b;
  margin-right: 10px;
}


.logic li span {
  color: #00d1b2;
}
.handlers li span {
  color: #3273dc;
}
.roles li span {
  color: #ff3860;
}
.dashboards li span {
  color: #ffdd57;
}
.models li span {
  color: #b86bff;
}
.reports li span {
  color: #48c774;
}
.geofences li span {
  color: #ff851b;
}


.logic .panel-icon {
  color: #00d1b2;
}
.handlers .panel-icon {
  color: #3273dc;
}
.roles .panel-icon {
  color: #ff3860;
}
.dashboards .panel-icon {
  color: #ffdd57;
}
.models .panel-icon {
  color: #b86bff;
}
.reports .panel-icon {
  color: #48c774;
}
.geofences .panel-icon {
  color: #ff851b;
}

.meta-info {
  display: flex;
  gap: 0.2rem;
  white-space: nowrap;
}

.meta-info i {
  margin-right: 0.4rem;
  color: #aaa;
}

.item-meta-right span {
    font-weight: bold;
}




/* =========================================
            SOLUTION
   ========================================= */

.solution-layout {
  height: 100vh;
  overflow: auto;
}

.content-area {
  padding: 1.5rem;
}

.meta-panel {
  padding: 1.5 rem;
  
}

.meta-panel .meta-panel-content {
  padding-top: 40px;
  padding-bottom: 40px;
  padding-left: 5px;
  width: 90%;
}

.markdown-box {
  border: 1px solid #2a2a2a;
  padding: 1.5rem;
  color: #e0e0e0;
}

.markdown-box h1, .markdown-box h2, .markdown-box h3 {
  color: #ffffff;
  margin-top: 1.25rem;
}

.markdown-box p {
  margin-bottom: 1rem;
}

.bordered-box {
  border: 1px solid #2a2a2a;
  /*background-color: #181818;*/
}

.content h1, .content h2, .content h3,
.content p, .content ul, .content ol, .content li {
  color: #e0e0e0;
}

.content ul {
  list-style: disc inside;
}

.content ol {
  list-style: decimal inside;
}

.content a {
  color: #66b2ff;
}






/* =========================================
            MAIN AREA
   ========================================= */




.markdown-wrapper {
  /*background-color: #1f1f1f;*/
  border: 1px solid #333;
  border-radius: 8px;
  padding: 0;
}

.tabs ul {
  /*background-color: #2b2b2b;*/
  border-bottom: 1px solid #444;
  margin-left: -1px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.tabs li a {
  color: #ddd;
}

.tabs li.is-active a {
  background-color: #3a3a3a;
  color: white;
  border-color: #444;
}

.tab-content {
  padding: 1.5rem;
}

.tab-pane {
  display: none;
}

.tab-pane.is-active {
  display: block;
}

.markdown-content h1, .markdown-content h2 {
  color: white;
}

.markdown-content p, .markdown-content li {
  color: #ccc;
}

.markdown-content ul {
  margin-left: 1.5rem;
  list-style: disc;
}


/* =========================================
            TAGS
   ========================================= */

/* Базовый стиль для всех тегов */
.tag-type {
  /*display: inline-block;*/
  display: inline-flex;
  align-items: center;

  padding: 2px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  margin: 4px;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
  cursor: default;
  align-items: center;
}

/* Отрасли — оттенки красного, близкие к bulma is-danger */
.tag-industry {
  background-color: #6c2626; /* темный красный */
  color: #f8d7da;
}
.tag-industry:hover {
  background-color: #a03939; /* более яркий красный */
  color: #fff;
}

/* Бизнес — мягкий зеленый (похож на bulma is-success) */
.tag-value {
  background-color: #2a5a37;
  color: #c8e6c9;
}
.tag-value:hover {
  background-color: #3c8a52;
  color: #fff;
}

/* Оборудование — глубокий синий (похож на bulma is-info) */
.tag-hardware {
  background-color: #25476a;
  color: #b8d1f9;
}
.tag-hardware:hover {
  background-color: #3169a8;
  color: #fff;
}

/* Протоколы — мягкий фиолетовый (в духе bulma is-primary но чуть темнее) */
.tag-protocol {
  background-color: #4a3c69;
  color: #d8cbf9;
}
.tag-protocol:hover {
  background-color: #644f99;
  color: #fff;
}

.tag-button {
  display: inline-block;
  /*margin-top: 4px !important;*/
}



/*   SOLUTION */


.entities-list {
  width: 100%;
}

.entities-list li {
  height: auto;
  display:block; 
  border-bottom-color: #1e1e1e;
  border-bottom-style: solid;
  border-bottom-width: 1px;
  align-items: center;
  padding-left: 5px;
  padding-right: 5px;
}

.entities-list .name {
  font-size: 14px;
  text-align: left;
}

.component-tag .logic {
  font-size: 16px;
  text-align: left;
}




.entities-list li:hover {
  background-color: #2a2a2a;
}

.entities-list li:last-child {
  border-bottom-width: 0px;
}

.solution-downloads-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.solution-downloads-info-item {
  display: flex;
  align-items: center;
  font-size: 14px;
  gap: 2px;
}


.card-with-edit {
  position: relative; /* чтобы кнопка позиционировалась относительно блока */
}



.edit-btn {
  position: absolute;
  top: 90px;
  right: 65px;
  display: none; /* скрыта по умолчанию */
  border-radius: 8px;
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  align-items: center;
}

.card-with-edit:hover .edit-btn {
  display: flex; /* появляется при наведении */
}

.logic .description,
.handlers .description,
.roles .description,
.dashboards .description,
.models .description,
.reports .description,
.geofences .description {
  font-size: 12px;
  text-align: justify;
}



/* =========================================
            FORMS
   ========================================= */ 

#uploadedFiles li {
  padding: 0.5rem 1rem;
}

.file-name {
  flex: 1;
  text-align: center;
  font-weight: 100;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0 0.5rem;
}

.copy-btn, .delete-btn {
  flex-shrink: 0;
}

.CodeMirror.is-danger {
  border: 1px solid #ff3860;
}

.CodeMirror,
.EasyMDEContainer,
.editor-toolbar {
  border: none !important;
}

/* Fix EasyMDE preview icon */
.easymde-toolbar a.preview.active:before {
  content: '\f040'; /* fa-pencil-alt */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
}

.easymde-toolbar a.preview:before {
  content: '\f06e'; /* fa-eye */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
}

.easymde-toolbar a.preview i {
  display: none;
}

.editor-preview {
  background-color: #121212 !important;
  color: white; /* Ensure text is visible on black background */
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.is-invalid {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}


.solution-page-layout {
  margin-bottom: 0px;
  padding-top: 20px;
  display: flex;
  justify-content: center;
  overflow-y: auto;
  flex: 1;
  height: calc(100vh - 80px);
}

.solutions-container {
  max-width: 80%;
  width: 100%;
}

.pagination-container {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* New classes for inline style refactoring */
.auth-card--no-style {
  background: none;
  box-shadow: none;
  border: none;
}

.progress-container-custom {
  height: 6px;
  background: #333;
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.progress-bar-custom {
  height: 6px;
  width: 0%;
  background: #00b894;
  transition: width .3s;
}

.control--relative {
  position: relative;
}

.input--padded-right {
  padding-right: 2.5rem;
}

.icon--password-toggle {
  cursor: pointer;
  z-index: 2;
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: all;
}

.section--full-height-center {
  min-height: 80vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card--verify {
  max-width: 420px;
  width: 100%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-radius: 1rem;
}

.icon--large {
  font-size: 3rem;
}

.text--large {
  font-size: 20px;
}

.solution-description--italic {
  text-align: left;
  font-style: italic;
}

.select--full-width-margin {
  width: 100%;
  margin-top: 10px;
}

.select-control--full-width {
  width: 100%;
}

.navbar-brand--padded-left {
  padding-left: 20px;
}

.input--search-width {
  width: 300px;
}

.main--scrollable-content {
  height: calc(100vh - 80px);
  overflow-y: auto;
  overflow-x: hidden;
}

.main-content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

.section--centered-padded-top {
  display: flex;
  justify-content: center;
  padding-top: 2rem;
}

.profile-box--no-style {
  max-width: 450px;
  width: 100%;
  background: none;
  border: none;
  box-shadow: none;
}

.avatar-label {
  cursor: pointer;
  display: inline-block;
  position: relative;
}

.input--hidden {
  display: none;
}

.form-error--hidden-center {
  display: none;
  text-align: center;
  margin-top: 0.5rem;
}

.section--padded-full-width {
  padding-left: 20px;
  padding-right: 20px;
  width: 100%;
}

.solution-card--flex-column {
  height: 100%;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-content--flex-column-full-height {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.level--flex-start-wrap {
  align-items: flex-start;
  flex-wrap: wrap;
}

.level-left--flex-grow {
  flex: 1;
  min-width: 0;
}

.title--ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.link--white {
  color: #fff;
}

.level-right--margin-left {
  margin-left: 0.5rem;
}

.subtitle--multiline-ellipsis {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.level--auto-margin-top-border {
  margin-top: auto;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.markdown-wrapper--no-shadow {
  box-shadow: none !important;
}

.markdown-content--min-height-hidden {
  min-height: 300px;
  display: none;
}

.file-label--full-width {
  width: 100%;
}

.file-cta--full-width-center {
  width: 100%;
  align-items: center;
}

.textarea--min-height-no-max {
  min-height: 300px;
  max-height: none;
}

.component-tag--hidden {
  display: none;
}

.entities-list--hidden {
  display: none;
}

.select--full-width-margin-bottom {
  width: 100%;
  margin-bottom: 10px;
}

.field--fixed-height {
  height: 40px;
}

.field--full-width {
  width: 100%;
}

.dropdown--full-width {
  width: 100%;
}

.section--flex-center {
  display: flex;
  justify-content: center;
}

.card-with-edit--responsive {
  max-width: 80%;
  width: 100%;
}

@media screen and (max-width: 768px) {
  .card-with-edit--responsive {
    width: 100%;
    max-width: 100%;
  }
}

.section--flex-center {
  display: flex;
  justify-content: center;
}

.card-with-edit--responsive {
  max-width: 80%;
  width: 100%;
}

.solution-page-layout--no-scrollbar {
  scrollbar-width: none;
}

.footer--no-style {
  background: none;
  padding: 0rem 0;
}

.footer-content--small-gray {
  color: gray;
  font-size: x-small;
  padding: 0.5rem 0;
}

@media screen and (max-width: 1023px) {
  .navbar-menu {
    display: none;
    position: absolute;
    width: 100%;
    /*background-color: var(--background-secondary);*/
    left: 0;
    top: 100%;
  }

  .navbar-menu.is-active {
    display: block;
  }

  .navbar-burger {
    display: block;
    color: var(--text-primary);
  }

  .navbar-item--mobile-profile .author-icon {
    display: block;
    width: 36px;
    height: 36px;
  }
}

@media screen and (max-width: 768px) {
  .content-wrapper--mobile-padding {
    padding-left: 10px;
    padding-right: 10px;
  }

  .solution-page-layout {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
  }

  .solution-page-layout > .column {
    width: 100%;
  }

  .card-with-edit--responsive {
    width: 100%;
    max-width: 100%;
  }

}
