
/* Number Base Converter — golden luxury */

/* Modal lives inside .tool-page-shell; footer is a sibling that stacks above the main column.
   While the base picker is open, lift the shell above footer (1000) and mobile nav (1100). */
body.page-toolkit-labs:has(.base-select-modal.show) .tool-page-shell {
  position: relative;
  z-index: 1200;
}

.tool-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}


/* Base Tool Styles */
.base-tool {
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.97), rgba(248, 238, 222, 0.97));
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 14px 36px -24px rgba(94, 65, 30, 0.35);
  border: 1px solid rgba(145, 103, 48, 0.2);
}

.conversion-section {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.input-group {
  display: flex;
  flex-direction: column;
}

.input-group label {
  display: block;
  color: #5e4329;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#numberInput {
  width: 100%;
  background: #fffaf2;
  border: 2px solid rgba(145, 103, 48, 0.22);
  border-radius: 8px;
  padding: 16px;
  color: #4a351f;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

#numberInput:focus {
  outline: none;
  border-color: #ab7c34;
  box-shadow: 0 0 0 3px rgba(171, 124, 52, 0.14);
}

#numberInput::placeholder {
  color: #8c7558;
}

/* Custom Select Wrapper */
.custom-select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  background: #fffaf2;
  border: 2px solid rgba(145, 103, 48, 0.22);
  border-radius: 8px;
  padding: 16px 45px 16px 16px;
  color: #4a351f;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  min-height: 54px;
  overflow: hidden;
}

.custom-select-trigger:hover {
  border-color: rgba(145, 103, 48, 0.45);
}

.custom-select-trigger.active {
  border-color: #ab7c34;
  box-shadow: 0 0 0 3px rgba(171, 124, 52, 0.14);
}

.custom-select-value {
  flex: 1;
  color: #4a351f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.custom-select-trigger i {
  color: #b98b3b;
  font-size: 0.85rem;
  transition: transform 0.3s ease;
  margin-left: 10px;
}

.custom-select-trigger.active i {
  transform: rotate(180deg);
}

#fromBase,
#toBase {
  display: none;
}

/* Base Select Modal */
.base-select-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.base-select-modal.show {
  display: block;
}

.base-select-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(40, 28, 16, 0.72);
  backdrop-filter: blur(4px);
}

.base-select-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 450px;
  max-height: 80vh;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(248, 238, 222, 0.96));
  border-radius: 16px;
  border: 1px solid rgba(145, 103, 48, 0.28);
  box-shadow: 0 24px 60px -20px rgba(94, 65, 30, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.base-select-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid rgba(145, 103, 48, 0.15);
  background: rgba(182, 138, 58, 0.08);
}

.base-select-modal-header h3 {
  color: #5e4329;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.base-select-modal-close {
  background: transparent;
  border: 1px solid rgba(145, 103, 48, 0.35);
  color: #7a572c;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
}

.base-select-modal-close:hover {
  background: rgba(182, 138, 58, 0.12);
  border-color: #ab7c34;
  transform: rotate(90deg);
}

.base-select-modal-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.base-select-search {
  position: relative;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(145, 103, 48, 0.12);
}

.base-select-search input {
  width: 100%;
  background: #fffaf2;
  border: 2px solid rgba(145, 103, 48, 0.22);
  border-radius: 8px;
  padding: 12px 40px 12px 15px;
  color: #4a351f;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.base-select-search input:focus {
  outline: none;
  border-color: #ab7c34;
  box-shadow: 0 0 0 3px rgba(171, 124, 52, 0.12);
}

.base-select-search i {
  position: absolute;
  right: 35px;
  top: 50%;
  transform: translateY(-50%);
  color: #b98b3b;
  font-size: 0.9rem;
  pointer-events: none;
}

.base-select-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  max-height: 400px;
}

.base-select-option {
  padding: 12px 15px;
  color: #4a351f;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  margin-bottom: 4px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.base-select-option:hover {
  background: rgba(182, 138, 58, 0.12);
  color: #7a5526;
  transform: translateX(4px);
}

.base-select-option.selected {
  background: rgba(182, 138, 58, 0.16);
  color: #7a5526;
  border-left: 3px solid #ab7c34;
  font-weight: 600;
}

.base-select-option.selected::after {
  content: '✓';
  color: #ab7c34;
  font-weight: bold;
  margin-left: 10px;
}

.base-select-option.hidden {
  display: none;
}

/* Custom Scrollbar for Modal */
.base-select-list::-webkit-scrollbar {
  width: 8px;
}

.base-select-list::-webkit-scrollbar-track {
  background: #f5ebe0;
  border-radius: 4px;
}

.base-select-list::-webkit-scrollbar-thumb {
  background: rgba(145, 103, 48, 0.35);
  border-radius: 4px;
  transition: background 0.3s ease;
}

.base-select-list::-webkit-scrollbar-thumb:hover {
  background: rgba(145, 103, 48, 0.5);
}

