/* ==========================================================================
   Signature Resizer — Modern, Minimal & Fully Responsive Stylesheet
   Inherits full-width glassmorphism, glowing mesh orbs & cards from tools.css
   Supported Breakpoints: 320px, 375px, 430px, 768px, 1024px, 1280px+
   ========================================================================== */

/* --- Dropzone Base & Responsive Ergonomics --- */
.dropzone {
  position: relative;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px dashed rgba(26, 53, 102, 0.22);
  border-radius: 24px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-sizing: border-box;
}

.dropzone:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--royal, #1a3566);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(26, 53, 102, 0.08);
}

.dropzone.dragover,
.dropzone.drag-active {
  background: rgba(238, 246, 255, 0.95);
  border-color: #2563eb;
  border-style: solid;
  transform: scale(1.01);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.15), 0 20px 40px rgba(37, 99, 235, 0.12);
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.dz-content {
  position: relative;
  z-index: 5;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dz-icon-wrapper {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: linear-gradient(135deg, #1a3566 0%, #2563eb 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 12px 24px rgba(26, 53, 102, 0.22);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.dropzone:hover .dz-icon-wrapper {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.35);
}

.dz-icon-wrapper svg {
  width: 38px;
  height: 38px;
}

.dropzone h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.dropzone p {
  font-size: 15px;
  color: var(--slate-600, #475569);
  margin-bottom: 18px;
  line-height: 1.5;
  max-width: 480px;
}

.dz-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  max-width: 100%;
}

.dz-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(26, 53, 102, 0.06);
  border: 1px solid rgba(26, 53, 102, 0.1);
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--royal, #1a3566);
  white-space: nowrap;
}

.dz-chip i {
  font-size: 12px;
  flex-shrink: 0;
}

.dz-btn {
  pointer-events: auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(26, 53, 102, 0.22);
}

/* --- Processing Panel Entrance --- */
.process-panel {
  animation: sigFadeIn 0.3s ease-out;
}

@keyframes sigFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Studio Grid Layout --- */
.sig-studio-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* --- Viewport & Cropper Hero Column (Left on Desktop, Top on Mobile) --- */
.sig-studio-viewport {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.sig-cropper-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
  width: 100%;
  box-sizing: border-box;
}

.sig-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  white-space: nowrap;
}

.sig-title-group i {
  color: var(--royal, #1a3566);
}

.sig-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 100%;
}

