/* === Molarity Calculator – CalculatorGeek === */

/* Root wrapper (full width, white background) */
.cg-mc-root {
  width: 100%;
  background: #ffffff;
  box-sizing: border-box;
  user-select: none;
}

/* Main layout – match Army Body Fat width */
.cg-mc-container {
  max-width: 960px;
  margin: 32px auto;
  padding: 0 16px 40px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #111827;
  box-sizing: border-box;
}

/* HEADER */

.cg-mc-header {
  background: linear-gradient(90deg, #007cf0, #00df52);
  color: #ffffff;
  padding: 32px 32px 40px;
  border-radius: 32px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  margin-bottom: -24px;
  position: relative;
  z-index: 1;
  text-align: center;
}

.cg-mc-header-title {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 700;
  color: #ffffff !important; /* keep heading text white */
}

.cg-mc-header-subtitle {
  margin: 0;
  font-size: 15px;
  opacity: 0.95;
}

/* MAIN CARD LAYOUT */

.cg-mc-main-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}

.cg-mc-left {
  flex: 1 1 60%;
  min-width: 320px;
}

.cg-mc-right {
  flex: 1 1 40%;
  min-width: 260px;
}

/* Card style (same vibe as Army body fat card) */

.cg-mc-card {
  margin-top: 32px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  padding: 24px 24px 20px;
  position: relative;
  z-index: 0;
  font-size: 14px;
  box-sizing: border-box;
}

/* LABELS & FIELDS */

.cg-mc-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 4px;
}

.cg-mc-label-row label {
  font-weight: 500;
}

.cg-mc-field-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cg-mc-input {
  flex: 1;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
  width: 100%;
  background: #ffffff;
}

.cg-mc-input:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px #bbf7d0;
}

.cg-mc-input[readonly] {
  background: #f9fafb;
}

/* allow selecting text inside input fields */
.cg-mc-allow-select {
  user-select: text !important;
}

/* UNIT SELECTS – styled like Army selects */

.cg-mc-select {
  border-radius: 10px;
  border: 1px solid #22c55e;
  padding: 8px 30px 8px 10px;
  font-size: 13px;
  outline: none;
  background: #ecfdf5;
  color: #047857;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  flex: 0 0 130px;
  box-sizing: border-box;
}

.cg-mc-select-mw {
  flex-basis: 170px;
}

.cg-mc-select-vol {
  flex-basis: 180px;
}

.cg-mc-select-conc {
  flex-basis: 210px;
}

.cg-mc-select-molar {
  flex-basis: 160px;
}

/* Dropdown arrow – inline SVG */

.cg-mc-select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20'><path d='M5 7 L10 12 L15 7' stroke='%23047857' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/></svg>");
}

/* INFO ICON + TOOLTIP */

.cg-mc-info-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  cursor: pointer;
}

.cg-mc-info-badge {
  border-radius: 999px;
  width: 18px;
  height: 18px;
  border: 1px solid #2563eb;
  background: #eff6ff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  padding: 0;
  color: #2563eb;
}

.cg-mc-tooltip {
  position: absolute;
  left: 0;
  top: 24px;
  width: 260px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  font-size: 12px;
  color: #374151;
  padding: 8px 10px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease-out;
  z-index: 20;
}

.cg-mc-info-icon:hover .cg-mc-tooltip,
.cg-mc-info-icon:focus-within .cg-mc-tooltip {
  opacity: 1;
  visibility: visible;
}

/* ACTIONS ROW (buttons + like/dislike) */

