/* LED Neon Wizard CSS */

.led-neon-wizard {
  font-family: 'Arial', sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  color: #333;
}

/* Debug Info */
.led-neon-debug-info {
  background: #f8f9fa;
  border: 1px solid #ddd;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  overflow-x: auto;
}

.led-neon-debug-info h4 {
  margin-top: 0;
  color: #e63946;
}

/* Header */
.led-neon-header {
  text-align: center;
  margin-bottom: 30px;
}

.led-neon-header h2 {
  font-size: 42px;
  margin-bottom: 5px;
  color: #3a8c9e;
  font-family: 'Brush Script MT', cursive;
  font-weight: 400;
}

.led-neon-header p {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #3a8c9e;
}

/* Main content layout */
.led-neon-wizard-content {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.led-neon-controls {
  flex: 1;
  min-width: 300px;
  background-color: #f5f5f5;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.led-neon-preview {
  flex: 2;
  min-width: 400px;
  display: flex;
  flex-direction: column;
}

/* Tabs */
.led-neon-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #ddd;
}

.led-neon-tab {
  padding: 10px 20px;
  cursor: pointer;
  font-weight: bold;
  text-align: center;
  background-color: #e0e0e0;
  color: #666;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  margin-right: 5px;
}

.led-neon-tab.active {
  background-color: #3a8c9e;
  color: white;
}

/* Tab content */
.led-neon-tab-content {
  display: none;
  margin-bottom: 20px;
}

.led-neon-tab-content.active {
  display: block;
}

/* Text input */
.led-neon-text-input textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-height: 80px;
  font-size: 16px;
  margin-bottom: 15px;
}

/* Text size slider */
.led-neon-text-settings h4 {
  margin: 10px 0;
}

.led-neon-size-slider {
  width: 100%;
  margin: 10px 0;
}

/* Size options */
.led-neon-size-options h4 {
  margin: 15px 0 10px;
  font-size: 14px;
  color: #666;
}

.led-neon-sizes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.led-neon-size-option {
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.led-neon-size-option:hover, 
.led-neon-size-option.active {
  background-color: #e6f3f5;
  border-color: #3a8c9e;
}

.size-name {
  font-weight: bold;
  margin-bottom: 5px;
}

.size-dimensions {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
}

/* Waterproof option */
.led-neon-waterproof {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 15px;
}

.waterproof-price {
  font-weight: bold;
  color: #e63946;
}

/* Background Grid - Standard View */
.bg-selector-standard .background-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  padding: 10px 5px;
  max-height: 400px;
  overflow-y: auto;
}

/* Cải thiện hiển thị background items */
.background-item {
  border: 2px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  position: relative;
}

.background-item:hover {
  border-color: #3a8c9e;
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.background-item.active {
  border-color: #3a8c9e;
  box-shadow: 0 0 0 2px #3a8c9e, 0 5px 15px rgba(0,0,0,0.2);
}

/* Tăng kích thước preview và thêm animation */
.background-preview {
  width: 100%;
  height: 150px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: 1px solid #eee;
  position: relative;
  transition: all 0.5s ease;
}

.background-preview::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.03);
  z-index: 1;
}

.background-item:hover .background-preview {
  transform: scale(1.02);
}

.background-item.active .background-preview::before {
  background-color: rgba(58, 140, 158, 0.05);
}

/* Cải thiện hiển thị title */
.background-title {
  padding: 12px 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  background-color: #f9f9f9;
}

.background-item.active .background-title {
  background-color: #e6f3f5;
  color: #3a8c9e;
}

/* Thêm một loader hiển thị khi đang tải */
.background-preview.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  margin-left: -15px;
  border: 3px solid rgba(58, 140, 158, 0.3);
  border-top: 3px solid #3a8c9e;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 2;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mobile Compatibility Mode - Simple Background Selector */
.bg-selector-simple h4 {
  margin: 10px 0 15px;
  font-size: 16px;
  color: #3a8c9e;
  text-align: center;
}

