body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
  color: #333;
}

/* Product name editing styles */
.product-name {
  cursor: pointer;
  padding: 5px;
  border-radius: 3px;
  transition: background-color 0.2s;
  display: inline-block;
}

.product-name:hover {
  background-color: #f0f0f0;
}

.edit-product-name {
  border: 1px solid #ccc;
  padding: 4px;
  border-radius: 3px;
  font-size: 1em;
  width: 100%;
  box-sizing: border-box;
}

.save-feedback {
  margin-left: 8px;
  font-size: 0.9em;
  padding: 2px 5px;
  border-radius: 3px;
}

.save-feedback.success {
  color: #155724;
  background-color: #d4edda;
}

.save-feedback.error {
  color: #721c24;
  background-color: #f8d7da;
}

.product-name-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-name-link:hover {
  text-decoration: none;
  color: inherit;
}

/* Add Product form styles */
.add-product-form,
.header-add-product-form {
  background-color: #f8f9fa;
  padding: 20px;
  border-radius: 5px;
  margin-bottom: 20px;
  border: 1px solid #ddd;
}

.header-add-product-form {
  position: absolute;
  top: 40px;
  right: 0;
  width: 300px;
  z-index: 1000;
  background-color: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  border-radius: 4px;
  padding: 15px;
}


.form-group {
  margin-bottom: 15px;
}

.form-control {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1em;
}

.form-actions {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.3s;
}

.submit-btn, .edit-btn, .add-btn {
  background-color: #4CAF50;
  color: white;
}

.submit-btn:hover, .edit-btn:hover, .add-btn:hover {
  background-color: #45a049;
}

.cancel-btn, .delete-btn {
  background-color: #f44336;
  color: white;
}

.cancel-btn:hover, .delete-btn:hover {
  background-color: #d32f2f;
}

.feedback {
  margin-top: 10px;
  padding: 8px;
  border-radius: 4px;
  display: none;
}

