/* This is the css of select options of unit changing container*/
.modern-select {
    width: 100%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
}
/* This is the css of select options of unit changing container*/
.modern-select:hover {
    background: rgba(255,102,0,0.15);
    border-color: #ff6600;
}

/* This is the css of select options of unit changing container*/
.modern-select:focus {
    outline: none;
    border-color: #ff6600;
    box-shadow: 0 0 8px rgba(255,102,0,0.4);
}

/* Dropdown options styling */
.modern-select option {
    background-color: #2b2b2b;
    color: #fff;
    padding: 10px;
}

/* This is the css of unit changing container*/
#unitContainer { 
    position: absolute;
    right: 16px;
    top: 25%;
    display: none;
    padding: 16px;
    background: rgba(25, 25, 25, 0.75);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    box-shadow: 0px 8px 25px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Segoe UI', Roboto, sans-serif;
    width: 220px;
    color: #fff;
}

#globalMessageBox {
    display: none;
    position: fixed;
    top: 13%;
    left: 50%;  
    transform: translate(-50%, -50%);
    min-width: 300px;
    background-color: rgba(182, 167, 167, 0.85); /* techie blackish */
    color: #4CAF50; /* default text color (green) */
    padding: 12px 20px;
    border-radius: 10px;
    z-index: 9999;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.3px;
    backdrop-filter: blur(6px); /* subtle glassy effect */
    box-shadow: 0 4px 12px rgba(26, 177, 232, 0.85);
    transition: opacity 0.3s ease;
}

.tooltip {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

/* Tooltip text */
.tooltip .tooltiptext {
  visibility: hidden;
  width: 220px;
  background: rgba(0, 0, 0, 0.85); /* blackish techie bg */
  color: #00d2d6; /* your text color */
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.4;

  /* Position */
  position: absolute;
  z-index: 1;
  bottom: 125%; /* show above icon */
  left: 50%;
  transform: translateX(-50%);

  /* Small arrow */
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%; /* arrow at bottom of tooltip */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.85) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Theme */
:root {
  --bg: #1a1212;
  --surface: #2b2b2b;
  --modal-bg: #242424;
  --header: #69605a;
  --text: #e6e6e6;
  --muted: #bdbdbd;
  --muted-icon: #bdbdbd;
  --muted-subtitle: #04a6c0;
  --accent: #ea8604;
  --danger: #db2828;
  --white: #ffffff;
  --black: #000000;
  --export-btn-text: #5f6060;
  --shadow-dark: #111;
  --header-border: #000000;

  --ring: 0 0 0 2px rgba(234,134,4,.35);
  --radius: 16px;
  --shadow: 0 12px 28px rgba(0,0,0,.45);
}

/* Modal */
.ui.modal#measurementExportDiv {
  background: var(--modal-bg);
  color: var(--modal-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Header */
.export-header {
  background: var(--header) !important;
  border-bottom: 2px solid var(--header-border) !important;
}
.export-title-wrap {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.export-title-wrap .icon { color: var(--accent); }
.export-header h3 { margin: 0; font-weight: 600; color: var(--text); }

/* Content */
.export-content {
  background: var(--modal-bg) !important;
  padding: 1.25rem 1.5rem;
  border-bottom: 2px solid var(--header-border);
}

.export-fieldset {
  border: 1px solid var(--black);
  border-radius: var(--radius);
  padding: 1rem;
}
.export-legend {
  font-size: .95rem;
  color: var(--muted);
  padding: 0 .4rem;
}

/* Choice cards */
.export-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .75rem;
  margin-top: .75rem;
}

.radio-card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  background: var(--header);
  border: 1px solid rgba(255,255,255,.08);
  cursor: pointer;
  user-select: none;
  transition: transform .07s ease, border-color .15s ease, box-shadow .15s ease;
}
.radio-card:hover { transform: translateY(-1px); border-color: rgba(234,134,4,.35); }
.radio-card:has(input:focus-visible) { box-shadow: var(--ring); }

.radio-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.radio-card__body {
  display: flex;
  gap: .75rem;
  align-items: center;
  padding: .9rem;
}
.radio-card__body .icon { font-size: 1.25rem; color: var(--muted-icon); }

.radio-card__title {
  display: block;
  font-weight: 600;
  color: var(--white);
}
.radio-card__subtitle {
  display: block;
  font-size: .85rem;
  color: var(--muted-subtitle);
}

/* Selected state */
.radio-card:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset, var(--ring);
}
.radio-card:has(input:checked) .icon { color: var(--accent); }

/* Actions */
.export-actions {
  background: var(--header) !important;
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  padding: .9rem 1rem;
  border-top: 1px solid rgba(255,255,255,.1);
}
.export-actions .ui.button {
  border-radius: 999px;
  box-shadow: 1px 2px 2px 2px var(--shadow-dark);
}

/* Cancel = red pill */
.export-actions .ui.button.cancel {
  background: var(--danger);
  color: var(--white);
}

/* Export = white pill */
.export-actions .ui.button.export {
  background: var(--white);
  color: var(--export-btn-text);
  font-weight: 600;
}

/* Modal */
.ui.modal#customConfirmDiv {
  background: var(--modal-bg);
  color: var(--modal-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 420px; /* smaller than export modal */
}

/* Header */
.confirm-header {
  background: var(--header) !important;
  border-bottom: 2px solid var(--accent) !important;
}
.confirm-title-wrap {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.confirm-title-wrap .icon { color: var(--accent); }
.confirm-header h3 { margin: 0; font-weight: 600; color: var(--text); }

/* Content */
.confirm-content {
  background: var(--modal-bg) !important;
  padding: 1.25rem 1.5rem;
  border-bottom: 2px solid var(--accent);
  font-size: .95rem;
  color: var(--white);
  text-align: center;
}

/* Actions */
.confirm-actions {
  background: var(--header) !important;
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  padding: .9rem 1rem;
  border-top: 1px solid rgba(255,255,255,.1);
}
.confirm-actions .ui.button {
  border-radius: 999px;
  box-shadow: 1px 2px 2px 2px var(--shadow-dark);
  min-width: 90px;
}

/* Cancel button */
.confirm-actions .ui.button.cancel {
  background: var(--danger);
  color: var(--white);
}

/* OK button */
.confirm-actions .ui.button.export {
  background: var(--white);
  color: var(--export-btn-text);
  font-weight: 600;
}


/* Responsive */
@media (max-width: 520px) {
  .export-actions { flex-direction: column-reverse; }
  .export-actions .ui.button,
  .export-actions .ui.primary.button { width: 100%; }
}