.cg-mc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.cg-mc-actions-left {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cg-mc-actions-right {
  margin-left: auto;
}

/* BUTTONS (Army-style buttons) */

.cg-mc-btn {
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.cg-mc-btn__icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.cg-mc-btn--primary {
  background: #ffe4e6;
  color: #be123c;
  border-color: #fecdd3;
}

.cg-mc-btn--primary .cg-mc-btn__icon {
  background: #fb7185;
  color: #ffffff;
}

.cg-mc-btn--secondary {
  background: #ffffff;
  color: #111827;
  border-color: #e5e7eb;
}

.cg-mc-btn--ghost {
  background: #ffffff;
  color: #9ca3af;
  border-color: #e5e7eb;
}

.cg-mc-btn:hover {
  filter: brightness(0.97);
}

/* LIKE / DISLIKE – EXACT ARMY STYLE, RENAMED */

.cg-mc-like-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 4px 10px;
  background: #ffffff;
}

.cg-mc-like-btn {
  background: transparent;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  cursor: pointer;
  color: #111827;
}

.cg-mc-like-btn--ghost {
  opacity: 0.7;
}

.cg-mc-like-icon {
  font-size: 14px;
}

.cg-mc-like-divider {
  font-size: 13px;
  color: #9ca3af;
}

.cg-mc-like-btn--pressed {
  transform: scale(0.96);
}

/* FEEDBACK ROW (same pattern as Army feedback) */

.cg-mc-feedback-row {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.cg-mc-feedback-buttons {
  display: flex;
  gap: 8px;
}

.cg-mc-feedback-btn {
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  cursor: pointer;
}

.cg-mc-feedback-btn--yes {
  color: #16a34a;
}

.cg-mc-feedback-btn--no {
  color: #dc2626;
}

/* USAGE CARD – right side */

.cg-mc-usage-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.cg-mc-usage-number {
  font-size: 32px;
  font-weight: 700;
  color: #2563eb;
  margin-bottom: 6px;
}

.cg-mc-usage-platform {
  margin: 0 0 4px;
  font-size: 13px;
}

.cg-mc-usage-platform span {
  font-weight: 600;
}

.cg-mc-usage-note {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
}

/* FEEDBACK MODAL */

.cg-mc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-out;
}

.cg-mc-modal-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

.cg-mc-modal {
  background: #ffffff;
  border-radius: 18px;
  padding: 20px 28px 18px;
  max-width: 320px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
  text-align: center;
}

.cg-mc-modal__text {
  margin: 0 0 16px;
  font-size: 14px;
}

.cg-mc-modal__btn {
  border-radius: 999px;
  padding: 8px 24px;
  font-size: 14px;
  border: none;
  cursor: pointer;
  background: #2563eb;
  color: #ffffff;
}

/* SHARE MODAL */

.cg-mc-share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.50);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.cg-mc-share-box {
  background: #ffffff;
  border-radius: 18px;
  max-width: 540px;
  width: 92%;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
  padding: 18px 20px;
  box-sizing: border-box;
  position: relative;
}

.cg-mc-share-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 2px;
}

.cg-mc-share-subtitle {
  font-size: 12px;
  color: #6b7280;
  margin: 0 0 10px;
}

.cg-mc-share-close {
  position: absolute;
  right: 14px;
  top: 12px;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: #6b7280;
}

.cg-mc-share-tabrow {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 14px;
  font-size: 14px;
}

.cg-mc-share-tab {
  padding-bottom: 8px;
  border-bottom: 2px solid #2563eb;
  color: #2563eb;
  font-weight: 500;
}

.cg-mc-share-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 12px;
  cursor: pointer;
}

.cg-mc-share-checkbox input {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
}

.cg-mc-share-icons {
  display: flex;
  gap: 32px;
  margin-bottom: 16px;
}

.cg-mc-share-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: center;
}

.cg-mc-share-circle {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  margin: 0 auto 4px auto;
}

.cg-mc-share-circle.fb { background: #1877f2; }
.cg-mc-share-circle.x  { background: #000000; }
.cg-mc-share-circle.in { background: #0a66c2; }

.cg-mc-share-label {
  font-size: 12px;
  color: #111827;
}

.cg-mc-share-link-label {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
}

.cg-mc-share-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cg-mc-share-url {
  flex: 1;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 13px;
  box-sizing: border-box;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cg-mc-share-copy {
  padding: 9px 14px;
  border-radius: 10px;
  border: none;
  background: #2563eb;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

/* RESPONSIVE */

@media (max-width: 640px) {
  .cg-mc-header {
    padding: 24px 20px 32px;
    border-radius: 24px;
  }

  .cg-mc-header-title {
    font-size: 26px;
  }

  .cg-mc-select {
    flex-basis: 110px;
  }

  .cg-mc-main-row {
    flex-direction: column;
  }

  .cg-mc-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .cg-mc-actions-right {
    margin-left: 0;
  }

  .cg-mc-feedback-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