.feedback.success {
  display: block;
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.feedback.error {
  display: block;
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.feedback.warning {
  display: block;
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

/* Products table styles */
.products-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.products-table th,
.products-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.products-table th {
  background-color: #f8f9fa;
  font-weight: bold;
}

.products-table tr:hover {
  background-color: #f5f5f5;
}

.actions-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.drive-btn, .folder-btn, .doc-btn {
  background-color: #1a73e8;
  color: white;
  display: inline-flex;
  align-items: center;
}

.drive-btn:hover, .folder-btn:hover, .doc-btn:hover {
  background-color: #1561c9;
  color: white;
  text-decoration: none;
}

.drive-btn i {
  margin-right: 5px;
}

/* Google Drive and Google Doc button styles */
.btn-google-drive {
  background-color: #28a745;
  color: white;
  display: inline-block;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.btn-google-drive:hover {
  background-color: #218838;
  color: white;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
  text-decoration: none;
}

.btn-google-doc {
  background-color: #6f42c1;
  color: white;
  display: inline-block;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.btn-google-doc:hover {
  background-color: #5a2d91;
  color: white;
  box-shadow: 0 2px 8px rgba(111, 66, 193, 0.3);
  text-decoration: none;
}

.product-icon {
  width: 16px;
  height: 16px;
  margin-right: 5px;
}

.selection-tools {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
  border: 1px solid #ddd;
}

.selection-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.word-count-filters, .content-filters {
  margin-top: 15px;
  padding: 15px;
  background-color: #ffffff;
  border-radius: 4px;
  border: 1px solid #e9ecef;
}

.word-count-filters h4 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #495057;
  font-size: 1.1em;
}

.filter-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 120px;
}

.filter-option label {
  font-weight: 500;
  color: #495057;
  font-size: 0.9em;
}

.filter-between {
  min-width: 200px;
}

.filter-between > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-option input[type="number"] {
  width: 80px;
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.filter-btn {
  background-color: #6c757d;
  color: white;
  padding: 5px 10px;
}

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

.select-btn, .view-btn {
  background-color: #007bff;
  color: white;
}

.select-btn:hover, .view-btn:hover {
  background-color: #0069d9;
}

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

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

.batch-actions {
  margin-top: 20px;
  padding: 15px;
  background-color: #e9ecef;
  border-radius: 5px;
  border: 1px solid #ddd;
}

.batch-actions h4 {
  margin-top: 0;
  margin-bottom: 10px;
}

.batch-action-btn {
  margin-right: 10px;
}

.batch-action-btn.process-btn {
  background-color: #28a745;
  color: white;
}

.batch-action-btn.process-btn:hover {
  background-color: #218838;
}

.actions {
  display: flex;
  gap: 10px;
}

.checkbox-cell {
  width: 30px;
  text-align: center;
}

.selection-count {
  margin-left: auto;
  font-weight: bold;
}

.product-checkbox {
  transform: scale(1.2);
}

.show-selected-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.show-selected-checkbox {
  transform: scale(1.2);
}

.content-filter-option {
  margin-right: 15px;
}

.llm-selection {
  margin-top: 15px;
}

.llm-selection select {
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-right: 10px;
}

.drive-error {
  color: #721c24;
  background-color: #f8d7da;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.85em;
}

.no-products {
  padding: 20px;
  text-align: center;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 5px;
}

/* Product detail styles */
.product-detail-container {
  background-color: #fff;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.product-info {
  margin-bottom: 20px;
}

.product-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.product-actions {
  display: flex;
  gap: 10px;
}

.product-section {
  margin-bottom: 30px;
}

.product-section h2 {
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.data-grid {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
}

.data-label {
  font-weight: bold;
}

.data-value {
  word-break: break-word;
}

.relationships-container {
  margin-top: 20px;
}

/* Notification styles */
.product-added-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 300px;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  border-left: 5px solid #4CAF50;
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 1000;
}

.product-added-notification.visible {
  opacity: 1;
  transform: translateX(0);
}

.notification-content {
  padding: 15px;
}

.notification-message {
  margin-bottom: 10px;
}

.notification-actions {
  text-align: right;
}

.notification-link {
  display: inline-block;
  padding: 5px 10px;
  background-color: #4CAF50;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9em;
}

.notification-link:hover {
  background-color: #45a049;
}

/* Add Product section in header */
.add-product-section {
  position: relative;
  margin-left: 20px;
}

.add-product-btn {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Override styles for the 'quick add product' modal */
#quick-add-product-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* Header interaction styles - non-critical */
nav a:hover {
  color: #007bff;
}

.btn-logout:hover {
  background-color: #f1f1f1;
  border-color: #ccc;
}

.add-product-btn:hover {
  background-color: #218838;
}

/* Header add product form styles */
.header-add-product-form {
  position: absolute;
  top: 40px;
  right: 0;
  width: 300px;
  z-index: 1000;
  background-color: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  border-radius: 4px;
  padding: 15px;
}

/* Dropdown menu interactive styles */
.dropdown:hover .dropdown-menu {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu {
  transform: translateY(-10px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.dropdown-menu li {
  margin: 0;
  list-style: none;
}

.dropdown-menu a {
  display: block;
  padding: 10px 15px;
  color: #333;
  text-decoration: none;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
}

.dropdown-menu a:hover {
  background-color: #f8f9fa;
  color: #007bff;
}

.dropdown-menu li:last-child a {
  border-bottom: none;
  border-radius: 0 0 4px 4px;
}

.dropdown-menu li:first-child a {
  border-radius: 4px 4px 0 0;
}

/* ===========================================
   GLOBAL MOBILE RESPONSIVE STYLES
   =========================================== */

@media (max-width: 768px) {
  /* Larger touch targets for buttons */
  .btn {
    padding: 12px 16px;
    font-size: 1em;
    min-height: 44px;
  }

  /* Form controls - prevent iOS zoom */
  .form-control {
    font-size: 16px;
    padding: 12px;
  }

  /* Tables - horizontal scroll wrapper */
  .products-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .products-table th,
  .products-table td {
    padding: 10px 8px;
    white-space: nowrap;
  }

  /* Actions flex - allow wrapping */
  .actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Data grid adjustments */
  .data-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .data-label {
    margin-bottom: 2px;
  }

  /* Selection tools - stack on mobile */
  .selection-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-row {
    flex-direction: column;
    gap: 12px;
  }

  .filter-option {
    min-width: 100%;
  }

  /* Batch actions */
  .batch-actions {
    padding: 12px;
  }

  .batch-action-btn {
    margin-right: 0;
    margin-bottom: 8px;
    width: 100%;
  }

  /* Notifications */
  .product-added-notification {
    width: calc(100% - 20px);
    max-width: none;
    right: 10px;
    left: 10px;
  }
}

@media (max-width: 480px) {
  /* Smaller screens */
  .btn {
    padding: 10px 12px;
  }

  .product-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .product-actions {
    width: 100%;
  }

  .product-actions .btn {
    flex: 1;
  }
}