/* ===== tool.css - Professional Tool Styles Only ===== */
/*this css contains all the functions in relation to the visualizing tool
/* ===== PROFESSIONAL TOOL VARIABLES ===== */
:root {
  --tool-primary: #e60023;
  --tool-primary-dark: #d50c22;
  --tool-secondary: #ff6b6b;
  --tool-bg: #f8fafc;
  --tool-text: #0f172a;
  --tool-border: #e2e8f0;
  --tool-success: #10b981;
  --tool-danger: #ef4444;
  --tool-warning: #f59e0b;
  
  /* Furnish specific colors */
  --furnish-primary: #10b981;
  --furnish-secondary: #059669;
  --furnish-accent: #34d399;
  --furnish-bg: #ecfdf5;
  --furnish-border: #a7f3d0;
  
  /* Shared colors from general.css */
  --primary-red: #e60023;
  --primary-red-hover: #d50c22;
  --gradient-primary: linear-gradient(135deg, #e60023, #ff6b6b);
  --remove-red: #ff4444;
  --remove-bg: #ffebee;
  --shadow-medium: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-heavy: 0 8px 30px rgba(0,0,0,0.2);
  --shadow-hover: 0 4px 15px rgba(230, 0, 35, 0.3);
  --border-radius: 12px;
}

/* ===== PROFESSIONAL TOOL CONTAINER ===== */
#professional-tool-container {
  position: fixed;
  top: 64px;
  left: 0;
  width: 100%;
  height: calc(100vh - 64px);
  background: #f8fafc;
  z-index: 10000;
  display: none;
  overflow: hidden;
}

#professional-tool-container.active {
  display: block;
}

body.pro-tool-active #professional-tool-container.active {
  top: 120px;
  height: calc(100vh - 120px);
}

/* ===== FLOATING CLOSE BUTTON ===== */
.tool-floating-close {
  position: fixed;
  top: 130px;
  right: 70px;
  width: 44px;
  height: 44px;
  background: var(--tool-primary);
  color: white;
  border: none;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  z-index: 100001;
  transition: all 0.2s ease;
}

.tool-floating-close:hover {
  background: var(--tool-primary-dark);
  transform: scale(1.05);
}

body.pro-tool-active .tool-floating-close {
  display: flex;
}

/* Hide floating close button on mobile since we have X in canvas controls */
@media (max-width: 900px) {
  .tool-floating-close {
    display: none !important;
  }
}

/* ===== MOBILE BACK BUTTON ===== */
.mobile-back-button {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--tool-primary);
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 14px;
  display: none;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(230, 0, 35, 0.5);
  z-index: 10002;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.mobile-back-button.show {
  display: flex;
}

/* ===== MOBILE TOGGLE / CLOSE BUTTONS ===== */
.mobile-toggle-left,
.mobile-toggle-right {
  display: none;
  background: var(--tool-primary);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(230, 0, 35, 0.3);
  transition: all 0.2s;
  z-index: 10002;
}

.mobile-toggle-left:hover,
.mobile-toggle-right:hover {
  background: var(--tool-primary-dark);
  transform: scale(1.05);
}

/* On mobile, both toggle buttons are visible */
@media (max-width: 900px) {
  .mobile-toggle-left,
  .mobile-toggle-right {
    display: flex !important;
  }
}

/* On desktop, only right toggle is visible (for sidebar) */
@media (min-width: 901px) {
  .mobile-toggle-left {
    display: none !important;
  }
  
  .mobile-toggle-right {
    display: flex !important;
  }
}

/* ===== TOOL EDITOR ===== */
.tool-editor {
  display: grid;
  grid-template-columns: 280px 1fr 300px;
  height: 100%;
  background: #f8fafc;
}

/* ===== TOOL SIDEBAR ===== */
.tool-sidebar {
  background: white;
  overflow-y: auto;
  padding: 20px;
  scrollbar-width: thin;
  transition: transform 0.3s ease;
  z-index: 10001;
}

