/* ================================================
   ADDITIONAL STYLING FOR IMAGE EDITOR
   Add this to your existing modal-form.css
   ================================================ */

/* Password Container - Update existing */
.password-container {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input {
  flex: 1;
  padding-right: 50px !important;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  opacity: 0.6;
  transition: all 0.3s ease;
  z-index: 10;
}

.password-toggle-btn:hover {
  color: #333;
  opacity: 1;
}

.password-toggle-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.password-toggle-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.1s ease;
}

/* Photo Preview Editor - Enhanced Version */
.photo-preview-editor {
  margin-top: 16px;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #dee2e6;
  border-radius: 12px;
  animation: fadeIn 0.3s ease;
}

.preview-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 12px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-control {
  width: 45px;
  height: 45px;
  border: 2px solid #dee2e6;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: #495057;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-control:hover {
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
  color: white;
  border-color: #0066cc;
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-control:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 102, 204, 0.2);
}

.preview-container {
  width: 100%;
  height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 3px dashed #0066cc;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.preview-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
      90deg,
      rgba(0, 102, 204, 0.03) 1px,
      transparent 1px
    ),
    linear-gradient(rgba(0, 102, 204, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.preview-image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  transition: transform 0.3s ease;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1;
}

.btn-remove-preview {
  width: 100%;
  margin-top: 12px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
}

.btn-remove-preview:hover {
  background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4);
}

.btn-remove-preview:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
}

/* Form Groups */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

.form-group label.required::after {
  content: " *";
  color: #dc3545;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control:disabled,
.form-control[readonly] {
  background-color: #e9ecef;
  cursor: not-allowed;
}

.form-hint {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #6c757d;
}

/* Checkbox Group */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.role-badge {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  display: inline-block;
}

.role-cleaning {
  background: #e3f2fd;
  color: #1976d2;
}

.role-reglue {
  background: #f3e5f5;
  color: #7b1fa2;
}

.role-repaint {
  background: #fff3e0;
  color: #f57c00;
}

.role-kasir {
  background: #e8f5e9;
  color: #388e3c;
}

/* Modal Footer */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #dee2e6;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #007bff;
  color: white;
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-primary.loading {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

/* Responsive - Enhanced for Image Editor */
@media (max-width: 768px) {
  .preview-controls {
    gap: 6px;
    padding: 10px;
  }

  .btn-control {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .preview-container {
    height: 280px;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .preview-controls {
    gap: 5px;
    padding: 8px;
  }

  .btn-control {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }

  .preview-container {
    height: 220px;
  }

  .password-toggle-btn {
    right: 8px;
    padding: 2px 6px;
  }

  .password-toggle-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* Tooltip for controls */
.btn-control[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  font-size: 12px;
  white-space: nowrap;
  border-radius: 6px;
  margin-bottom: 8px;
  pointer-events: none;
  z-index: 1000;
}

.btn-control[title]:hover::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  margin-bottom: 2px;
  pointer-events: none;
  z-index: 1000;
}
