/* ============================================
   PRODUCT CATALOG MAKER V3.0 - STYLES
   File: public/css/styles.css
   ============================================ */

/* Base Styles */
body { 
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f5f5;
  padding-bottom: 100px;
}

/* Header */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem 0;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Cards */
.card {
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 1.5rem;
  border-radius: 10px;
}

.card-danger-border {
  border-left: 4px solid #dc3545;
}

.card-success-border {
  border-left: 4px solid #28a745;
}

.card-primary-border {
  border-left: 4px solid #007bff;
}

.card-warning-border {
  border-left: 4px solid #ffc107;
}

/* Product Items */
.product-item {
  background: white;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  transition: all 0.3s;
  cursor: move;
  width: 25%;
  position: relative;
}

.product-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.product-item.selected {
  background: #fff3e0;
  border: 2px solid #ff6600;
}

.product-item.marked-delete {
  background: #ffebee;
  border-left: 4px solid #dc3545;
}

.product-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
}

#products-list {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* Badges */
.badge-group {
  font-size: 11px;
  padding: 4px 8px;
}

.code-prefix-badge {
  background: #ff6600;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 12px;
  margin-right: 5px;
}

.new-feature-badge {
  background: #4caf50;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  margin-left: 5px;
  animation: blink 1.5s infinite;
}

.product-count-badge {
  background: #ff6600;
  color: white;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

/* Stat Cards */
.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.stat-card.stat-danger {
  background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
}

.stat-card.stat-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-card.stat-warning {
  background: linear-gradient(135deg, #f46b45 0%, #eea849 100%);
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
}

/* Buttons */
.btn-action {
  margin: 0 3px;
  padding: 5px 10px;
  font-size: 12px;
}

.action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Loading Overlay */
#loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.spinner {
  border: 5px solid #f3f3f3;
  border-top: 5px solid #667eea;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
}

/* Checkboxes */
.delete-checkbox,
.product-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.product-checkbox {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
}

/* Section Title */
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #eee;
}

/* Dropdown */
.dropdown-menu {
  max-height: 300px;
  overflow-y: auto;
}

/* Custom Groups Styles */
.custom-group-card {
  border-left: 4px solid;
  margin-bottom: 10px;
  transition: all 0.3s;
}

.custom-group-card:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.group-color-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 10px;
}

/* Drag Lock Button */
.drag-lock-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  color: white;
}

.drag-lock-btn.locked {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.drag-lock-btn.unlocked {
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

.drag-lock-btn:hover {
  transform: scale(1.1);
}

/* Sortable Styles */
.sortable-ghost {
  opacity: 0.4;
  background: #f0f0f0;
}

.sortable-disabled .product-item {
  cursor: not-allowed !important;
}

/* V3.0 New Features Styles */

/* Order Input */
.order-input {
  width: 80px;
  font-size: 12px;
  padding: 4px 8px;
  margin-top: 5px;
}

.order-input-group {
  margin-bottom: 10px;
  display: flex;
    align-items: center;
    justify-content: space-between;
}

.order-input-group label {
  font-size: 11px;
  color: #666;
  margin-bottom: 2px;
}
.product-code{margin-left: 25px;}
/* Edit Button */
.product-item .btn-edit {
  margin-top: 5px;
  margin-right: 10px;
}

/* Multi-drag Indicator */
#multi-drag-indicator {
  display: none;
  position: fixed;
  bottom: 100px;
  right: 30px;
  background: linear-gradient(135deg, #ff6600 0%, #ff4b2b 100%);
  color: white;
  padding: 15px 20px;
  border-radius: 25px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 999;
  font-weight: bold;
  animation: pulse 2s infinite;
}

/* Image Preview */
.image-preview {
  max-width: 200px;
  max-height: 200px;
  border: 2px solid #ddd;
  border-radius: 8px;
  margin-top: 10px;
}

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

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Responsive */
@media (max-width: 768px) {
  .product-item {
    width: 48%;
  }
  
  .stat-card {
    margin-bottom: 0.5rem;
  }
  
  .action-buttons {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .product-item {
    width: 100%;
  }
}
