/* /customizer/styles.css - FAST + NICE STYLE + WORKING PREVIEW + MOBILE OPTIMIZED */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f8fafc;
}

.customizer-container {
  display: flex;
  height: 100vh;
}

.left-panel {
  width: 30%;
  padding: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  overflow-y: auto;
  box-shadow: 2px 0 8px rgba(0,0,0,0.08);
}

.preview-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 10px;
}

/* Fast canvas - nice style but no heavy effects */
canvas {
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-width: 100%;
  height: auto;
}

/* Loading spinner */
.loading-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 10px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Labels */
label {
  display: block;
  margin: 15px 0 5px 0;
  font-weight: bold;
  color: #333;
  font-size: 14px;
}

/* Standard inputs - fast with subtle focus */
input[type="text"], input[type="file"], select, textarea {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 14px;
}

textarea {
  min-height: 82px;
  resize: vertical;
  line-height: 1.45;
}

.text-case-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: -2px 0 8px;
}

.text-case-actions button {
  margin: 0;
  padding: 8px 6px;
  border: 1px solid #d8e1ea;
  border-radius: 6px;
  background: #fff;
  color: #314155;
  font-size: 12px;
  font-weight: 700;
}

.text-case-actions button:hover,
.text-case-actions button.is-active {
  background: #eef8fc;
  border-color: #7bc6e3;
  color: #005a87;
}

.dashboard-submit-message {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #b7e4c7;
  border-radius: 6px;
  background: #f0fdf4;
  color: #166534;
  font-size: 13px;
  line-height: 1.45;
}

.dashboard-submit-message.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

input[type="text"]:focus, input[type="file"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #007cba;
}

/* Range slider */
input[type="range"] {
  width: 100%;
  margin-bottom: 5px;
}

/* Beautiful color picker - optimized */
input[type="color"] {
  width: 100%;
  height: 45px;
  padding: 4px;
  margin-bottom: 10px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  box-sizing: border-box;
}

input[type="color"]:hover {
  border-color: #007cba;
  box-shadow: 0 2px 6px rgba(0, 124, 186, 0.2);
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border: none;
  border-radius: 4px;
  overflow: hidden;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 4px;
}

/* Buttons - minimal transitions */
button {
  width: 100%;
  padding: 12px;
  background-color: #007cba;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 20px;
  box-sizing: border-box;
}

button:hover {
  background-color: #005a87;
}

/* Dropdown - fast and functional */
.custom-dropdown {
  position: relative;
  width: 100%;
  margin-bottom: 10px;
}

.dropdown-selected {
  width: 100%;
  padding: 8px 30px 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
  cursor: pointer;
  font-size: 14px;
  position: relative;
  box-sizing: border-box;
}

.dropdown-selected:hover {
  border-color: #007cba;
}

.dropdown-selected:after {
  content: "▼";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #666;
}

.dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 200px;
  overflow-y: auto;
  display: none !important;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dropdown-option {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 14px;
}

.dropdown-option:hover {
  background-color: #f5f5f5;
}

.dropdown-option img {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  border-radius: 2px;
  object-fit: cover;
  background: #edf2f7;
}

.custom-dropdown.open .dropdown-options {
  display: block !important;
}

/* Force dropdown styling - keep original functionality */
.custom-dropdown .dropdown-selected {
  width: 100% !important;
  padding: 8px 30px 8px 12px !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
  background-color: white !important;
  cursor: pointer !important;
  font-size: 14px !important;
  box-sizing: border-box !important;
  display: block !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
  body {
    padding: 0;
    margin: 0;
    overflow-x: hidden;
  }
  
  .customizer-container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
  }
  
  .preview-panel {
    order: 1;
    width: 100%;
    padding: 25px 15px;
    min-height: 55vh;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box;
    position: relative;
  }
  
  .left-panel {
    order: 2;
    width: 100%;
    padding: 20px 15px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
    box-sizing: border-box;
    overflow-x: hidden;
  }
  
  canvas {
    width: 85vw !important;
    height: 85vw !important;
    max-width: 450px !important;
    max-height: 450px !important;
    min-width: 300px !important;
    min-height: 300px !important;
    display: block !important;
    margin: 0 auto !important;
  }
  
  /* Optimize form elements for mobile */
  label {
    font-size: 13px;
    margin: 12px 0 4px 0;
  }
  
  input[type="text"], input[type="file"], select, textarea {
    padding: 10px;
    font-size: 16px; /* Prevents zoom on iOS */
    margin-bottom: 8px;
  }
  
  .dropdown-selected {
    padding: 10px 30px 10px 12px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .dropdown-option {
    padding: 10px 12px;
    font-size: 16px;
  }
  
  input[type="color"] {
    height: 40px;
    margin-bottom: 8px;
  }
  
  button {
    padding: 14px;
    font-size: 16px;
    margin-top: 15px;
  }
  
  /* Font size display */
  #fontSizeValue {
    font-size: 14px;
    display: block;
    margin-bottom: 8px;
  }
  
  /* Adjust h2 for mobile */
  h2 {
    font-size: 20px;
    margin: 0 0 15px 0;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .left-panel {
    padding: 15px 12px;
    width: 100%;
    box-sizing: border-box;
  }
  
  .preview-panel {
    padding: 20px 12px;
    min-height: 50vh;
    width: 100%;
    box-sizing: border-box;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  canvas {
    width: 80vw !important;
    height: 80vw !important;
    max-width: 400px !important;
    max-height: 400px !important;
    min-width: 280px !important;
    min-height: 280px !important;
    display: block !important;
    margin: 0 auto !important;
  }
  
  label {
    font-size: 12px;
    margin: 10px 0 3px 0;
  }
  
  input[type="text"], input[type="file"], select, textarea, .dropdown-selected {
    padding: 8px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
  }

  .text-tools-grid {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .text-case-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  button {
    padding: 12px;
    font-size: 15px;
    width: 100%;
    box-sizing: border-box;
  }
  
  h2 {
    font-size: 18px;
    margin-bottom: 12px;
  }
}





.toggle-container {
  display: flex;
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e9ecef;
  background: #f8f9fa;

}

.toggle-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: #6c757d;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  margin-top: 0 !important; /* Override button margin */
}

.toggle-btn:hover {
  background: rgba(0, 124, 186, 0.1);
  color: #007cba;
}

.toggle-btn.active {
  background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
  transform: translateY(-1px);
}

.toggle-btn.active:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 100%);
  pointer-events: none;
}


#backgroundColorPicker {
  width: 100%;
  height: 50px;
  padding: 0;
  margin-bottom: 15px;
  border: 3px solid #e9ecef;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

#backgroundColorPicker:hover {
  border-color: #007cba;
  box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
  transform: translateY(-2px);
}

#backgroundColorPicker:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.2);
}

#backgroundColorPicker::-webkit-color-swatch-wrapper {
  padding: 0;
  border: none;
  border-radius: 8px;
}

#backgroundColorPicker::-webkit-color-swatch {
  border: none;
  border-radius: 8px;
}

.text-tools-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 12px;
  align-items: end;
}

.text-tools-grid label {
  margin-top: 8px;
}

.text-tools-grid #textColor {
  height: 42px;
  margin-bottom: 10px;
}

.font-size-control {
  margin-top: 4px;
}

.font-size-control label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#fontSizeValue {
  color: #526070;
  font-size: 13px;
  font-weight: 700;
}
