/* ==========================================================================
   MAUCHUKY - SIGNATURE CORE CSS
   Styles for tabs, canvas drawing pad, signature card grids, and studio preview
   ========================================================================== */

/* --- Tab Header --- */
#tag_sign {
  width: 100%;
  border-bottom: 2px solid #136b76;
  margin-top: 30px;
  clear: both;
}

#tag_sign ul.tab-signature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

#tag_sign ul li.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 36px 14px 36px;
  font-size: 18px;
  font-weight: 800;
  background: #192d30;
  border: 2px solid #0f626d;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: #ffffff;
  text-transform: uppercase;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

#tag_sign ul li.tab-btn:hover {
  background: #0f626d;
  color: #ffd700;
}

#tag_sign ul li.tab-btn.active {
  background: #f8fafc;
  color: #07383f;
  position: relative;
  border-color: #0f626d;
  font-weight: 800;
}

#tag_sign ul li.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  background: #f8fafc;
}

/* --- Khung Sign (Container of each mode) --- */
.khung_sign {
  display: none;
  width: 100%;
  background: #f8fafc;
  border: 2px solid #0f626d;
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 35px;
  margin-bottom: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.khung_sign.active {
  display: block;
}

.section-instruction {
  font-size: 22px;
  font-weight: 800;
  color: #07383f !important;
  margin-bottom: 22px;
  text-align: center;
  letter-spacing: -0.01em;
}

/* --- Typed Signature Input & Ideas --- */
.sign-input-wrapper {
  max-width: 850px;
  margin: 0 auto 30px auto;
  background: #ffffff;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.sign-form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.sign-form-row .input-col {
  flex: 1;
}

.signature-text-input {
  width: 100%;
  height: 54px;
  padding: 10px 22px;
  font-size: 20px;
  border: 2px solid #0f626d;
  border-radius: 30px;
  color: #0a0f1d;
  font-weight: 700;
  transition: all 0.2s;
}

.signature-text-input:focus {
  border-color: #07383f;
  box-shadow: 0 0 14px rgba(15, 98, 109, 0.3);
}

/* Ideas Radio Buttons */
.ytuong-container {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.ytuong-label {
  font-weight: 800;
  font-size: 15px;
  color: #07383f;
  white-space: nowrap;
  padding-top: 6px;
}

.ytuong-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ytuong-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0f7f8;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid #cce5e8;
  transition: all 0.2s;
}

.ytuong-item:hover, .ytuong-item:has(input:checked) {
  background: #136b76;
  color: #ffffff;
  border-color: #136b76;
}

.ytuong-item:has(input:checked) small {
  color: #ffd700;
}

/* --- Signature Cards Grid --- */
.signature-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 25px;
  margin-top: 25px;
}

.signature-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
}

.signature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(19, 107, 118, 0.15);
  border-color: #51b7c5;
}