.tool-sidebar.left {
  border-right: 1px solid var(--tool-border);
}

.tool-sidebar.right {
  border-left: 1px solid var(--tool-border);
}

/* Hide right sidebar on mobile */
@media (max-width: 900px) {
  .tool-sidebar.right {
    display: none;
  }
}

/* ===== TOOL GROUP ===== */
.tool-group {
  margin-bottom: 28px;
}

.tool-group h4 {
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #334155;
}

/* ===== COLOR LAB SECTION ===== */
.color-lab-section {
  background: linear-gradient(145deg, #e60023, #ff6b6b);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
}

.color-lab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.color-lab-header h4 {
  margin-bottom: 0;
  color: white;
}

.color-lab-toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  background-color: rgba(255,255,255,0.2);
  border-radius: 24px;
  transition: all 0.3s;
  cursor: pointer;
}

.color-lab-toggle-switch .toggle-slider-small {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255,255,255,0.3);
  border-radius: 24px;
  transition: 0.4s;
}

.color-lab-toggle-switch .toggle-slider-small:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}

.color-lab-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.color-lab-toggle-switch input:checked + .toggle-slider-small {
  background-color: #ffd700;
}

.color-lab-toggle-switch input:checked + .toggle-slider-small:before {
  transform: translateX(26px);
}

.app-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.app-option {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
}

.app-option:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #ffd700;
}

.app-option.selected {
  background: #ffd700;
  color: #333;
  border-color: #ffd700;
}

.specific-prompt {
  margin: 10px 0;
}

.specific-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  font-size: 13px;
  resize: vertical;
  color: white;
}

