/* Broadcast Button Styling */
.create-broadcast-btn {
  background: linear-gradient(135deg, #9c27b0 0%, #90559a 100%);
  color: rgb(255, 255, 255);
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center; 
  align-items: center;
  gap: 8px;
}

.create-broadcast-btn:hover {
  background: linear-gradient(135deg, #7b1fa2 0%, #ce93d8 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(156, 39, 176, 0.3);
}

/* Broadcast Ticket Cards - Purple Border */
.ticket-card.broadcast-ticket {
  border-left: 4px solid #9c27b0;
  position: relative;
}

.ticket-card.broadcast-ticket::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 16px;
  z-index: 10;
}

/* Broadcast Modal Styling */
.broadcast-modal .modal-content {
  width: 95%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
}

.broadcast-modal h2 {
  color: #9c27b0;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Product List Styling */
.products-container {
  margin-bottom: 16px;
}

.products-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background-color: #fafafa;
}

.product-item {
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  position: relative;
  transition: box-shadow 0.2s;
}

.product-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.product-number {
  background: #9c27b0;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.drag-handle {
  cursor: grab;
  color: #999;
  font-size: 16px;
  padding: 5px;
}

.drag-handle:active {
  cursor: grabbing;
}

.remove-product {
  background: #dc3545;
  color: white;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-product:hover {
  background: #c82333;
}

.product-fields {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.product-link-input {
  grid-column: 1;
}

.product-link-input input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.product-link-input input:focus {
  border-color: #9c27b0;
  outline: none;
  box-shadow: 0 0 0 2px rgba(156, 39, 176, 0.2);
}

.product-image-upload {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.image-upload-btn {
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 6px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 20px;
  color: #fcfbfc;
}

.image-upload-btn:hover {
  border-color: #9c27b0;
  color: #9c27b0;
  background: #f3e5f5;
}

.image-upload-btn.has-image {
  border-color: #28a745;
  background: #d4edda;
  color: #155724;
}

.product-image-preview {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid #28a745;
}

.product-description {
  grid-column: 1 / -1;
  margin-top: 10px;
}

.product-description textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  min-height: 50px;
  resize: vertical;
}

.product-description textarea:focus {
  border-color: #9c27b0;
  outline: none;
  box-shadow: 0 0 0 2px rgba(156, 39, 176, 0.2);
}

/* Add Product Button */
.add-product-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 15px auto 0;
  transition: background-color 0.2s;
}

.add-product-btn:hover {
  background: #218838;
}

.add-product-btn:disabled {
  background: #fcfbfc;
  cursor: not-allowed;
}

/* Broadcast Settings */
.broadcast-settings {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 15px;
  margin-bottom: 20px;
  align-items: end;
}

.broadcast-settings .form-group {
  margin-bottom: 0;
}

.on-sale-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
}

.on-sale-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

/* Intro Text */
.intro-text-container {
  margin-bottom: 10px;
}

.intro-text-container textarea {
  width: 100%;
  padding: 2px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  min-height: 20px;
  resize: vertical;
}

.intro-text-container textarea:focus {
  border-color: #9c27b0;
  outline: none;
  box-shadow: 0 0 0 2px rgba(156, 39, 176, 0.2);
}

/* Preview Section */
.preview-container {
  margin-bottom: 20px;
}

.preview-content {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 15px;
  font-family: 'Georgia', serif;
  line-height: 1.6;
  white-space: pre-line;
  max-height: 200px;
  overflow-y: auto;
}

.create-broadcast-btn,
#createTicketBtn { 
   background: linear-gradient(135deg, #6f3917 0%, #c38b58 100%);
  border-radius: 6px;
  padding: 12px 15px;
  font-size: 14px; /* Example font size */
  font-family: 'arial', serif;
  text-align: center; /* Center the text */
}

.create-broadcast-btn {
  background: linear-gradient(135deg, #9c27b0 0%, #b984c4 100%);
  color: rgb(255, 255, 255);
  border: none;
  padding: 12px 15px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center; 
  align-items: center;
  gap: 8px;
}

.preview-content::-webkit-scrollbar {
  width: 6px;
}

.preview-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.preview-content::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* Draft Indicator */
.draft-indicator {
  background: #ffc107;
  color: #856404;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold;
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
}

/* Copy Button */
.copy-content-btn {
  background: #17a2b8;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background-color 0.2s;
}

.copy-content-btn:hover {
  background: #138496;
}

.copy-success {
  background: #28a745 !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .broadcast-modal .modal-content {
    width: 98%;
    padding: 15px;
  }
  
  .broadcast-settings {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .product-fields {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .product-image-upload {
    grid-column: 1;
    flex-direction: row;
    justify-content: flex-start;
  }
  
  .image-upload-btn {
    width: 50px;
    height: 50px;
    font-size: 16px;
  }
  
  .product-image-preview {
    width: 50px;
    height: 50px;
  }
  
  .products-list {
    max-height: 250px;
  }
  
  .create-broadcast-btn {
    padding: 10px 16px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .product-item {
    padding: 12px;
  }
  
  .product-header {
    margin-bottom: 8px;
  }
  
  .product-number {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }
  
  .remove-product {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }
  
  .image-upload-btn {
    width: 45px;
    height: 45px;
    font-size: 14px;
  }
  
  .product-image-preview {
    width: 45px;
    height: 45px;
  }
}

/* Add this to your stylesheet */
.product-description {
  display: flex; /* Makes the children (number and textarea) align horizontally */
  align-items: center; /* Vertically aligns the number with the textarea */
  gap: 10px; /* Adds space between the number and the textarea */
}

.product-description textarea {
  flex-grow: 1; /* Allows the textarea to take up the remaining space */
}

.product-number {
  min-width: 25px; /* Ensures the number doesn't get too small */
  text-align: center;
  font-weight: bold;
}
/* Update the product item and header to use flexbox for better alignment */
.product-item {
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 8px;
  background-color: #f9f9f9;
  position: relative;
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* Aligns the delete button to the top right */
  margin-bottom: 10px;
}

.product-info-left {
  display: flex;
  align-items: center;
  gap: 10px; /* Space between number and description */
}

/* Update the product number and remove drag handle styles */
.product-number {
  font-weight: bold;
  font-size: 1.1em;
  color: #ffffff;
  padding: 5px; /* Add some padding for better visual spacing */
}

/* Remove the drag handle from the CSS */
.drag-handle {
  display: none;
}

/* Align the description and link inputs */
.product-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-description {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-description textarea {
  flex-grow: 1;
  width: auto; /* Allow flex-grow to manage the width */
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px;
  box-sizing: border-box;
  resize: none;
  overflow: hidden;
  height: 40px;
}

.product-link-and-image {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-link-input {
  flex-grow: 1;
}

/* Ensure the image upload button is a fixed size and in line */
.product-image-upload {
  display: flex; /* Flexbox for the upload button and preview */
  align-items: center;
  gap: 5px;
}

.image-upload-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px dashed #ccc;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  cursor: pointer;
  color: #aaa;
  transition: all 0.2s;
}

.product-image-preview {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ccc;
}

/* Update the product item container */
.product-item {
  position: relative;
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 8px;
  background-color: #f9f9f9;
  display: flex; /* Use flexbox to position the content and delete button */
  align-items: flex-start;
  gap: 10px;
}

/* Flex container for all main product fields */
.product-content-wrapper {
  flex-grow: 1; /* Allows the content to fill the remaining space */
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Row for the number, description, and image upload */
.product-info-top {
  display: flex;
  align-items: flex-start; /* Align all items to the top */
  gap: 10px;
}

.product-number {
  flex-shrink: 0; /* Prevents the number from shrinking */
  font-weight: bold;
  font-size: 1.1em;
  color: #ffffff;
  padding-top: 5px; /* Adjust padding to align with the textarea */
}

.product-info-top textarea {
  flex-grow: 1; /* Allows the textarea to take up all available space */
  height: 40px;
  resize: none;
  overflow: hidden;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px;
  box-sizing: border-box;
}

/* Image upload button */
.product-image-upload {
  flex-shrink: 0; /* Prevents the button from shrinking */
  display: flex;
  align-items: center;
}

.image-upload-btn {
  width: 40px;
  height: 40px;
  border: 1px dashed #ccc;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  cursor: pointer;
  color: #aaa;
  transition: all 0.2s;
}

.product-image-preview {
  position: absolute; /* Position the preview over the button to save space */
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ccc;
  right: 10px; /* Adjust as needed */
  bottom: 10px; /* Adjust as needed */
  z-index: 10;
}

/* Link input at the bottom */
.product-link-input input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

/* Remove button positioned to the right of the entire product card */
.remove-product {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: #dc3545;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

/* This is no longer needed in the HTML, but good to keep in your CSS to remove old styles */
.product-header {
  display: none;
}


/* This rule targets the title, intro text, product description, and link inputs in the broadcast modal */
#broadcastModal input[type="text"],
#broadcastModal textarea {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
}

/* This rule specifically targets the preview area of the broadcast modal */
#previewContent {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
}

/* Additional styles for broadcast image handling */
.image-upload-btn.uploading {
  opacity: 0.6;
  pointer-events: none;
}

.product-image-preview {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s;
  margin-left: 5px;
}

.product-image-preview:hover {
  transform: scale(1.1);
}

/* Make the image upload area more clickable */
.product-image-upload {
  display: flex;
  align-items: center;
  gap: 5px;
}

.image-upload-btn {
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
  min-width: 30px;
  text-align: center;
}

.image-upload-btn:hover {
  background-color: rgba(0,0,0,0.1);
}





/* Align the link input with the description box above */
.product-link-input {
  margin-left: 36px; /* This should match the width of the number circle + gap */
  margin-top: 8px;
}

.product-link-input input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  /* Existing styles for mobile */

  .form-actions {
    display: flex; /* Use flexbox to align buttons */
    justify-content: space-around; /* Distribute space evenly */
    align-items: center; /* Vertically align items */
  }

  .form-actions button {
    flex: 1; /* Allow buttons to grow and fill space */
    margin: 0 5px; /* Add some horizontal spacing */
  }
}




.preview-container {
  display: none;
}

#broadcastNotes {
  width: 100%;
  min-height: 60px;
  height: 60px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  box-sizing: border-box;
}

.copy-content-section {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 10px;
}

.copy-content-section .copy-content-btn {
  background-color: #17a2b8;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.copy-content-section .copy-content-btn:hover {
  background-color: #138496;
}

.copy-content-section .copy-content-btn:active {
  transform: translateY(1px);
}

.copy-content-section .copy-content-btn.copy-success {
  background-color: #28a745;
}

/* Remove any existing on-sale checkbox styles if they exist */
.on-sale-checkbox {
  display: none;
}