/* Editor Layout */
.signature-editor-container {
  display: flex;
  width: 100%;
  height: calc(100vh - 70px); 
  background-color: #f8f9fa;
  color: #333;
  position: relative;
  overflow: hidden;
}

/* Sidebar Styles */
.editor-sidebar {
  width: 280px;
  background-color: white;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-sidebar-header {
  padding: 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.editor-sidebar-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.editor-sidebar-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
}

.sidebar-tab {
  flex: 1;
  padding: 0.875rem 0;
  text-align: center;
  background: none;
  border: none;
  font-weight: 600;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s ease;
}

.sidebar-tab:hover {
  color: var(--primary-color);
}

.sidebar-tab.active {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
}

.sidebar-content {
  display: none;
  overflow-y: auto;
  height: 100%;
  padding: 1rem;
}

.sidebar-content.active {
  display: block;
}

/* Blocks Panel */
.blocks-category {
  margin-bottom: 1.5rem;
}

.blocks-category h4 {
  font-size: 0.875rem;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.blocks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.block-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0.5rem;
  border-radius: 0.375rem;
  background-color: #f9fafb;
  cursor: move;
  transition: all 0.2s ease;
  text-align: center;
}

.block-item:hover {
  background-color: #eef1f6;
  transform: translateY(-2px);
}

.block-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.block-item span {
  font-size: 0.75rem;
  font-weight: 500;
  color: #4b5563;
}

/* Templates Panel */
.template-category {
  margin-bottom: 1.5rem;
}

.template-category h4 {
  font-size: 0.875rem;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.template-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.template-item:hover {
  transform: translateY(-2px);
}

.template-preview {
  width: 100%;
  height: 120px;
  border-radius: 0.375rem;
  overflow: hidden;
  margin-bottom: 0.5rem;
  border: 1px solid #e5e7eb;
}

.template-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.template-item span {
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563;
}

/* Uploads Panel */
.uploads-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border: 2px dashed #d1d5db;
  border-radius: 0.5rem;
  background-color: #f9fafb;
  transition: all 0.2s ease;
}

.upload-dropzone:hover {
  border-color: var(--primary-color);
}

.upload-dropzone svg {
  color: #9ca3af;
  margin-bottom: 1rem;
}

.upload-dropzone p {
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563;
  margin-bottom: 0.5rem;
}

.upload-dropzone span {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.upload-btn {
  padding: 0.5rem 1rem;
  background-color: white;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.uploaded-files h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 0.75rem;
}

.files-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

/* Main Editor */
.editor-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background-color: white;
  border-bottom: 1px solid #e5e7eb;
}

.editor-toolbar-left,
.editor-toolbar-right {
  display: flex;
  align-items: center;
}

.editor-actions {
  display: flex;
  gap: 0.5rem;
}

.editor-action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s ease;
}

.editor-action-btn:hover {
  background-color: #f3f4f6;
  color: var(--primary-color);
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background-color: #e5e7eb;
  margin: 0 0.5rem;
}

.editor-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.editor-btn-secondary {
  background-color: white;
  border: 1px solid #d1d5db;
  color: #4b5563;
}

.editor-btn-secondary:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.editor-btn-primary {
  background-color: var(--primary-color);
  border: 1px solid var(--primary-color);
  color: white;
  margin-left: 0.75rem;
}

.editor-btn-primary:hover {
  background-color: var(--primary-dark);
}

.editor-canvas-container {
  flex: 1;
  overflow: auto;
  background-color: #f8f9fa;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem;
}

.editor-canvas {
  width: 100%;
  max-width: 600px;
  height: 300px;
  background-color: white;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border-radius: 0.5rem;
}

/* Properties Panel */
.editor-properties {
  width: 300px;
  background-color: white;
  border-left: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.properties-header {
  padding: 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.properties-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.properties-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

/* Modals */
.editor-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.editor-modal.active {
  display: flex;
}

.modal-content {
  background-color: white;
  border-radius: 0.5rem;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.preview-modal-content {
  max-width: 800px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
  line-height: 1;
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  max-height: calc(80vh - 4rem);
}

/* Export Modal */
.export-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.export-option {
  padding: 1.25rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.export-option:hover {
  border-color: var(--primary-color);
  background-color: #f9fafb;
}

.export-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.export-option h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.export-option p {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
}

/* Preview Modal */
.preview-clients-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.75rem;
}

.preview-client-btn {
  padding: 0.5rem 1rem;
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s ease;
}

.preview-client-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.preview-client-btn.active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.preview-container {
  padding: 1.5rem;
  background-color: #f8f9fa;
  border-radius: 0.5rem;
}

.preview-email-mock {
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.preview-email-header {
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.preview-email-subject {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.5rem;
}

.preview-email-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.preview-email-body {
  padding: 1rem;
}

.preview-email-body p {
  margin: 0 0 1rem 0;
  color: #4b5563;
}

.preview-signature-container {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

/* GrapesJS overrides */
.sp-container {
  display: none;
}

.gjs-frame {
  width: 500px;
  height: 300px;
}

.editor-canvas .gjs-editor-cont {
  width: 100%;
  height: 300px;

}
.gjs-one-bg {
  background-color: #f8f9fa !important;
}

.gjs-two-color {
  color: var(--primary-color) !important;
}

.gjs-three-color {
  color: var(--secondary-color) !important;
}

.gjs-four-color {
  color: var(--primary-dark) !important;
}

.gjs-four-color-h:hover {
  color: var(--primary-color) !important;
}

#blocks-panel .gjs-blocks-c {
  padding: 0;
}

#blocks-panel .gjs-block {
  width: calc(33.333% - 8px) !important;
  margin: 0 4px 8px 4px !important;
  min-height: 70px !important;
}

.blocks-category-section {
  margin-bottom: 16px;
}

.category-blocks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.block-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 auto 8px;
}

.blocks-grid {
  display: none;
}