.custom-palette {
  display: flex;
  height: 44px;
  margin: 12px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.custom-color {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
}

.custom-color input[type="color"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.add-color {
  background: rgba(255,255,255,0.2);
  color: white;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
}

.add-color:hover {
  background: #ffd700;
  color: #333;
}

.apply-to-prompt-btn {
  width: 100%;
  padding: 10px;
  background: rgba(255, 215, 0, 0.2);
  border: 1px solid #ffd700;
  border-radius: 30px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.apply-to-prompt-btn:hover {
  background: #ffd700;
  color: #333;
}

/* ===== LIGHTING OPTIONS ===== */
.lighting-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.lighting-option {
  padding: 8px;
  background: #f8fafc;
  border: 1px solid var(--tool-border);
  border-radius: 6px;
  text-align: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.lighting-option:hover {
  border-color: var(--primary-red);
}

.lighting-option.selected {
  background: var(--primary-red);
  color: white;
  border-color: var(--primary-red);
}

/* ===== ROOM OPTIONS ===== */
.room-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.room-option {
  padding: 8px;
  background: #f8fafc;
  border: 1px solid var(--tool-border);
  border-radius: 6px;
  text-align: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.room-option:hover {
  border-color: var(--primary-red);
}

.room-option.selected {
  background: var(--primary-red);
  color: white;
  border-color: var(--primary-red);
}

.custom-room-prompt {
  margin-top: 10px;
}

.custom-prompt-input {
  width: 100%;
  min-height: 60px;
  padding: 10px;
  border: 1px solid var(--tool-border);
  border-radius: 6px;
  font-size: 12px;
  resize: vertical;
  font-family: inherit;
}

/* ===== REFERENCE CONTAINER ===== */
.references-container-modern {
  background: #f8fafc;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--tool-border);
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.reference-slot {
  aspect-ratio: 1/1;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #ffffff;
  position: relative;
  overflow: hidden;
}

.reference-slot.filled {
  border: 2px solid var(--tool-primary);
}

.reference-slot:hover {
  border-color: var(--tool-primary);
  background: #f0f9ff;
}

.reference-slot i {
  font-size: 24px;
  color: #94a3b8;
  margin-bottom: 5px;
}

.reference-slot span {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.reference-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.reference-remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: var(--remove-red);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  z-index: 10;
}

.reference-count {
  background: var(--tool-primary);
  color: white;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  margin-left: 8px;
}

.reference-prompt-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.ref-tab {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 30px;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.ref-tab.active {
  background: var(--tool-primary);
  color: white;
}

.reference-prompt-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 13px;
  resize: vertical;
  min-height: 80px;
}

/* ===== FURNISH PRODUCTS ===== */
.furnish-empty {
  text-align: center;
  padding: 32px 16px;
  color: #64748b;
  background: #f8fafc;
  border-radius: 12px;
  border: 2px dashed #e2e8f0;
}

.furnish-empty i {
  font-size: 48px;
  margin-bottom: 16px;
  color: #94a3b8;
}

.furnish-empty p {
  margin-bottom: 16px;
  font-size: 14px;
}

.furnish-btn {
  padding: 12px 20px;
  border: none;
  border-radius: 30px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.furnish-btn-primary {
  background: #10b981;
  color: white;
}

.furnish-btn-primary:hover {
  background: #059669;
  transform: translateY(-2px);
}

.furnish-btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.furnish-products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 16px 0;
  max-height: 300px;
  overflow-y: auto;
}

.furnish-product-card {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  position: relative;
}

.furnish-product-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
}

.furnish-product-details {
  flex: 1;
}

.furnish-product-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #1e293b;
}

.furnish-product-price {
  font-size: 14px;
  color: #10b981;
  font-weight: 700;
}

.furnish-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
}

/* ===== DIMENSIONS PANEL ===== */
.dimensions-panel {
  background: #f8fafc;
  border: 1px solid var(--tool-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  margin-top: 10px;
}

.dimensions-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.dimension-item {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}

.dimension-location-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
}

.dimension-size-input {
  width: 100px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
}

.dimension-add {
  background: #f1f5f9;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  padding: 10px;
  width: 100%;
  color: var(--tool-primary);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}

.dimension-add:hover {
  background: #e2e8f0;
}

.dimension-remove {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fee2e2;
  color: #ef4444;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* ===== CANVAS AREA ===== */
.tool-canvas-area {
  position: relative;
  overflow: hidden;
  background: #1e293b;
}

.canvas-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.canvas-header {
  background: white;
  padding: 12px 16px;
  border-bottom: 1px solid var(--tool-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.canvas-controls {
  display: flex;
  gap: 8px;
}

.canvas-controls button {
  background: transparent;
  border: 1px solid var(--tool-border);
  border-radius: 30px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #334155;
  transition: all 0.2s;
}

.canvas-controls button:hover {
  background: #f1f5f9;
  border-color: var(--tool-primary);
  color: var(--tool-primary);
}

.drawing-area {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.base-image-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e293b;
  z-index: 1;
}

#tool-base-image {
  max-width: 100%;
  max-height: 100%;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  margin: auto;
  display: none;
  border-radius: 8px;
}

#tool-main-canvas,
#tool-temp-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

#tool-main-canvas {
  pointer-events: auto;
  cursor: grab;
}

#tool-temp-canvas {
  pointer-events: none;
}

.tool-drop-zone {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  border: 3px dashed var(--tool-primary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 900;
  text-align: center;
  padding: 40px;
  border-radius: 16px;
  cursor: pointer;
}

.tool-drop-zone i {
  font-size: 64px;
  color: var(--tool-primary);
  margin-bottom: 20px;
}

.tool-drop-zone h3 {
  color: #0f172a;
  margin-bottom: 12px;
  font-size: 24px;
  font-weight: 600;
}

.tool-drop-zone p {
  color: #475569;
  margin-bottom: 24px;
  font-size: 16px;
}

#tool-browse-btn {
  background: var(--tool-primary);
  color: white;
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 6px -1px rgba(230, 0, 35, 0.3);
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.canvas-generation-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: white;
}

.canvas-generation-overlay.active {
  display: flex;
}

.canvas-loader {
  text-align: center;
}

.canvas-spinner {
  width: 60px;
  height: 60px;
  border: 5px solid rgba(255,255,255,0.2);
  border-top-color: var(--primary-red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== PROCESS INDICATOR ===== */
.tool-process-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  padding: 6px 16px;
  border-radius: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  border: 1px solid var(--primary-red);
  margin: 0 12px;
  width: fit-content;
}

.tool-process-step {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.5;
  transition: all 0.3s ease;
  font-size: 12px;
  cursor: pointer;
}

.tool-process-step.active {
  opacity: 1;
}

.tool-step-number {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.tool-process-step.active .tool-step-number {
  background: var(--primary-red);
  color: white;
}

.tool-step-label {
  font-weight: 500;
  color: #334155;
  font-size: 12px;
}

.tool-process-arrow {
  color: var(--primary-red);
  font-size: 12px;
}

.tool-status-bar {
  background: white;
  padding: 8px 16px;
  border-top: 1px solid var(--tool-border);
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: #64748b;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== PROCESS PANELS ===== */
.process-panel {
  height: 100%;
  overflow-y: auto;
  padding-bottom: 20px;
}

.process-panel-title {
  font-size: 16px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-red);
  display: flex;
  align-items: center;
  gap: 8px;
}

.process-panel-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-red);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.back-to-step1,
.back-to-step2 {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--primary-red);
  font-weight: 500;
  cursor: pointer;
  padding: 8px 12px;
  margin-bottom: 16px;
  border-radius: 8px;
  transition: all 0.2s;
  font-size: 13px;
  background: rgba(230, 0, 35, 0.05);
  width: fit-content;
}

/* ===== GENERATE BUTTON ===== */
.btn-generate-primary {
  width: 100%;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 16px;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 20px;
  box-shadow: 0 4px 15px rgba(230, 0, 35, 0.4);
}

.btn-generate-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(230, 0, 35, 0.5);
}

.generate-note {
  font-size: 11px;
  color: #64748b;
  text-align: center;
  margin-top: 6px;
}

/* ===== DIRECT PROMPT SECTION ===== */
.direct-prompt-section {
  background: #ffffff;
  border: 1px solid var(--tool-border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
}

.direct-prompt-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.direct-prompt-input {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 13px;
  resize: vertical;
}

/* ===== COMPARE OVERLAY ===== */
.compare-overlay-tool {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.compare-overlay-tool.active {
  display: flex;
}

.compare-container-tool {
  background: white;
  border-radius: 16px;
  padding: 30px;
  max-width: 90%;
  max-height: 90%;
  overflow: auto;
}

.compare-images-tool {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.compare-image-box {
  flex: 1;
  min-width: 250px;
  text-align: center;
}

.compare-image-box img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.close-compare-btn {
  display: block;
  margin: 0 auto;
  padding: 12px 30px;
  background: var(--tool-primary);
  color: white;
  border: none;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
}

/* ===== VARIATIONS MODAL ===== */
.variations-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 200000;
  display: none;
  align-items: center;
  justify-content: center;
}

.variations-modal.active {
  display: flex;
}

.variations-container {
  width: 90%;
  max-width: 900px;
  background: white;
  border-radius: 16px;
  padding: 20px;
  max-height: 90vh;
  overflow-y: auto;
}

.variations-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.variations-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .variations-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.variation-card {
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  aspect-ratio: 1/1;
}

.variation-card.selected {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(230, 0, 35, 0.3);
}

.variation-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.variations-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.variations-btn {
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
}

.variations-btn.primary {
  background: var(--primary-red);
  color: white;
}

.variations-btn.secondary {
  background: #f1f5f9;
  color: #334155;
}

/* ===== AD MODAL ===== */
.ad-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 200000;
  display: none;
  align-items: center;
  justify-content: center;
}

.ad-modal.active {
  display: flex;
}

.ad-container {
  position: relative;
  width: 90%;
  max-width: 800px;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
}

.ad-video {
  width: 100%;
  display: block;
}

.ad-timer {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
}

.ad-skip-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: var(--primary-red);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}

.ad-skip-btn.visible {
  opacity: 1;
  pointer-events: all;
}

.ad-close-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
}

/* ===== THANK YOU MODAL ===== */
.thankyou-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200000;
  display: none;
  align-items: center;
  justify-content: center;
}