.bg-radio-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: 400px;
  overflow-y: auto;
  padding: 5px;
}

/* Cải thiện tùy chọn radio cho mobile */
.bg-radio-option {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.bg-radio-option:hover {
  border-color: #3a8c9e;
  background-color: #f9f9f9;
  transform: translateY(-2px);
}

.bg-radio-option input[type="radio"] {
  margin-right: 10px;
  width: 20px;
  height: 20px;
  accent-color: #3a8c9e;
}

.bg-radio-option label {
  display: flex;
  align-items: center;
  cursor: pointer;
  width: 100%;
}

/* Cải thiện thumbnail trong radio options */
.bg-thumbnail {
  width: 80px;
  height: 60px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-right: 15px;
  transition: all 0.3s ease;
  position: relative;
}

.bg-thumbnail::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.03);
  z-index: 1;
}

.bg-radio-option span {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.bg-radio-option input:checked + label {
  font-weight: bold;
}

.bg-radio-option input:checked + label .bg-thumbnail {
  border-color: #3a8c9e;
  border-width: 2px;
  box-shadow: 0 0 0 1px #3a8c9e;
}

.bg-radio-option input:checked + label span {
  color: #3a8c9e;
}

/* Thumbnails Gallery - Bổ sung mới */
.led-neon-thumbnails {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 15px 0;
  margin: 15px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #3a8c9e #f0f0f0;
  position: relative;
  background-color: #f9f9f9;
  border-radius: 8px;
}

.led-neon-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.led-neon-thumbnails::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 10px;
}

.led-neon-thumbnails::-webkit-scrollbar-thumb {
  background-color: #3a8c9e;
  border-radius: 10px;
  border: 2px solid #f0f0f0;
}

.led-neon-thumbnail {
  flex: 0 0 auto;
  width: 100px;
  cursor: pointer;
  position: relative;
  border: 2px solid #ddd;
  border-radius: 6px;
  transition: all 0.3s ease;
  background-color: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.led-neon-thumbnail:hover {
  transform: translateY(-5px);
  border-color: #3a8c9e;
}

.led-neon-thumbnail.active {
  border-color: #3a8c9e;
  box-shadow: 0 0 0 1px #3a8c9e, 0 5px 10px rgba(0,0,0,0.1);
}

.thumbnail-preview {
  width: 100%;
  height: 60px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: all 0.3s ease;
  position: relative;
}

.thumbnail-preview::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.03);
  z-index: 1;
}

.thumbnail-title {
  font-size: 12px;
  padding: 5px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #666;
  border-top: 1px solid #eee;
  background-color: #f9f9f9;
}

.led-neon-thumbnail.active .thumbnail-title {
  color: #3a8c9e;
  font-weight: bold;
}

/* Thêm chỉ báo có thể scroll */
.led-neon-thumbnails::after,
.led-neon-thumbnails::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30px;
  pointer-events: none;
  z-index: 2;
}

.led-neon-thumbnails::after {
  right: 0;
  background: linear-gradient(to right, transparent, rgba(249, 249, 249, 0.9));
}

.led-neon-thumbnails::before {
  left: 0;
  background: linear-gradient(to left, transparent, rgba(249, 249, 249, 0.9));
}

/* Color options */
.led-neon-colors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.led-neon-color-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.led-neon-color-option:hover,
.led-neon-color-option.active {
  background-color: #f0f0f0;
  border-color: #3a8c9e;
}

.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-bottom: 5px;
  border: 1px solid #ddd;
}

.color-name {
  font-size: 12px;
}

/* Preview area */
.led-neon-toggle {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 10px;
}

.led-neon-toggle span {
  margin-right: 10px;
  font-weight: bold;
}

/* Switch toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: #3a8c9e;
}

input:focus + .slider {
  box-shadow: 0 0 1px #3a8c9e;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Display area */
