/* ==================== SIGNATURE MANAGER STYLES ==================== */

/* Modal Overlay */
.sig-manager-modal,
.sig-editor-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sig-manager-overlay,
.sig-editor-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
}

/* Main Content */
.sig-manager-content,
.sig-editor-content {
  position: relative;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideInFromBottom 0.3s ease-out;
}

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

/* Header */
.sig-manager-header,
.sig-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.sig-manager-header h2,
.sig-editor-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
}

.sig-close-btn {
  background: transparent;
  border: none;
  font-size: 32px;
  color: #64748b;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
  line-height: 1;
}

.sig-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Outlook Note */
.sig-outlook-note {
  margin: 20px 28px;
  padding: 16px;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.sig-note-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.sig-outlook-note strong {
  display: block;
  margin-bottom: 4px;
  color: #92400e;
  font-size: 14px;
}

.sig-outlook-note p {
  margin: 0;
  font-size: 13px;
  color: #78350f;
  line-height: 1.5;
}

/* New Signature Button */
.sig-new-btn {
  margin: 0 28px 20px;
  padding: 12px 24px;
  background: #1e293b;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.sig-new-btn:hover {
  background: #334155;
  transform: translateY(-1px);
}

/* Signature List */
.sig-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 0 28px 28px;
}

.sig-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  transition: all 0.2s;
}

.sig-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sig-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.sig-card-header h3 {
  margin: 0 0 8px 0;
  font-size: 17px;
  font-weight: 600;
  color: #1e293b;
}

.sig-role-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  margin-right: 6px;
}

.sig-role-badge.wfn {
  background: #dbeafe;
  color: #1e40af;
}

.sig-role-badge.ts {
  background: #e9d5ff;
  color: #6b21a8;
}

.sig-role-badge.both {
  background: #d1fae5;
  color: #065f46;
}

.sig-default-badge {
  display: inline-block;
  padding: 4px 10px;
  background: #fbbf24;
  color: #78350f;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.sig-card-actions {
  display: flex;
  gap: 8px;
}

.sig-edit-btn {
  padding: 6px 16px;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
}

.sig-edit-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.sig-delete-btn {
  padding: 6px 12px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.sig-delete-btn:hover {
  background: #fecaca;
  border-color: #fca5a5;
}

/* Signature Preview */
.sig-preview {
  padding: 16px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.sig-preview-image {
  max-width: 150px;
  max-height: 80px;
  object-fit: contain;
  margin-bottom: 12px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.sig-preview pre {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #334155;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ==================== EDITOR STYLES ==================== */

.sig-editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.sig-form-group {
  margin-bottom: 24px;
}

.sig-form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #334155;
}

.sig-input,
.sig-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: all 0.2s;
}

.sig-input:focus,
.sig-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.sig-textarea {
  resize: vertical;
  min-height: 120px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
}

/* Image Upload */
.sig-image-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.sig-upload-btn {
  padding: 10px 20px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sig-upload-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.sig-remove-image-btn {
  padding: 10px 16px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.sig-remove-image-btn:hover {
  background: #fecaca;
}

.sig-image-hint {
  margin: 0 0 12px 0;
  font-size: 12px;
  color: #64748b;
}

.sig-image-preview {
  padding: 20px;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  text-align: center;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sig-image-preview img {
  max-width: 200px;
  max-height: 150px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.sig-image-preview p {
  margin: 0;
  color: #94a3b8;
  font-size: 14px;
}

/* Checkbox */
.sig-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500 !important;
  cursor: pointer;
}

.sig-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Footer */
.sig-editor-footer {
  padding: 20px 28px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

.sig-cancel-btn,
.sig-save-btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.sig-cancel-btn {
  background: white;
  border: 1px solid #cbd5e1;
  color: #475569;
}

.sig-cancel-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.sig-save-btn {
  background: #3b82f6;
  color: white;
  border: none;
}

.sig-save-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
  .sig-manager-content,
  .sig-editor-content {
    width: 95%;
    max-height: 90vh;
  }
  
  .sig-manager-header,
  .sig-editor-header,
  .sig-outlook-note,
  .sig-new-btn,
  .sig-list-container,
  .sig-editor-body,
  .sig-editor-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .sig-card-header {
    flex-direction: column;
    gap: 12px;
  }
  
  .sig-card-actions {
    width: 100%;
  }
  
  .sig-edit-btn {
    flex: 1;
  }
  
  .sig-image-controls {
    flex-direction: column;
  }
  
  .sig-upload-btn,
  .sig-remove-image-btn {
    width: 100%;
    justify-content: center;
  }
}