.thankyou-modal.active {
  display: flex;
}

.thankyou-container {
  background: linear-gradient(135deg, #667eea, #764ba2, #e84393);
  border-radius: 24px;
  padding: 40px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  position: relative;
  z-index: 200001;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.thankyou-emoji {
  font-size: 80px;
  margin-bottom: 20px;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.thankyou-container h2 {
  color: white;
  font-size: 24px;
  margin-bottom: 15px;
}

.thankyou-btn {
  background: white;
  color: #333;
  border: none;
  padding: 14px 30px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
}

.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 200000;
}

/* ===== FLOATING TOOLBAR - ONLY ON MOBILE WHEN TOOL ACTIVE ===== */
.tool-floating-toolbar {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 40px;
  padding: 10px 18px;
  display: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  z-index: 10001;
  border: 1px solid var(--tool-border);
}

/* Show floating toolbar ONLY when tool is active AND on mobile screens */
body.pro-tool-active .tool-floating-toolbar {
  display: flex;
}

/* Hide on desktop (screens wider than 900px) - never show on desktop */
@media (min-width: 901px) {
  .tool-floating-toolbar {
    display: none !important;
  }
}

/* Mobile styles (max-width: 900px) - show when tool active */
@media (max-width: 900px) {
  body.pro-tool-active .tool-floating-toolbar {
    display: flex;
    bottom: 20px;
    padding: 6px 12px;
  }
  
  .toolbar-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

@media (max-width: 600px) {
  body.pro-tool-active .tool-floating-toolbar {
    bottom: 15px;
    padding: 5px 10px;
  }
  
  .toolbar-btn {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }
  
  .toolbar-divider {
    margin: 0 4px;
  }
}

.toolbar-inner {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: center;
}

.toolbar-btn {
  width: 48px;
  height: 48px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #000000 !important;
  background: transparent;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.toolbar-btn:hover {
  color: var(--tool-primary) !important;
  background: #f0f0f0;
}

.toolbar-btn.generate-btn {
  background: var(--gradient-primary);
  color: white !important;
}

.toolbar-btn.generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(230, 0, 35, 0.3);
}

.toolbar-divider {
  width: 1px;
  height: 30px;
  background: var(--tool-border);
  margin: 0 8px;
}

/* ===== RIGHT AD BANNER INSIDE TOOL ===== */
.right-ad-banner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 10px 0;
  height: 100%;
  overflow-y: auto;
}

.right-ad-banner .vertical-ad-item {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.right-ad-banner .vertical-ad-item:hover {
  transform: translateY(-3px);
}

.right-ad-banner .vertical-ad-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== MODAL (TOOL) ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 24px;
  padding: 30px;
  width: 400px;
  max-width: 90%;
  position: relative;
  text-align: center;
}

.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-btn {
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  border: none;
}

.modal-btn-primary {
  background: var(--tool-primary);
  color: white;
}

.modal-btn-secondary {
  background: #f1f5f9;
  color: #475569;
}

.modal .close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 20px;
  cursor: pointer;
  color: #94a3b8;
}

/* ===== PRODUCT BUY BUTTON ===== */
.product-buy-btn {
  margin-top: 8px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #e60023, #ff6b6b);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.product-buy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(230, 0, 35, 0.3);
}

/* ===== PREVIEW PRODUCTS GRID ===== */
.preview-products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 10px 0;
}