.signature-card .img {
  position: relative;
  height: 180px;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

.signature-card .svg-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.signature-card .svg-container svg {
  max-width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.signature-card .water_mark {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 5;
}

.signature-card__bottom {
  padding: 12px 16px;
  background: #f8fafc;
  border-top: 1px solid #edf2f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bottom__font-info .font-tag {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.bottom__actions {
  display: flex;
  gap: 8px;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-action.btn-edit {
  background: #e6f4f6;
  color: #136b76;
}

.btn-action.btn-edit:hover {
  background: #136b76;
  color: #fff;
  text-decoration: none;
}

.btn-action.btn-download-quick {
  background: #23393c;
  color: #ffffff;
}

.btn-action.btn-download-quick:hover {
  background: #136b76;
  color: #ffd700;
}

/* --- Loader Spinner --- */
.loadder {
  display: none;
  text-align: center;
  padding: 30px;
  width: 100%;
}

.loadder.active {
  display: block;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e0e0e0;
  border-top-color: #136b76;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- Load More Button Wrap --- */
.loads_them {
  width: 100%;
  text-align: center;
  margin-top: 40px;
}

.btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 40px;
  font-size: 18px;
  text-transform: uppercase;
  font-weight: 800;
  color: #ffffff;
  background: #136b76;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(19, 107, 118, 0.3);
  transition: all 0.3s;
}

.btn-load-more:hover {
  background: #0d4e56;
  color: #ffd700;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(19, 107, 118, 0.4);
}

/* --- Hand Drawing Canvas Pad (Chữ Ký Tay) --- */
.draw-field {
  width: 100%;
  height: 420px;
  margin: 25px 0;
  background: #ffffff;
  border: 2px solid #0f626d;
  border-radius: 12px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
  touch-action: none;
}

.writing-line {
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><line x1="5%" y1="80%" x2="95%" y2="80%" stroke="%23cbd5e1" stroke-width="2" stroke-dasharray="6,6"/></svg>') no-repeat center;
}

.writing-line canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

.draw-controls {
  max-width: 950px;
  margin: 0 auto;
}

.draw-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  background: #ffffff;
  padding: 22px 32px;
  border-radius: 12px;
  margin-bottom: 25px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.control-label {
  font-size: 16px;
  font-weight: 800;
  color: #0a0f1d !important;
  letter-spacing: -0.01em;
}

.control-label strong {
  color: #07383f;
  font-weight: 800;
}

.color-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.color-btn {
  cursor: pointer;
  display: inline-flex;
}

.color-btn input {
  display: none;
}

.color-circle {
  display: inline-block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}

.color-btn.active .color-circle, .color-btn:has(input:checked) .color-circle {
  transform: scale(1.25);
  box-shadow: 0 0 0 2.5px #0f626d;
}

.color-picker-input {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
}

.range-control {
  display: flex;
  align-items: center;
  gap: 15px;
}

.slider-range {
  -webkit-appearance: none;
  width: 180px;
  height: 6px;
  background: #cbd5e1;
  border-radius: 5px;
  outline: none;
}

.slider-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0f626d;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.button-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.btn-tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 25px;
  border: none;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-tool.btn-reset {
  background: #ffffff;
  color: #0a0f1d;
  border: 1.5px solid #94a3b8;
}

.btn-tool.btn-reset:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
  transform: translateY(-2px);
}

.btn-tool.btn-zoom {
  background: #e6f4f6;
  color: #07383f;
  border: 1.5px solid #51b7c5;
}

.btn-tool.btn-zoom:hover {
  background: #0f626d;
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-tool.btn-save-primary {
  background: linear-gradient(135deg, #0f626d 0%, #08383e 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 98, 109, 0.35);
}

.btn-tool.btn-save-primary:hover {
  background: linear-gradient(135deg, #08383e 0%, #041f22 100%);
  color: #ffd700;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 98, 109, 0.45);
}

.btn-tool.btn-save-secondary {
  background: #192d30;
  color: #ffffff;
  border: 1.5px solid #0f626d;
}

.btn-tool.btn-save-secondary:hover {
  background: #0f626d;
  color: #ffd700;
  transform: translateY(-2px);
}

.btn-tool.btn-save-svg {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  color: #000000;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.3);
}

.btn-tool.btn-save-svg:hover {
  background: #f59e0b;
  color: #000000;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.4);
}

/* --- Studio Preview Template (/preview) --- */
.preview_head {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 25px;
}

.preview_head h2 {
  font-size: 18px;
  color: #64748b;
  margin-bottom: 5px;
}

.preview_head strong {
  font-size: 32px;
  color: #136b76;
}

.chiase {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 30px;
}

.share-input-wrap {
  position: relative;
  display: flex;
  margin-top: 8px;
}

.share-input-wrap input {
  width: 100%;
  padding: 12px 120px 12px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 15px;
  color: #475569;
  background: #f8fafc;
}

.copy-badge-btn {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  background: #136b76;
  color: #ffffff;
  padding: 0 20px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.copy-badge-btn:hover {
  background: #0d4e56;
  color: #ffd700;
}

.copy-alert {
  margin-top: 10px;
  padding: 10px 15px;
  background: #ecfdf5;
  color: #065f46;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

.preview_sign {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  margin-bottom: 40px;
}

.preview-display-stage {
  min-height: 260px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin: 25px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.03);
}

.stage-svg-wrap {
  width: 100%;
  max-width: 650px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-svg-wrap svg {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

.preview_sign .option {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 25px;
  padding: 25px;
  background: #f8fafc;
  border-radius: 10px;
  margin-bottom: 25px;
}

.option .op span {
  display: block;
  font-weight: 700;
  color: #334155;
  margin-bottom: 10px;
  font-size: 14px;
}

.color-quick-swatches {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.color-quick-swatches .swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.color-quick-swatches .swatch:hover {
  transform: scale(1.2);
}

.select-styled {
  width: 100%;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-weight: 600;
  color: #334155;
}

.pre_ck {
  text-align: center;
  margin-bottom: 25px;
}

.btn-refresh-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 35px;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  background: #136b76;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(19, 107, 118, 0.3);
  transition: all 0.2s;
}

.btn-refresh-preview:hover {
  background: #0d4e56;
  color: #ffd700;
}

.download-suite-wrap {
  text-align: center;
  border-top: 2px dashed #e2e8f0;
  padding-top: 30px;
}

.download_sign {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 45px;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  background: #23393c;
  border: none;
  border-radius: 35px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(35, 57, 60, 0.35);
  transition: all 0.3s;
}

.download_sign:hover {
  background: #136b76;
  color: #ffd700;
  transform: translateY(-2px);
}

.secondary-downloads {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
}

.btn-sub-download {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  color: #475569;
  cursor: pointer;
}

.btn-sub-download:hover {
  background: #e2e8f0;
  color: #136b76;
}

/* Realistic Mockup Document Stage */
.mockup-paper {
  max-width: 650px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #dcdcdc;
  border-radius: 8px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.1);
  padding: 40px;
  position: relative;
}

.doc-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  border-bottom: 2px solid #64748b;
  padding-bottom: 3px;
  margin-bottom: 25px;
}

.doc-line {
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  margin-bottom: 12px;
}

.doc-line.long { width: 90%; }
.doc-line.medium { width: 75%; }
.doc-line.short { width: 50%; }

.mockup-signature-spot {
  margin-top: 50px;
  margin-left: auto;
  width: 250px;
  text-align: center;
}

.sign-role {
  display: block;
  font-size: 12px;
  color: #64748b;
  font-style: italic;
  margin-bottom: 10px;
}

.mockup-svg-wrap {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mockup-svg-wrap svg {
  max-width: 100%;
  max-height: 100%;
}

.signer-printed-name {
  display: block;
  font-size: 14px;
  color: #1e293b;
  margin-top: 8px;
}

/* --- Lightbox Modal Styles --- */
.preview-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  align-items: center;
  justify-content: center;
}

.preview-lightbox .lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(5px);
}

.preview-lightbox .lightbox-modal {
  position: relative;
  z-index: 10;
  background: #ffffff;
  border-radius: 16px;
  padding: 40px 30px 30px;
  max-width: 650px;
  width: 90%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  text-align: center;
  border: 1px solid #e2e8f0;
  margin: auto;
}

.preview-lightbox .lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #f1f5f9;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 38px;
  cursor: pointer;
  color: #334155;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-lightbox .lightbox-close:hover {
  background: #ef4444;
  color: #ffffff;
}

.preview-lightbox .lightbox-svg-display {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 180px;
  padding: 15px;
}

.preview-lightbox .lightbox-svg-display svg {
  max-width: 100%;
  max-height: 280px;
  height: auto;
}