.base-select-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(145, 103, 48, 0.35) #f5ebe0;
}

/* Error Message */
.error-message {
  background: rgba(201, 74, 58, 0.08);
  border: 1px solid rgba(201, 74, 58, 0.28);
  color: #c94a3a;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 500;
  text-align: center;
  animation: errorSlide 0.3s ease;
}

@keyframes errorSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Result Sections */
.result-section {
  margin-bottom: 25px;
  background: #fffaf2;
  border-radius: 12px;
  border: 1px solid rgba(145, 103, 48, 0.15);
  overflow: hidden;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: rgba(182, 138, 58, 0.08);
  border-bottom: 1px solid rgba(145, 103, 48, 0.12);
}

.result-header h3 {
  color: #5e4329;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-header h3 i {
  font-size: 1rem;
}

.copy-btn-small {
  background: transparent;
  border: 1px solid rgba(145, 103, 48, 0.35);
  color: #7a572c;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.copy-btn-small:hover {
  background: rgba(182, 138, 58, 0.1);
  border-color: #ab7c34;
  transform: scale(1.05);
}

.result-content {
  padding: 20px;
}

.results-output {
  background: #f5ebe0;
  color: #4a351f;
  padding: 20px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.8;
  border: 1px solid rgba(145, 103, 48, 0.15);
}

.result-item {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(145, 103, 48, 0.12);
}

.result-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.result-label {
  color: #5e4329;
  font-weight: 600;
  margin-bottom: 5px;
  display: block;
}

.result-value {
  color: #4a351f;
  word-break: break-all;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .tool-container {
    padding: 0 15px;
  }


  .base-tool {
    padding: 25px 20px;
  }

  .conversion-section {
    grid-template-columns: 1fr;
  }

  .result-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .copy-btn-small.copied {
    animation: copyPulse 0.6s ease;
    box-shadow: 0 0 15px rgba(171, 124, 52, 0.45);
  }

  .copy-btn-small.copied svg {
    display: inline-block;
    vertical-align: middle;
  }

  @keyframes copyPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1.05); }
  }

  .copy-btn-small {
    width: auto;
    flex-shrink: 0;
  }

}

@media (max-width: 480px) {
}

.action-buttons.btn-contain-x {
  margin-bottom: 25px;
}

/* Checkbox Styling */
.input-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.input-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #ab7c34;
}

.input-group label span {
  color: rgba(88, 64, 38, 0.85);
  font-size: 0.95rem;
}

/* All Bases Section */
.all-bases-section {
  margin-bottom: 20px;
}

.all-bases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.base-conversion-item {
  background: rgba(182, 138, 58, 0.08);
  border: 1px solid rgba(145, 103, 48, 0.15);
  border-radius: 8px;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.base-conversion-item:hover {
  background: rgba(182, 138, 58, 0.12);
  border-color: rgba(145, 103, 48, 0.3);
  transform: translateY(-2px);
}

.base-label {
  color: #5e4329;
  font-weight: 600;
  font-size: 0.9rem;
}

.base-value {
  color: #4a351f;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  word-break: break-all;
  text-align: right;
  margin-left: 15px;
}

/* Details/Summary Styling */
.other-bases-details {
  margin-top: 15px;
}

.other-bases-details summary {
  cursor: pointer;
  color: #7a5526;
  padding: 10px 15px;
  border-radius: 6px;
  background: rgba(182, 138, 58, 0.1);
  border: 1px solid rgba(145, 103, 48, 0.22);
  transition: all 0.3s ease;
  user-select: none;
  font-weight: 500;
  list-style: none;
}

.other-bases-details summary::-webkit-details-marker {
  display: none;
}

.other-bases-details summary::before {
  content: '▶';
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.3s ease;
  font-size: 0.8rem;
}

.other-bases-details[open] summary::before {
  transform: rotate(90deg);
}

.other-bases-details summary:hover {
  background: rgba(182, 138, 58, 0.15);
  border-color: rgba(145, 103, 48, 0.32);
}

/* Subscript Styling */
sub {
  font-size: 0.7em;
  vertical-align: sub;
  color: #ab7c34;
  margin-left: 3px;
}

/* Main Result Highlight */
.main-result {
  background: rgba(182, 138, 58, 0.08);
  padding: 15px;
  border-radius: 8px;
  margin-top: 20px !important;
}

@media (max-width: 768px) {
  .all-bases-grid {
    grid-template-columns: 1fr;
  }
  
  .base-conversion-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .base-value {
    text-align: left;
    margin-left: 0;
    width: 100%;
  }
  
  .base-select-modal-content {
    width: 95%;
    max-height: 85vh;
  }
  
  .base-select-modal-header {
    padding: 15px 20px;
  }
  
  .base-select-modal-header h3 {
    font-size: 1rem;
  }
  
  .base-select-search {
    padding: 12px 15px;
  }
  
  .base-select-list {
    max-height: 350px;
  }
}
