/* Modal styling */
.dsc-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow: auto;
}

/* Modal content box */
.dsc-modal-content {
  background: #fff;
  padding: 20px;
  max-width: 90vw;
  width: auto;
  border-radius: 10px;
  text-align: center;
  box-sizing: border-box;
}

.dsc-modal-content h2{
  font-size: 30px;
}

/* Calibration card */
.dsc-card-calibration {
  margin: 20px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#dsc-card-template {
  position: relative;
  background: #444;
  border-radius: 12px;
  border: 2px solid #999;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

/* Calibration card text */
.dsc-card-text {
  color: #ddd;
  text-align: center;
  font-family: sans-serif;
  word-break: break-word;
  transition: font-size 0.2s ease;
}

/* Red lines for calibration */
.dsc-card-line {
  position: absolute;
  height: 3px;
  background: red;
  transition: width 0.2s ease, top 0.2s ease, left 0.2s ease;
  pointer-events: none;
}

.dsc-card-line.top {
  transform: translateY(-100%);
}

.dsc-card-line.bottom {
  transform: translateY(100%);
}

/* Buttons */
.dsc-buttons {
  display: flex;
  gap: 20px;
  margin-top: 10px;
}

.dsc-buttons button {
  padding: 10px 50px;
  border: none;
  background: #bfbfbf;
  color: #333;
  font-size: 40px;
  border: 1px solid #333;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.dsc-calibrate-btn {
  padding: 20px 50px;
  border: none;
  background: #fff;
  font-size: 14px;
  font-weight: 200;
  color: #333;
  border: 1px solid #333;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.dsc-buttons button:hover,
.dsc-calibrate-btn:hover {
  background: #555;
  color: #fff;
}

/* Main app content area */
#dsc-main-app {
  padding: 20px;
  max-width: 100%;
  margin: 0 auto;
}

/* Diamond shape selector */
#dsc-shapes-selector {
  width: 100%;
  padding: 15px 0;
  border-bottom: 1px solid #ccc;
  overflow-x: auto;
  text-align: center;
}

.dsc-shape-grid {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 16px;
  padding: 10px 20px;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .dsc-shape-grid {
    justify-content: center;
  }
}

/* Shape buttons as scrollable carousel items */
.dsc-shape {
  flex: 0 0 auto;
  width: 90px;
  height: 90px;
  padding: 10px;
  border: 1px solid #aaa;
  background: #fff;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.dsc-shape:hover {
  background: #eee;
  transform: scale(1.05);
}

.dsc-shape:focus,
.dsc-shape:active {
  background: #98c7e3;
  color: #fff;
  outline: none;
  box-shadow: none;
  border-color: #aaa;
}

/* Diamond shape image styling */
.dsc-shape img {
  width: 100%;
  height: auto;
  max-width: 40px;
  max-height: 40px;
  display: block;
  object-fit: contain;
}

.dsc-shape span {
  font-size: 1rem;
  color: #333;
  font-weight: 500;
  text-transform: capitalize;
  margin-top: 10px;
}

/* Scrollbar styling for horizontal carousel */
.dsc-shape-grid {
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}

.dsc-shape-grid::-webkit-scrollbar {
  height: 8px;
}

.dsc-shape-grid::-webkit-scrollbar-track {
  background: transparent;
}

.dsc-shape-grid::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 4px;
}

/* Selected shape header */
#dsc-selected-shape-header {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 20px auto;
  padding: 0 16px;
  box-sizing: border-box;
  padding-top: 30px;
}

#dsc-selected-shape-title {
  text-align: center;
  font-size: 24px;
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  top: 50%;
  white-space: nowrap;
}

#dsc-recalibrate-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background-color: #0076bf;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

#dsc-recalibrate-btn:hover {
  background-color: #005fa3;
}

/* Diamond sizes grid */
#dsc-diamonds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  justify-content: center;
  margin: 20px auto;
  width: 100%;
  max-width: 1200px;
  box-sizing: border-box;
  padding: 0 16px;
}



/* Diamond layout and styling */
.dsc-diamond {
  text-align: center;
  font-family: GuyotHeadline, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 40px;
}

.dsc-diamond svg {
  max-width: 90vw;
  height: auto;
}

.dsc-label {
  margin-top: 5px;
  font-size: 12px;
  color: #333;
}

.dsc-weight {
  margin-top: 4px;
  font-size: 12px;
  color: #555;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #dsc-diamonds-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  #dsc-diamonds-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dsc-diamond img {
    max-width: 60px;
  }
}

@media (max-width: 600px) {
  .dsc-modal-content {
    padding: 15px;
  }

  .dsc-card-text {
    font-size: 0.9rem;
  }

  .dsc-shape {
    padding: 8px 12px;
    font-size: 0.9em;
  }

  .dsc-buttons button {
    font-size: 30px;
    padding: 10px 25px;
  }

  .dsc-calibrate-btn {
    padding: 15px 30px;
    font-size: 12px;
  }
  #dsc-selected-shape-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: static;
    padding-top: 10px;
  }

  #dsc-selected-shape-title {
    position: static;
    transform: none;
    margin-bottom: 30px;
    font-size: 20px;
    text-align: center;
  }

  #dsc-recalibrate-btn {
    position: static;
    transform: none;
    width: auto;
    margin: 0 auto;
    margin-top: 20px;
  }
}


#dsc-main-app.locked {
  filter: blur(0px) brightness(1);
  pointer-events: none;
  user-select: none;
}