/* Convert Units — Modern & Responsive Design */

/* Page Section */
.page {
  padding: clamp(2rem, 5vw, 4rem) 1rem;
  min-height: calc(100vh - 200px);
}

.page__title {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
  text-align: center;
  color: #39ff14;
  letter-spacing: -0.03em;
}

.lead {
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
  text-align: center;
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.15rem;
  line-height: 1.7;
}

/* Highlights Grid - Standardized */
.highlights-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
}

.highlight-card {
  position: relative;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(8, 15, 25, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.08);
  transition: transform 0.35s ease, border-color 0.35s ease;
  backdrop-filter: blur(18px);
}

.highlight-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background-color: rgba(0, 240, 255, 0.22);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.highlight-card:hover {
  transform: translateY(-6px);
}

.highlight-card:hover::after {
  opacity: 1;
}

.highlight-card__eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.6);
}

.highlight-card__title {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.2rem;
  color: #e0ffef;
}

.highlight-card__text {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
}

/* Main Layout - Standardized */
.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 1.5rem;
  align-items: stretch;
  margin-top: 1.5rem;
}

.tool-panel {
  min-width: 0;
}

/* Converter Card - Standardized */
/* Converter Card - Modern Design */
.converter-card {
  background-color: #0f1532;
  border-radius: 20px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: visible;
}

.converter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: rgba(57,255,20,0.22);
  opacity: 0.6;
}

/* Form Groups */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.9);
  margin-bottom: 0.75rem;
}

.label-icon {
  width: 16px;
  height: 16px;
  color: #00f0ff;
}

/* Conversion Grid */
.conversion-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
  align-items: start;
}

.conversion-section {
  display: flex;
  flex-direction: column;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.select-wrapper {
  position: relative;
}

/* Donate button positioned to the right of the Category title */
/* Layout for label + donate button */
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.root-font-size-row{
  margin-top:0.5rem;
  display:flex;
  gap:0.5rem;
  align-items:center;
}
.root-font-size-row .small-label{ color:var(--muted); font-size:0.9rem; }
.root-font-size-row input[type="number"]{ width:5.5rem; padding:0.35rem 0.5rem; border-radius:6px; border:1px solid rgba(255,255,255,0.06); background:transparent; color:var(--text); }

.donate-inline {
  position: static;
  margin-left: auto;
  flex-shrink: 0;
  padding-bottom: 0.6rem;
}

/* Ensure icon is visible and consistent */
.donate-button .button-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  flex-shrink: 0;
}

.donate-label {
  display: inline-block;
}

@media (max-width: 768px) {
  .donate-inline {
    position: static;
    display: inline-flex;
    width: auto;
    margin-top: 0;
    box-sizing: border-box;
    text-align: center;
    padding: 0.35rem 0.5rem;
    align-items: center;
    justify-content: center;
  }
  /* On small screens show label and icon (compact) */
  .donate-inline .donate-label { display: inline-block; }
  .donate-inline .button-icon { width: 18px; height: 18px; }
}
/* Standardized, flat select and input appearance */
/* Form Controls */
.select-wrapper select {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}

/* Input Styles */
input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.1);
  background-color: rgba(20,25,45,0.7);
  color: var(--color-text-primary);
  font-size: 1.125rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

input::placeholder {
  color: rgba(255,255,255,0.3);
  font-weight: 400;
}

input:hover {
  border-color: rgba(255,255,255,0.2);
  background-color: rgba(25,30,50,0.8);
}

input:focus {
  outline: none;
  border-color: #00f0ff;
  box-shadow: 0 0 0 4px rgba(0,240,255,0.15), 0 4px 20px rgba(0,240,255,0.1);
  background-color: rgba(30,35,60,0.9);
  transform: translateY(-1px);
}

.select-display {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(20,25,45,0.7);
  color: var(--color-text-primary);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 5;
  width: 100%;
}

.select-display:hover {
  border-color: rgba(255,255,255,0.2);
  background-color: rgba(25,30,50,0.8);
}

.select-display:focus,
.select-display[aria-expanded="true"] {
  outline: none;
  border-color: #00f0ff;
  box-shadow: 0 0 0 4px rgba(0,240,255,0.15);
  background-color: rgba(30,35,60,0.9);
}

.select-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-arrow {
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(255, 255, 255, 0.7);
  border-bottom: 2px solid rgba(255, 255, 255, 0.7);
  transform: rotate(45deg);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: auto;
}

.select-wrapper.open .select-arrow,
.select-display[aria-expanded="true"] .select-arrow {
  transform: rotate(225deg);
}