.sig-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.sig-tool-btn:hover {
  border-color: var(--royal, #1a3566);
  color: var(--royal, #1a3566);
  background: rgba(26, 53, 102, 0.04);
}

.sig-cropper-stage {
  width: 100%;
  height: 340px;
  background: #0f172a;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}

.sig-cropper-stage img {
  display: block;
  max-width: 100%;
}

.cropper-container {
  width: 100% !important;
  height: 100% !important;
}

/* Compliance Status Pill Bar */
.sig-live-pill-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

.sig-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  color: #059669;
  white-space: nowrap;
}

.sig-hint-text {
  font-size: 11.5px;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* --- Studio Settings Column (Right on Desktop, Bottom on Mobile) --- */
.sig-studio-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.sig-panel-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.sig-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(241, 245, 249, 0.7);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.sig-panel-header h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--royal-dark, #122549);
  margin: 0;
  letter-spacing: -0.01em;
}

.sig-panel-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}

.sig-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.sig-field label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--slate-700, #334155);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sig-dim-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.sig-dim-grid > div {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.sig-dim-grid input.form-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px 10px;
  font-size: 13.5px;
  font-weight: 700;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  text-align: center;
  color: var(--royal-dark, #122549);
}

.sig-dim-grid input.form-input:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.aspect-link-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.aspect-link-btn.active {
  background: var(--royal, #1a3566);
  border-color: var(--royal, #1a3566);
  color: #ffffff;
}

/* Segmented Pills */
.segmented-control {
  display: flex;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 10px;
  gap: 3px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.segment-btn {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 8px 4px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.segment-btn.active {
  background: #ffffff;
  color: var(--royal, #1a3566);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* --- File Details Bar --- */
.file-info {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
  margin-bottom: 20px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.file-icon-box {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1a3566 0%, #2563eb 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 18px;
  box-shadow: 0 6px 14px rgba(26, 53, 102, 0.22);
  flex-shrink: 0;
}

.file-details {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.file-details h4 {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin: 0 0 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-details p {
  font-size: 12.5px;
  color: #64748b;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-icon {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-icon:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #ef4444;
  transform: scale(1.05);
}

/* --- Action Footer --- */
.action-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  margin-top: 8px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.selection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--slate-700, #334155);
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.l2-btn-ghost {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #475569;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.l2-btn-ghost:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: var(--royal-dark, #122549);
}

.l2-btn-primary {
  background: linear-gradient(135deg, #1a3566 0%, #2563eb 100%);
  border: none;
  color: #ffffff;
  padding: 11px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 18px rgba(26, 53, 102, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.l2-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.l2-btn-primary:active {
  transform: translateY(0);
}

/* Cropper JS Overrides */
.cropper-view-box,
.cropper-face {
  border-radius: 0;
}

.cropper-view-box {
  outline: 2px solid #2563eb !important;
  outline-color: rgba(37, 99, 235, 0.9) !important;
}

.cropper-line,
.cropper-point {
  background-color: #2563eb !important;
}

/* Hidden elements */
.hidden {
  display: none !important;
}

/* ==========================================================================
   Comprehensive Responsive Breakpoints (Mobile, Tablet, Desktop)
   ========================================================================== */

/* --- Tablet (max-width: 992px) --- */
@media (max-width: 992px) {
  .sig-studio-layout {
    grid-template-columns: 1fr !important;
    gap: 18px;
  }

  .sig-cropper-stage {
    height: 280px;
  }

  .action-footer {
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
    text-align: center;
  }

  .action-buttons {
    flex-direction: column;
    width: 100%;
  }

  .action-buttons .l2-btn-ghost,
  .action-buttons .l2-btn-primary {
    width: 100%;
  }
}

/* --- Mobile Devices (max-width: 640px) --- */
@media (max-width: 640px) {
  .tool-workspace {
    padding: 10px 8px !important;
    overflow-x: hidden !important;
  }

  .tool-container {
    padding: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .glass-card {
    padding: 14px 12px !important;
    border-radius: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .tool-header h1 {
    font-size: 24px !important;
  }

  .tool-header p {
    font-size: 13px !important;
    margin-bottom: 12px !important;
  }

  .tool-badge {
    font-size: 11px;
    padding: 4px 10px;
    gap: 5px;
    margin-bottom: 10px;
  }

  .dropzone {
    padding: 20px 12px 18px !important;
    border-radius: 14px !important;
  }

  .dz-icon-wrapper {
    width: 50px !important;
    height: 50px !important;
    border-radius: 14px !important;
    margin-bottom: 10px !important;
  }

  .dz-icon-wrapper svg {
    width: 26px !important;
    height: 26px !important;
  }

  .dropzone h3 {
    font-size: 16px !important;
    margin-bottom: 4px !important;
  }

  .dropzone p {
    font-size: 12px !important;
    margin-bottom: 10px !important;
  }

  .dz-chips {
    gap: 5px !important;
    margin-bottom: 12px !important;
  }

  .dz-chip {
    font-size: 10px !important;
    padding: 3px 7px !important;
    gap: 3px !important;
  }

  .dz-btn {
    width: 100% !important;
    max-width: 240px !important;
    font-size: 13.5px !important;
    padding: 10px 16px !important;
    border-radius: 10px !important;
  }

  .sig-studio-viewport {
    padding: 12px !important;
    border-radius: 16px !important;
    gap: 10px !important;
  }

  .sig-cropper-stage {
    height: 220px !important;
  }

  .sig-cropper-header {
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .sig-title-group {
    font-size: 13px !important;
  }

  .sig-toolbar {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    gap: 3px !important;
  }

  .sig-tool-btn {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 4px 2px !important;
    font-size: 10px !important;
    height: 28px !important;
  }

  .sig-live-pill-bar {
    flex-direction: column;
    align-items: stretch !important;
    gap: 6px !important;
  }

  .sig-status-badge {
    width: 100% !important;
    justify-content: center;
    font-size: 11px !important;
    padding: 4px 6px !important;
  }

  .sig-hint-text {
    justify-content: center;
    text-align: center;
    font-size: 10.5px !important;
  }

  .sig-panel-card {
    border-radius: 16px !important;
  }

  .sig-panel-header {
    padding: 10px 14px !important;
  }

  .sig-panel-body {
    padding: 12px 12px !important;
    gap: 12px !important;
  }

  .sig-dim-grid {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
    gap: 6px !important;
  }

  .aspect-link-btn {
    width: 34px !important;
    height: 34px !important;
    border-radius: 8px !important;
  }

  .file-info {
    padding: 10px 12px !important;
    gap: 10px !important;
    border-radius: 12px !important;
    margin-bottom: 14px !important;
  }

  .file-icon-box {
    width: 36px !important;
    height: 36px !important;
    font-size: 16px !important;
    border-radius: 8px !important;
  }

  .file-details h4 {
    font-size: 13px !important;
  }

  .file-details p {
    font-size: 11px !important;
  }

  .btn-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
  }

  .action-footer {
    padding: 12px 12px !important;
    border-radius: 14px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .action-buttons .btn,
  .action-buttons .l2-btn-ghost,
  .action-buttons .l2-btn-primary {
    width: 100%;
    justify-content: center;
    font-size: 13.5px;
    padding: 10px 14px;
    border-radius: 10px;
    min-height: 42px;
  }
}

/* --- Small Mobile (max-width: 380px) --- */
@media (max-width: 380px) {
  .dropzone {
    padding: 16px 8px 14px !important;
  }

  .dz-chip {
    font-size: 9px !important;
    padding: 2px 5px !important;
  }

  .sig-cropper-stage {
    height: 190px !important;
  }
}

