/* Mini Editor Export Drawer Styles - Light Theme */

/* Drawer base structure */
.mini-editor-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
}

.mini-editor-drawer[data-drawer-state="open"] {
  pointer-events: auto;
}

.mini-editor-drawer .drawer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0);
  transition: background-color 0.3s ease;
}

.mini-editor-drawer[data-drawer-state="open"] .drawer-overlay {
  background-color: rgba(0, 0, 0, 0.18);
}

.mini-editor-drawer .drawer-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  display: flex;
  justify-content: center;
}

.mini-editor-drawer .drawer-content {
  position: relative;
  width: calc(100% - 32px);
  max-width: 1200px;
  bottom: auto;
  top: 0;
  transform: translateY(-100%);
  border-radius: 0 0 34px 34px;
  display: flex;
  flex-direction: column;
  background: #fff;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.mini-editor-drawer[data-drawer-state="open"] .drawer-content {
  transform: translateY(0);
}

/* Move handle to bottom for top drawer */
.mini-editor-drawer .drawer-handle {
  order: 2;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 14px 0;
  cursor: grab;
  background: #f9f9f9;
  border-top: 1px solid #E1E4ED;
  flex-shrink: 0;
}

.mini-editor-drawer .drawer-handle:active {
  cursor: grabbing;
}

.mini-editor-drawer .drawer-handle-pill {
  width: 42px;
  height: 5px;
  background: #c2c2c2;
  border-radius: 14px;
}

/* Content inner structure */
.mini-editor-drawer .drawer-content-inner {
  order: 1;
  display: flex;
  flex-direction: column-reverse;
  height: 100%;
  overflow: hidden;
}

.mini-editor-drawer .drawer-inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Header styles */
.mini-editor-drawer .drawer-content-header {
  flex-shrink: 0;
  border-top: 1px solid #E1E4ED;
  border-bottom: none;
  background: #fff;
}

.mini-editor-drawer .drawer-content-header.has-rows {
  flex-direction: column;
  width: 100%;
  align-items: flex-start;
  padding: 0;
}

.mini-editor-drawer .drawer-content-header-row {
  padding: 16px 32px;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
}

.mini-editor-drawer .drawer-content-header-row:not(:last-child) {
  border-bottom: 1px solid #E1E4ED;
}

.mini-editor-drawer .drawer-content-header h2 {
  color: rgb(25, 31, 31);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.mini-editor-drawer .download-count {
  color: #888;
  font-weight: 500;
}

/* Export preview area */
.mini-editor-export-preview {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f5f5f5;
  position: relative;
  padding: 20px;
}

.mini-editor-export-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  /* Light checkerboard background for transparency */
  background-color: #fff;
  background-image: linear-gradient(45deg, #e8e8e8 25%, transparent 25%),
                    linear-gradient(-45deg, #e8e8e8 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #e8e8e8 75%),
                    linear-gradient(-45deg, transparent 75%, #e8e8e8 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

/* Export buttons - matching mini editor style */
.mini-editor-drawer .export-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.mini-editor-drawer .export-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mini-editor-drawer .export-button {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  height: 40px;
  font-size: 14px;
  padding: 0 18px;
  border-radius: 10px;
  transition: all 0.2s ease;
  font-family: inherit;
  user-select: none;
  -webkit-user-select: none;
}

/* Copy button - orange style */
.mini-editor-drawer #mini-copy-to-clipboard {
  background-color: rgb(255 165 0 / 60%);
  border: 1px solid rgb(204 132 0 / 50%);
  color: rgb(25, 31, 31);
}

.mini-editor-drawer #mini-copy-to-clipboard:hover {
  background-color: rgb(255 165 0 / 70%);
}

.mini-editor-drawer #mini-copy-to-clipboard:active {
  background-color: rgb(255 165 0 / 80%);
}

/* Save button - green download style like mini editor */
.mini-editor-drawer #mini-save-image {
  background-color: rgb(0 255 106 / 60%);
  border: 1px solid rgb(0 204 85 / 50%);
  color: rgb(25, 31, 31);
}

.mini-editor-drawer #mini-save-image:hover {
  background-color: rgb(0 255 106 / 70%);
}

.mini-editor-drawer #mini-save-image:active {
  background-color: rgb(0 255 106 / 80%);
}

.mini-editor-drawer .export-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Loading state */
.mini-editor-drawer .export-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.mini-editor-drawer .export-loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e8e8e8;
  border-top-color: rgb(0, 255, 106);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .mini-editor-drawer .drawer-content {
    width: calc(100% - 12px);
    border-radius: 0 0 24px 24px;
  }

  .mini-editor-drawer .drawer-handle {
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
  }

  .mini-editor-drawer .export-controls {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }
  
  .mini-editor-drawer .export-buttons {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }
  
  .mini-editor-drawer .export-button {
    width: 100%;
    height: 44px;
  }

  .mini-editor-drawer .drawer-content-header-row {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .mini-editor-export-preview {
    padding: 16px;
  }
}