/* Custom Select Dropdown */
.custom-select-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background-color: rgba(18,22,42,0.98);
  border: 1px solid rgba(0,240,255,0.16);
  border-radius: 14px;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  z-index: 1000;
  padding: 0.5rem;
  box-sizing: border-box;
  min-width: 100%;
  width: auto;
  max-width: min(calc(100vw - 2rem), 500px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0,240,255,0.1);
  backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.custom-select-list.open { 
  opacity: 1; 
  transform: translateY(0) scale(1);
  pointer-events: auto;
}


/* Select Items - Enhanced Design */
.custom-select-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 2px 0;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.95rem;
}

.custom-select-item:hover {
  background: linear-gradient(90deg, rgba(0,240,255,0.08), rgba(57,255,20,0.05));
  transform: translateX(4px);
}

.custom-select-item:focus {
  background: linear-gradient(90deg, rgba(0,240,255,0.1), rgba(57,255,20,0.06));
  box-shadow: 0 0 0 2px rgba(0,240,255,0.2);
}

.custom-select-item[aria-selected="true"] {
  background: linear-gradient(90deg, rgba(0,240,255,0.15), rgba(57,255,20,0.1));
  color: #00f0ff;
  font-weight: 600;
}

.custom-select-item[aria-selected="true"]::before {
  content: '✓';
  color: #39ff14;
  font-weight: bold;
  margin-right: 4px;
}

/* Custom Scrollbar */
.custom-select-list::-webkit-scrollbar { 
  width: 8px; 
}

.custom-select-list::-webkit-scrollbar-track { 
  background: rgba(255,255,255,0.03); 
  border-radius: 10px;
  margin: 4px;
}

.custom-select-list::-webkit-scrollbar-thumb { 
  background: linear-gradient(180deg, rgba(0,240,255,0.3), rgba(57,255,20,0.2)); 
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.custom-select-list::-webkit-scrollbar-thumb:hover { 
  background: linear-gradient(180deg, rgba(0,240,255,0.5), rgba(57,255,20,0.3));
}

.custom-select-list { 
  scrollbar-width: thin; 
  scrollbar-color: rgba(0,240,255,0.3) rgba(255,255,255,0.03); 
}

.custom-select-empty {
  padding: 16px;
  color: var(--color-text-secondary);
  font-style: italic;
  text-align: center;
}

/* Swap Container */
.swap-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2rem;
}

.swap-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #00f0ff;
  border: none;
  color: #07101a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0,240,255,0.3);
  position: relative;
}

.swap-btn svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.swap-btn:hover {
  transform: scale(1.1) rotate(180deg);
  box-shadow: 0 8px 25px rgba(0,240,255,0.5);
}

.swap-btn:active {
  transform: scale(0.95);
}

.swap-btn.disabled,
.swap-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.swap-btn.disabled:hover,
.swap-btn[disabled]:hover {
  transform: none;
  box-shadow: 0 4px 15px rgba(0,240,255,0.3);
}

/* Action Buttons */
.converter-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 14px 24px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-icon {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background-color: #00f0ff;
  color: #07101a;
  box-shadow: 0 4px 15px rgba(0,240,255,0.18);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0,240,255,0.5);
}

.btn-secondary {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.9);
  border: 2px solid rgba(255,255,255,0.1);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn.disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Result Input - Enhanced Visibility */
#toValue {
  font-size: 1.25rem;
  font-weight: 700;
  padding: 16px 18px;
  border-radius: 12px;
  background-color: rgba(0,240,255,0.05);
  font-family: 'Fira Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  color: #00f0ff;
  border: 2px solid rgba(0,240,255,0.16);
  letter-spacing: 0.02em;
}

#toValue:focus {
  border-color: #39ff14;
  box-shadow: 0 0 0 4px rgba(57,255,20,0.15);
}

/* Copy Feedback - Toast Notification */
.copy-feedback {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, rgba(0,240,255,0.95), rgba(57,255,20,0.95));
  color: #0a0f1e;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-20px) scale(0.9);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
  box-shadow: 0 8px 30px rgba(0,240,255,0.4);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.copy-feedback.show { 
  opacity: 1; 
  transform: translateY(0) scale(1);
}

.copy-feedback::before {
  content: '✓';
  font-size: 1.2rem;
  font-weight: bold;
}

/* Quick Info Badge */
.quick-info {
  margin-top: 1rem;
}

.info-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(0,240,255,0.05);
  border: 1px solid rgba(0,240,255,0.15);
  border-radius: 12px;
  color: rgba(255,255,255,0.8);
  font-size: 0.875rem;
  line-height: 1.5;
}

.info-icon {
  width: 20px;
  height: 20px;
  color: #00f0ff;
  flex-shrink: 0;
}

