/* Tools and converter styles */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: auto;
  gap: 1rem
}

.ad-row {
  grid-column: 1/-1;
  display: flex;
  justify-content: center
}

/* Converter spans full width */
.converter {
  grid-column: 1/-1;
  display: flex;
  justify-content: center
}

.converter-card {
  width: 100%;
  background: var(--color-cards);
  border: 1px solid rgba(15, 23, 42, 0.04);
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05)
}

.converter-card h2 {
  margin: 0 0 .75rem
}

/* Instruction box for the unit converter */
.uc-instructions {
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.12);
  padding: .6rem .8rem;
  border-radius: 8px;
  margin-bottom: .75rem;
  color: var(--color-text)
}

.uc-instructions strong {
  display: block;
  margin-bottom: .25rem
}

.uc-instructions ol {
  margin: 0;
  padding-left: 1.1rem
}

.uc-instructions li {
  margin: .25rem 0;
  font-size: .95rem
}

.uc-fields {
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.12);
  padding: .6rem .8rem;
  border-radius: 8px;
  margin-bottom: .75rem;
  color: var(--color-text)
}


.uc-description-wrapper{
  grid-column: 1/-1;
  display: flex;
  justify-content: center;
  width: 100%;
  background: var(--color-cards);
  border: 1px solid rgba(15, 23, 42, 0.04);
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05)
}

.uc-description {
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.12);
  padding: .6rem .8rem;
  border-radius: 8px;
  margin-bottom: .75rem;
  color: var(--color-text)
}
.converter-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  align-items: end
}

.converter-form label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: .95rem
}

.form-control {
  padding: .55rem .6rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 6px
}

.converter-actions {
  display: flex;
  gap: .6rem;
  align-items: center
}

.converter-result {
  grid-column: 1/-1;
  margin-top: .5rem;
  padding: .6rem;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.02);
  font-weight: 600
}

@media (max-width:900px) {
  .tools-grid {
    grid-template-columns: 1fr
  }

  .converter-form {
    grid-template-columns: 1fr
  }

  .converter-card {
    padding: .75rem
  }
}

/* Category icon styles */
.uc-cat-wrap {
  flex-direction: row;
  align-items: center;
  gap: .5rem
}

.uc-cat-icon {
  display: inline-flex;
  width: 1.6rem;
  height: 1.6rem;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 0;
  position: relative
}

.uc-cat-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block
}

.uc-cat-icon[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 8px);
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: .35rem .5rem;
  border-radius: 4px;
  font-size: .78rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease
}

.uc-cat-icon[data-tooltip]:hover::after {
  opacity: 1
}

.uc-cat-icon[data-tooltip]::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 4px);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(0, 0, 0, 0.85);
  opacity: 0;
  transition: opacity .12s ease
}

.uc-cat-icon[data-tooltip]:hover::before {
  opacity: 1
}

/* Custom select styles */
.custom-select {
  background-color: white;
  position: relative;
  display: inline-block;
  width: 100%
}

.custom-selected {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .55rem .6rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 6px;
  background: transparent;
  text-align: left
}

.custom-selected .opt-icon svg {
  width: 1rem;
  height: 1rem
}

.custom-options {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--color-cards);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  border-radius: 8px;
  display: none;
  z-index: 60
}

.custom-option {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .5rem;
  border-radius: 6px;
  cursor: pointer
}

.custom-option:hover,
.custom-option:focus {
  background: rgba(15, 23, 42, 0.03);
  outline: none
}

.custom-option .opt-icon svg {
  width: 1rem;
  height: 1rem;
  display: block
}

.custom-option.selected {
  background: rgba(37, 99, 235, 0.06)
}

/* Output + copy button */
.uc-output-wrap {
  position: relative;
  display: block
}

.converter-result .form-control {
  display: block;
  width: 100%;
  padding-right: 3.2rem
}

.uc-copy-btn {
  position: absolute;
  right: .5rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .5rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: .85rem;
  color: var(--color-text)
}

.uc-copy-btn svg {
  width: 1rem;
  height: 1rem;
  display: block
}

.uc-copy-btn .copy-label {
  font-size: .85rem
}

.uc-copy-btn.copied {
  background: var(--color-accent);
  color: #fff;
  border-color: transparent
}

.uc-copy-btn:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  outline-offset: 2px
}