@import url(./vars.css);

button {
  border: none;
  padding: 10px 20px;
  border-radius: var(--border-radius-default);
  font-size: var(--font-size-default);
  line-height: var(--line-height-default);
  cursor: pointer;
}

.custom-select {
  position: relative;
  display: inline-block;
  font-family: var(--font-default);
  font-size: var(--font-size-controls);
  line-height: calc(var(--font-size-controls) * 1.2);
  color: var(--text-color-default);
  min-width: 150px;
  border-radius: var(--border-radius-default);
  border: 1px solid var(--border-color);
  overflow: visible;
  width: -webkit-fill-available;
}
.select-trigger {
  font-size: var(--font-size-controls);
  line-height: calc(var(--font-size-controls) * 1.2);
  display: flex;
  justify-content: space-between;
  border-radius: var(--border-radius-default);
  align-items: center;
  background-color: var(--bg-accent);
  color: inherit;
  min-height: var(--input-size);
  padding: 0 12px;
  cursor: pointer;
  min-width: 150px;
  width: -webkit-fill-available;
}
.select-options {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: var(--bg-default);
  color: var(--text-color-default);
  margin: 0;
  margin-top: 12px;
  padding: 0;
  list-style: none;
  transform: translateY(-10px);
  transition: all 0.3s ease; 
  z-index: 1000;
  border-radius: var(--border-radius-default);
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
}
.selected-option {
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 130px;
  overflow: hidden;
  width: auto;
  user-select: none;
}
.select-options .option {
  background-color: var(--bg-accent);
  padding: 0 20px;
  height: var(--input-size);
  display: flex;
  align-items: center;
  cursor: pointer;
}
.select-options .no-data {
  background-color: var(--bg-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
}
.select-options .option:hover {
  background-color: var(--border-color);
}
.custom-select.active .select-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.custom-select .icon {
  color: var(--text-color-default);
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
}
.custom-select .icon-placeholder {
  color: var(--text-color-placeholder);
}

.arrow {
  margin-left: 4px;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
  border-radius: var(--border-radius-sm);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--border-radius-sm);
}
::-webkit-scrollbar-corner {
  background: transparent;
}

.section {
  font-family: 'system-ui';
  min-height: 280px;
  background: var(--bg-default);
}

textarea {
  resize: vertical; /* lock horizontal resize, allow vertical resize */
}

.section-content {
  display: flex;
  width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  gap: 12px;
}

.widget {
  font-family: 'system-ui';
  position: fixed;
  padding-top: 12px;
  bottom: 70px;
  right: 20px;
  width: 100%;
  max-width: 300px;
  height: 80vh;
  max-height: 600px;
  background: var(--bg-default);
  border-radius: var(--border-radius-default);
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.widget-content {
  overflow-y: auto;
  gap: 12px;
  height: calc(100% - 88px);
}

.save-button {
  background-color: var(--primary);
  color: var(--text-color-button);
  min-width: 300px;
}

.save-button-text {
  color: var(--text-color-button);
}

.input-label {
  display: block;
  color: var(--text-color-default);
  font-size: var(--font-size-default);
  line-height: var(--line-height-default);
  margin-bottom: 8px;
}
.input {
  width: -webkit-fill-available;
  background-color: var(--bg-accent);
  border: 1px solid var(--border-color);
  box-sizing: border-box;
  border-radius: var(--border-radius-default);
  color: var(--text-color-default);
  padding: 0px 12px;
  min-height: var(--input-size);
  font-family: var(--font-default);
  font-size: var(--font-size-controls);
  line-height: calc(var(--font-size-controls) * 1.2);
  outline: none;
}

::-webkit-calendar-picker-indicator {
  filter: var(--calendar-icon-invert);
}

.input-error {
  border: 1px solid var(--danger);
}
input::placeholder, input[type="date"]::placeholder, textarea::placeholder {
  color: var(--text-color-placeholder);
}

.text-error {
    color: var(--danger);
}

.text-disabled {
    color: var(--text-color-placeholder);
}

.spinner-container {
  background-color: var(--bg-default);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  min-height: 800px;
}

.spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  vertical-align: text-bottom;
  color: var(--primary);
  border: .25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  -webkit-animation: spinner .75s linear infinite;
  animation: spinner .75s linear infinite;
}


@media (max-width: 768px) {
  .save-button {
    width: 100%;
  }
}

@keyframes spinner {
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}