/* Result Input - Enhanced Visibility */
#toValue {
  font-size: 1.25rem;
  font-weight: 700;
  padding: 16px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0,240,255,0.05), rgba(57,255,20,0.05));
  font-family: 'Fira Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  color: #00f0ff;
  border: 2px solid rgba(0,240,255,0.2);
  text-shadow: 0 0 10px rgba(0,240,255,0.3);
  letter-spacing: 0.02em;
}

#toValue:focus {
  border-color: #39ff14;
  box-shadow: 0 0 0 4px rgba(57,255,20,0.15);
}

/* Copy Feedback - Toast Notification */
.copy-feedback {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, rgba(0,240,255,0.95), rgba(57,255,20,0.95));
  color: #0a0f1e;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-20px) scale(0.9);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
  box-shadow: 0 8px 30px rgba(0,240,255,0.4);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.copy-feedback.show { 
  opacity: 1; 
  transform: translateY(0) scale(1);
}

.copy-feedback::before {
  content: '✓';
  font-size: 1.2rem;
  font-weight: bold;
}

/* Main Layout */
.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.85fr);
  gap: 1.5rem;
  align-items: start;
  margin-top: 2rem;
}

.tool-panel {
  min-width: 0;
}
/* Helper Card - Standardized */
.helper-card {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(5, 12, 24, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  height: fit-content;
}

.helper-card__header {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 1rem;
}

.helper-card__icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.helper-card__eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.helper-card__title {
  font-size: 1.35rem;
  color: #e0ffef;
  margin: 0.1rem 0 0;
  font-weight: 600;
}

.helper-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.helper-list li {
  color: var(--color-text-secondary);
  line-height: 1.5;
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.95rem;
}

.helper-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-neon-green);
  font-weight: bold;
}

.helper-status {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.helper-status__pill {
  display: inline-block;
  background: linear-gradient(135deg, var(--color-neon-green), rgba(57, 255, 20, 0.8));
  color: var(--color-bg-primary);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.helper-status__text {
  margin: 0.75rem 0 0 0;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

/* How To Section */
.how-to-section {
  margin-top: 3rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.how-to-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-neon-cyan);
  margin-bottom: 1.5rem;
  text-align: center;
}

.how-to-section ol {
  list-style: none;
  counter-reset: step;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.how-to-section li {
  counter-increment: step;
  padding: 1rem 1rem 1rem 3rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  border-left: 3px solid var(--color-neon-cyan);
  position: relative;
  color: var(--color-text-primary);
  line-height: 1.6;
}

.how-to-section li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-neon-cyan);
  color: var(--color-bg-primary);
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
}

/* Responsive Design - Enhanced Mobile Experience */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  
  .helper-card {
    order: 2;
  }
  
  .tool-panel {
    order: 1;
  }
}

@media (max-width: 768px) {
  .page {
    padding: 1.5rem 0.75rem;
  }
  
  .page__title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
  }
  
  .lead {
    font-size: 1rem;
  }
  
  .highlights-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .conversion-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  
  .swap-container {
    order: 2;
    padding: 0;
    margin: -0.5rem 0;
  }
  
  .conversion-section:first-child {
    order: 1;
  }
  
  .conversion-section:last-child {
    order: 3;
  }
  
  .swap-btn {
    width: 44px;
    height: 44px;
  }
  
  .swap-btn svg {
    width: 20px;
    height: 20px;
    transform: rotate(90deg);
  }
  
  .swap-btn:hover svg {
    transform: rotate(270deg);
  }
  
  .converter-actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .converter-card {
    padding: 1.25rem;
    border-radius: 16px;
  }
  
  .form-group {
    margin-bottom: 1.25rem;
  }
  
  .input-group {
    gap: 0.6rem;
  }
  
  input {
    padding: 12px 14px;
    font-size: 1rem;
  }
  
  .btn {
    padding: 12px 20px;
    font-size: 0.9rem;
  }
  
  .info-badge {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .helper-card {
    padding: 1.25rem;
  }
  
  .how-to-section {
    padding: 1.5rem;
  }
  
  .how-to-section li {
    padding: 0.875rem 0.875rem 0.875rem 2.75rem;
    font-size: 0.9rem;
  }
}

/* Animation Utilities */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.converter-card {
  animation: fadeIn 0.6s ease-out;
}

.helper-card {
  animation: fadeIn 0.6s ease-out 0.2s both;
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus Visible for Better Accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-neon-cyan);
  outline-offset: 2px;
}

/* Prevent layout shift during loading */
img {
  max-width: 100%;
  height: auto;
  display: block;
}