.led-neon-display {
  position: relative;
  width: 100%;
  height: 400px;
  background-color: #333;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Cải thiện hiệu ứng transition cho background */
.led-neon-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: all 0.5s ease;
}

/* Kéo thả text LED */
.led-neon-text-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Brush Script MT', cursive;
  color: #fff;
  font-size: 4em;
  text-align: center;
  text-shadow: 0 0 5px #fff, 
               0 0 10px #fff, 
               0 0 15px #fff, 
               0 0 20px #3a8c9e, 
               0 0 35px #3a8c9e, 
               0 0 40px #3a8c9e;
  transition: all 0.1s ease;
  cursor: move; /* Chỉ báo có thể kéo */
  user-select: none; /* Ngăn việc chọn text khi kéo */
  -webkit-user-select: none; /* Safari */
  -webkit-touch-callout: none; /* iOS Safari */
  padding: 20px; /* Tăng vùng có thể kéo */
  border: 2px dashed rgba(255, 255, 255, 0.1); /* Viền nhẹ để nhận biết */
  border-radius: 8px;
  max-width: 90%;
  max-height: 80%;
  overflow-wrap: break-word;
  touch-action: none; /* Cải thiện kéo trên thiết bị di động */
  z-index: 10; /* Đảm bảo text luôn ở trên cùng */
}

/* Hiển thị viền rõ hơn khi hover */
.led-neon-text-display:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

/* Cải thiện hiển thị khi đang kéo */
.led-neon-text-display.dragging {
  opacity: 0.9;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 15px rgba(58, 140, 158, 0.4);
  cursor: grabbing;
}

/* Thêm biểu tượng kéo thả trên thiết bị di động */
.is-mobile .led-neon-text-display::before {
  content: "⬍";
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: none;
  opacity: 0.8;
}

/* Cải thiện kéo thả trên điện thoại di động */
@media (max-width: 768px) {
  .led-neon-text-display {
    padding: 15px;
    border-width: 2px;
  }
  
  /* Tăng kích thước vùng chạm để dễ kéo thả */
  .led-neon-text-display::after {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    z-index: -1;
  }
  
  .led-neon-text-display.dragging {
    background-color: rgba(0, 0, 0, 0.2); /* Thêm màu nền khi kéo để dễ nhận biết */
  }
}

/* LED off state */
.led-neon-display.off .led-neon-text-display {
  color: #999;
  text-shadow: none;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .bg-selector-standard .background-grid {
    grid-template-columns: repeat(2, 1fr);
}

  .led-neon-colors {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .led-neon-wizard-content {
    flex-direction: column;
  }
  
  .led-neon-sizes {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .led-neon-display {
    height: 300px;
  }
  
  .led-neon-text-display {
    font-size: 3em;
  }
  
  .bg-selector-standard .background-grid {
    grid-template-columns: repeat(1, 1fr);
  }
  
  .background-preview {
    height: 120px;
  }
  
  .led-neon-controls {
    min-width: 100%;
  }
  
  .led-neon-preview {
    min-width: 100%;
  }
  
  /* Điều chỉnh thumbnails cho mobile */
  .led-neon-thumbnail {
    width: 80px;
  }
  
  .thumbnail-preview {
    height: 50px;
  }
  
  .thumbnail-title {
    font-size: 10px;
    padding: 3px;
  }
}

/* Mobile optimization */
.is-mobile.led-neon-wizard {
  padding: 10px;
}

.is-mobile .led-neon-header h2 {
  font-size: 32px;
}

.is-mobile .led-neon-header p {
  font-size: 12px;
}

.is-mobile .led-neon-tab {
  padding: 8px 15px;
  font-size: 14px;
}

.is-mobile .led-neon-display {
  height: 250px;
}

/* Chỉ hiển thị thumbnails trên desktop hoặc khi không bật chế độ tương thích mobile */
.is-mobile.mobile-compat-mode .led-neon-thumbnails {
  max-height: 80px;
  padding: 10px 0;
} 