.preview-product-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  transition: transform 0.2s;
}

.preview-product-card:hover {
  transform: translateY(-2px);
  border-color: #10b981;
}

.preview-product-card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 6px;
}

.preview-product-name {
  font-size: 11px;
  font-weight: 500;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-product-price {
  font-size: 12px;
  font-weight: 600;
  color: #10b981;
}

.preview-clear-btn {
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 30px;
  color: #ef4444;
  font-size: 12px;
  cursor: pointer;
}

/* ===== RESPONSIVE DESIGN FOR TOOL ===== */
@media (max-width: 900px) {
  .tool-editor {
    grid-template-columns: 1fr;
  }
  
  .tool-sidebar.left {
    position: fixed;
    top: 64px;
    width: 85%;
    max-width: 320px;
    height: calc(100vh - 64px);
    z-index: 10002;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 20px rgba(0,0,0,0.2);
    background: white;
    overflow-y: auto;
    left: 0;
    transform: translateX(-100%);
  }
  
  body.pro-tool-active .tool-sidebar.left {
    top: 120px;
    height: calc(100vh - 120px);
  }
  
  .tool-sidebar.left.active {
    transform: translateX(0);
  }
  
  .canvas-controls button span {
    display: none;
  }
  
  .canvas-controls button {
    padding: 8px;
  }
  
  .tool-process-indicator {
    padding: 4px 12px;
  }
  
  .tool-step-label {
    font-size: 10px;
  }
}

@media (max-width: 600px) {
  .tool-process-step .tool-step-label {
    display: none;
  }
  
  .mobile-back-button {
    bottom: 70px;
    padding: 10px 20px;
    font-size: 13px;
  }
  
  .variations-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .variations-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .variations-btn {
    width: 100%;
  }
  
  .dimension-item {
    flex-wrap: wrap;
  }
  
  .dimension-size-input {
    width: 80px;
  }
  
  .reference-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .tool-step-number {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }
  
  .canvas-controls button {
    padding: 6px;
  }
  
  .tool-status-bar {
    padding: 4px 8px;
    font-size: 10px;
    gap: 8px;
  }
  
  .thankyou-container {
    padding: 30px;
  }
  
  .thankyou-emoji {
    font-size: 60px;
  }
  
  .thankyou-container h2 {
    font-size: 20px;
  }
}

/* ===== FIXED THANK YOU MODAL CENTERING ===== */
.thankyou-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 200000;
  display: none;
  align-items: center;
  justify-content: center;
}

