/* ===== Unit Converters Pro ===== */

.uc-wrap {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 1100px;
  margin: 0 auto;
  color: #1a1a2e;
}

/* ── Hub header ── */
.uc-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}
.uc-hub-header h2 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: #1a1a2e;
}
#uc-search {
  padding: 10px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  width: 260px;
  outline: none;
  transition: border-color 0.2s;
}
#uc-search:focus { border-color: #4f46e5; }

/* ── Group ── */
.uc-group { margin-bottom: 36px; }
.uc-group-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6366f1;
  margin: 0 0 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e0e7ff;
}

/* ── Grid of cards ── */
.uc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.uc-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px 14px;
  background: #fff;
  border: 2px solid #e0e7ff;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
  font-family: inherit;
}
.uc-card:hover {
  border-color: #6366f1;
  background: #f5f3ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(99,102,241,0.15);
}
.uc-card-icon { font-size: 1.8rem; line-height: 1; }
.uc-card-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #374151;
  line-height: 1.3;
}

/* ── Modal ── */
.uc-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9998;
}
.uc-modal {
  position: fixed; inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.uc-modal-inner {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.uc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e5e7eb;
  position: sticky; top: 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
}
.uc-modal-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1a2e;
}
.uc-close {
  background: none; border: none;
  font-size: 1.6rem; line-height: 1;
  cursor: pointer; color: #9ca3af;
  transition: color 0.15s;
  padding: 0 4px;
}
.uc-close:hover { color: #1a1a2e; }
.uc-modal-body { padding: 24px; }

/* ── Tool UI ── */
.uc-tool { width: 100%; }
.uc-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.uc-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.uc-col label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
}
.uc-input, .uc-select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.uc-input:focus, .uc-select:focus { border-color: #6366f1; }
.uc-input[readonly] { background: #f9fafb; color: #374151; }
.uc-select { cursor: pointer; }

.uc-swap {
  display: flex;
  align-items: flex-end;
  padding-bottom: 2px;
}
.uc-swap button {
  background: #f0f0ff;
  border: 2px solid #e0e7ff;
  border-radius: 50%;
  width: 40px; height: 40px;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  color: #6366f1;
}
.uc-swap button:hover {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}

.uc-result-box {
  margin-top: 16px;
  padding: 12px 16px;
  background: #f0f0ff;
  border-radius: 8px;
  border-left: 4px solid #6366f1;
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.5;
}

/* ── Standalone tool wrapper ── */
.uc-standalone .uc-tool-panel {
  background: #fff;
  border: 2px solid #e0e7ff;
  border-radius: 16px;
  padding: 24px;
}

/* ── Number converter ── */
.uc-numbers .uc-num-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.uc-numbers .uc-num-row label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
}
.uc-numbers input {
  padding: 10px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  font-family: monospace;
  outline: none;
  transition: border-color 0.2s;
}
.uc-numbers input:focus { border-color: #6366f1; }

/* ── Case converter ── */
.uc-case textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}
.uc-case textarea:focus { border-color: #6366f1; }
.uc-case-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.uc-case-buttons button,
.uc-copy-btn {
  padding: 7px 13px;
  background: #f5f3ff;
  border: 2px solid #e0e7ff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: #4f46e5;
  font-family: inherit;
  transition: all 0.15s;
}
.uc-case-buttons button:hover,
.uc-copy-btn:hover {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}
.uc-copy-btn {
  margin-top: 8px;
  width: 100%;
  font-size: 0.9rem;
}

/* ── Currency ── */
.uc-currency .uc-note {
  font-size: 0.82rem;
  color: #6b7280;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 16px;
}
.uc-currency .uc-note a { color: #d97706; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .uc-row { flex-direction: column; }
  .uc-swap { justify-content: center; transform: rotate(90deg); }
  .uc-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  #uc-search { width: 100%; }
  .uc-hub-header { flex-direction: column; align-items: flex-start; }
}
