/* === Molarity Calculator Styles – CalculatorGeek === */

.cg-mc-root {
  width: 100%;
  background: #f3f4f6;
  padding: 30px 10px;
  box-sizing: border-box;
  user-select: none; /* protected wrapper */
}

.cg-mc-container {
  max-width: 1150px;
  margin: 0 auto;
  font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  color: #111827;
}

/* Header */

.cg-mc-header {
  border-radius: 28px;
  background: linear-gradient(90deg,#0072ff,#00c853);
  padding: 38px 24px;
  color: #ffffff;
  text-align: center;
  box-shadow: 0 16px 40px rgba(15,23,42,0.25);
  margin-bottom: 22px;
}

.cg-mc-header-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

.cg-mc-header-subtitle {
  font-size: 16px;
  opacity: 0.95;
}

/* 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 */

.cg-mc-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 14px 32px rgba(15,23,42,0.12);
  padding: 18px;
  box-sizing: border-box;
  font-size: 15px;
}

/* Labels & fields */

.cg-mc-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.cg-mc-field-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cg-mc-input {
  flex: 1;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
  background: #ffffff;
  user-select: text;
}

.cg-mc-input:focus {
  border-color: #0072ff;
  box-shadow: 0 0 0 1px #0072ff33;
}

.cg-mc-input[readonly] {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #111827;
}

/* Allow selecting text inside inputs even though root is user-select:none */
.cg-mc-allow-select {
  user-select: text !important;
}

/* Unit dropdowns */

.cg-mc-select {
  width: 120px;
  padding: 9px 35px 9px 11px;
  border-radius: 8px;
  border: 1px solid #047857;
  background: #e3f7ef;
  font-size: 13px;
  color: #047857;
  font-weight: 600;
  outline: none;
  box-sizing: border-box;
  cursor: pointer;
  appearance: none;
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}

/* Variant widths for desktop */

.cg-mc-select-mw {
  width: 190px;
}

.cg-mc-select-vol {
  width: 200px;
}

.cg-mc-select-conc {
  width: 260px;
}

.cg-mc-select-molar {
  width: 210px;
}

/* Dropdown arrow (green, same theme) */

.cg-mc-select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20'><path d='M5 7 L10 12 L15 7' stroke='%2300472e' 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: 6px;
  cursor: pointer;
}

.cg-mc-info-badge {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff7ed;          /* soft warm background */
  border: 1px solid #f59e0b;    /* amber border */
  color: #b45309;               /* darker amber text */
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tooltip bubble */

.cg-mc-tooltip {
  visibility: hidden;
  opacity: 0;
  background: #ffffff;
  color: #374151;
  border: 1px solid #e5e7eb;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  position: absolute;
  left: 0;
  top: 22px;
  width: 260px;
  box-shadow: 0px 4px 12px rgba(0,0,0,0.10);
  transition: opacity 0.18s ease-in-out;
  z-index: 9999;
}

/* Tooltip arrow */

.cg-mc-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 12px;
  border-width: 0 6px 6px 6px;
  border-style: solid;
  border-color: transparent transparent #e5e7eb transparent;
}

.cg-mc-tooltip::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 13px;
  border-width: 0 5px 5px 5px;
  border-style: solid;
  border-color: transparent transparent #ffffff transparent;
}

/* Show tooltip on hover / focus */

.cg-mc-info-icon:hover .cg-mc-tooltip,
.cg-mc-info-icon:focus-within .cg-mc-tooltip {
  visibility: visible;
  opacity: 1;
}

/* Buttons */

.cg-mc-actions {
  border-top: 1px solid #e5e7eb;
  padding-top: 14px;
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.cg-mc-btn-share {
  flex: 1 1 130px;
  min-width: 130px;
  padding: 10px 12px;
  border-radius: 999px;
  border: none;
  background: #fee2e2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.cg-mc-share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #f43f5e;
  color: #ffffff;
  font-size: 14px;
}

.cg-mc-share-text {
  font-size: 14px;
  font-weight: 500;
  color: #b91c1c;
}

.cg-mc-btn-reload,
.cg-mc-btn-clear {
  flex: 1 1 140px;
  min-width: 140px;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.cg-mc-btn-reload {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
}

.cg-mc-btn-clear {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #9ca3af;
}

/* Feedback row */

.cg-mc-feedback-row {
  margin-top: 12px;
  font-size: 11px;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cg-mc-feedback-buttons {
  display: flex;
  gap: 6px;
}

.cg-mc-feedback-yes,
.cg-mc-feedback-no {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  cursor: pointer;
}

.cg-mc-feedback-yes {
  border: 1px solid #bbf7d0;
  background: #ecfdf5;
  color: #16a34a;
}

.cg-mc-feedback-no {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

/* Usage card */

.cg-mc-usage-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.cg-mc-usage-count {
  font-size: 34px;
  font-weight: 800;
  color: #2563eb;
  margin: 4px 0 6px 0;
}

.cg-mc-usage-text {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
}

.cg-mc-usage-note {
  font-size: 11px;
  color: #9ca3af;
}

/* Feedback popup */

.cg-mc-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
}

.cg-mc-popup-box {
  background: #ffffff;
  padding: 22px 28px;
  border-radius: 14px;
  font-family: -apple-system,Segoe UI,Roboto,Arial;
  font-size: 16px;
  color: #111827;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  text-align: center;
  max-width: 300px;
}

.cg-mc-popup-ok {
  margin-top: 14px;
  padding: 6px 18px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
}

/* Share modal */

.cg-mc-share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.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;
  font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  color: #111827;
}

.cg-mc-share-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 2px;
}

.cg-mc-share-subtitle {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 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;
  justify-content: flex-start;
  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;
}

/* =======================
   MOBILE RESPONSIVE FIXES
   ======================= */

@media (max-width: 768px) {

  /* Stack main and sidebar vertically */
  .cg-mc-main-row {
    flex-direction: column !important;
  }

  .cg-mc-left,
  .cg-mc-right {
    min-width: 100% !important;
  }

  /* Keep input + unit in one row (like desktop) */
  .cg-mc-field-row {
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
  }

  /* Input ~60% width */
  .cg-mc-input {
    flex: 0 0 60% !important;
    max-width: 60% !important;
    width: 60% !important;
  }

  /* Units ~40% width, inside card */
  .cg-mc-select,
  .cg-mc-select-mw,
  .cg-mc-select-vol,
  .cg-mc-select-conc,
  .cg-mc-select-molar {
    flex: 0 0 40% !important;
    max-width: 40% !important;
    width: 40% !important;
    box-sizing: border-box !important;
    margin-top: 0 !important;
  }

  .cg-mc-card {
    padding: 14px !important;
  }
}