.thankyou-modal.active {
  display: flex;
}

.thankyou-container {
  position: relative;
  z-index: 200001;
  background: linear-gradient(135deg, #667eea, #764ba2, #e84393);
  border-radius: 24px;
  padding: 40px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin: 0 auto;
}

/* Make sure the canvas doesn't interfere with modal positioning */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 200000;
}

/* Ensure the thank you content is properly centered */
.thankyou-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  .thankyou-container {
    padding: 30px 20px;
    max-width: 320px;
    width: 85%;
  }
  
  .thankyou-emoji {
    font-size: 60px;
  }
  
  .thankyou-container h2 {
    font-size: 22px;
    margin-bottom: 15px;
  }
  
  .thankyou-btn {
    padding: 12px 24px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .thankyou-container {
    padding: 25px 16px;
    max-width: 280px;
    width: 90%;
  }
  
  .thankyou-emoji {
    font-size: 50px;
    margin-bottom: 12px;
  }
  
  .thankyou-container h2 {
    font-size: 20px;
    margin-bottom: 12px;
  }
  
  .thankyou-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* Ensure proper centering on very small devices */
@media (max-width: 360px) {
  .thankyou-container {
    padding: 20px 12px;
    max-width: 260px;
  }
  
  .thankyou-emoji {
    font-size: 45px;
  }
  
  .thankyou-container h2 {
    font-size: 18px;
  }
}