.common-button-wrapper {
  display: inline-block;
  position: relative;
}

/* Base button */
.common-button {
  border: none;
  border-radius: 4px !important;
  height: 35px;
  min-width: fit-content;
  justify-content: center;
  font-size: 15px;
  padding: 6px 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background-color: var(--text-color, #000);
  color: var(--text-color, #000);
}

/* Hover and focus */
.common-button:focus-visible, .danger:focus-visible {
  outline: 2px solid var(--focus-color, #0B6F85) !important;
  outline-offset: 3px !important;
}

.common-button:active:not(:disabled) {
  background-color: var(--pressed-color, #311C56);
  color: var(--pressed-icon-color, #fff);
}

.common-button.primary:active:not(:disabled) {
  background-color: var(--pressed-color, #311C56);
  color: var(--pressed-icon-color, #fff);
}

.common-button.secondary:active:not(:disabled) {
  background-color: var(--pressed-color, #095D70);
  color: var(--pressed-icon-color, #fff);
}

.common-button.danger:active:not(:disabled) {
  background-color: var(--pressed-color, #B40030);
  color: var(--pressed-icon-color, #fff);
}

.common-button.primary:disabled{
	background-color: var(--disabled-color, #ECEAF0) !important;
	color: #6A6A6A !important;
	border: none !important;
}

.common-button.icon:disabled{
	background-color: var(--disabled-color, #ECEAF0) !important;
	color: #FFFFFF !important;
	border: none !important;
}

.common-button.icon-text:disabled{
	background-color: var(--disabled-color, #ECEAF0) !important;
	color: #6A6A6A !important;
	border: none !important;
}

.common-button:disabled{
	background-color: var(--disabled-color, #ECEAF0) !important;
	color: #6A6A6A !important;
	border: none !important;
}

.common-button.danger:disabled{
	background-color: var(--disabled-color, #F8F0F2) !important;
	color: #6A6A6A !important;
	border: none !important;
}

.common-button.secondary:disabled{
	background-color: var(--disabled-color, #EBF2F3) !important;
	color: #6A6A6A !important;
	border: none !important;
}

.common-button.secondary:hover:not(:disabled), .common-button.secondary:focus:not(:disabled) {
  background-color: var(--hover-color, #0B6F85) !important;
  color: var(--hover-icon-color, #fff) !important;
}

.common-button:hover:not(:disabled), .common-button:focus:not(:disabled) {
  background-color: var(--hover-color, #42296E) !important;
  color: var(--hover-icon-color, #fff) !important;
}

.common-button.icon{
	background-color: unset !important;
}

.common-button.icon:focus:not(:disabled) {
	background-color: var(--hover-color, #ffffff) !important;
  	color: var(--hover-icon-color, #42296E) !important;
}
	
.common-button.icon:hover:not(:disabled){
  background-color: var(--hover-color, #ECECEC) !important;
  color: var(--hover-icon-color, #42296E) !important;
}

.common-button.danger:hover:not(:disabled), .common-button.danger:focus:not(:disabled) {
  background-color: var(--hover-color, #d32f2f) !important;
}

.danger:disabled {
  background-color: var(--disabled-color, #F8F0F2) !important;
  color: #6A6A6A !important;
  cursor: not-allowed;
}

.common-button:disabled {
  background-color: var(--disabled-color, #ccc) !important;
  color: #aaa !important;
  cursor: not-allowed;
}

/* Icon image */
.icon-img {
  width: 24px;
  height: 24px;
  transition: filter 0.2s ease;
}

.common-button:not([disabled]).primary:hover .icon-img, .common-button:not([disabled]).primary:focus .icon-img ,
	.common-button:not([disabled]).secondary:hover .icon-img, .common-button:not([disabled]).secondary:focus .icon-img,
	.common-button:not([disabled]).icon-text:hover .icon-img, .common-button:not([disabled]).icon-text:focus .icon-img,
	.common-button:not([disabled]).danger:hover .icon-img, .common-button:not([disabled]).danger:focus .icon-img { 
  filter: brightness(0) saturate(100%) invert(1);
}

/* Tooltip */
.common-button .tooltip {
  visibility: hidden;
  opacity: 0;
  background-color: #333;
  color: #fff;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  overflow: visible !important;
  transition: opacity 0.2s ease;
  min-width: 120px;
  word-wrap: break-word;
  text-wrap: auto;
  z-index: 10;
  text-align: center;
}

.common-button:hover .tooltip,
.common-button:focus .tooltip {
  visibility: visible;
  opacity: 1;
}

.common-button .tooltip::before {
  content: "";
  position: absolute;
  bottom: -18px; /* stick below the tooltip box */
  left: 50%;
  transform: translateX(-50%);
  border-width: 10px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
  width: 0;
  height: 0;
}

/* Variants */
.common-button.primary {
	border: 2px solid var(--btn-default-color,#42296E) !important;
    background-color: #fff;
    color: #42296E !important;
}

.common-button.secondary {
	border: 2px solid var(--hover-color,#0B6F85) !important;
    background-color: #fff;
    color: #0B6F85 !important;
}

.common-button.danger {
	border: 2px solid var(--hover-color,#B40030) !important;
    background-color: #fff;
    color: #B40030 !important;
}
.common-button.icon-text {
  border: 2px solid var(--btn-default-color,#42296E) !important;
  background: var(--btn-default-background-color, #FFF) !important;;
  color: #42296E;
}

.common-button.icon {
  padding: 0;
  width: 40px;
  height: 40px;
  justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
  .common-button {
    padding: 0 10px;
  }
}

@media (max-width: 480px) {
  .common-button {
    padding: 0 8px;
  }

  .common-button .tooltip {
    padding: 4px 8px;
  }
}
@media screen and (max-width: 768px) {
  .common-button .collapse-on-mobile {
    display: none !important;
  }
}
@media screen and (min-width: 1000px) and (max-width: 1300px) {
  .common-button .collapse-on-mobile {
    display: none !important;
  }
}
.text-mobile-only {
  display: none;
}
.text-desktop-only {
  display: inline;
}

@media screen and (max-width: 768px) {
  .text-desktop-only {
    display: none !important;
  }
  .text-mobile-only {
    display: inline;
  }
}
.common-button-text{
	white-space: nowrap;
}

.darkModePrimary.primary.common-button, .darkModePrimary.secondary.common-button{
	border: none !important;
	color: #FFFFFF !important;
	background-color: #0B778F !important;
}

.darkModePrimary.primary.common-button:hover, .darkModePrimary.primary.common-button:focus,
.darkModePrimary.secondary.common-button:hover, .darkModePrimary.secondary.common-button:focus{
	border: none !important;
	color: #FFFFFF !important;
	background-color: #0B778F !important;
}