/**
 * Inventory Management Styles
 * Stock status indicators and related UI components
 */

/* Stock Status Indicators */
.stock-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stock-status--in-stock {
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.stock-status--low-stock {
  background-color: #fff3e0;
  color: #f57c00;
  border: 1px solid #ffcc02;
}

.stock-status--out-of-stock {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

/* Product Card Stock Indicators */
.product-card .stock-status {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.75rem;
  padding: 2px 6px;
  z-index: 2;
}

.product-card__image {
  position: relative;
}

/* Out of Stock Overlay */
.product-card--out-of-stock {
  opacity: 0.7;
}

.product-card--out-of-stock .product-card__image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* Disabled Add to Cart Button */
.btn--disabled {
  background-color: #e0e0e0 !important;
  color: #9e9e9e !important;
  cursor: not-allowed !important;
  border-color: #e0e0e0 !important;
}

.btn--disabled:hover {
  background-color: #e0e0e0 !important;
  color: #9e9e9e !important;
  transform: none !important;
}

/* Notify When Available Button */
.notify-btn {
  margin-top: 8px;
  font-size: 0.875rem;
  padding: 8px 16px;
}

/* Product Detail Page Stock Info */
.product-detail__stock {
  margin-bottom: 16px;
}

.product-detail__stock .stock-status {
  font-size: 1rem;
  padding: 6px 12px;
}

/* Stock Quantity Display */
.stock-quantity {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.stock-quantity__label {
  font-weight: 500;
  color: #666;
}

.stock-quantity__value {
  font-weight: 600;
  color: #333;
}

/* Low Stock Warning */
.low-stock-warning {
  background-color: #fff3e0;
  border: 1px solid #ffcc02;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.low-stock-warning__icon {
  color: #f57c00;
  font-size: 1.2rem;
}

.low-stock-warning__text {
  color: #e65100;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Out of Stock Message */
.out-of-stock-message {
  background-color: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
}

.out-of-stock-message__title {
  color: #c62828;
  font-weight: 600;
  margin-bottom: 8px;
}

.out-of-stock-message__text {
  color: #d32f2f;
  font-size: 0.875rem;
}

/* Cart Validation Errors */
.cart-validation-error {
  background-color: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 16px;
}

.cart-validation-error__title {
  color: #c62828;
  font-weight: 600;
  margin-bottom: 8px;
}

.cart-validation-error__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cart-validation-error__item {
  color: #d32f2f;
  font-size: 0.875rem;
  margin-bottom: 4px;
  padding-left: 16px;
  position: relative;
}

.cart-validation-error__item::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #c62828;
}

/* Admin Stock Management */
.stock-management {
  background-color: #f5f5f5;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.stock-management__title {
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
}

.stock-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.stock-input {
  width: 100px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.875rem;
}

.stock-update-btn {
  padding: 8px 16px;
  font-size: 0.875rem;
}

/* Stock History */
.stock-history {
  margin-top: 16px;
}

.stock-history__title {
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
  font-size: 0.875rem;
}

.stock-history__list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}

.stock-history__item {
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stock-history__item:last-child {
  border-bottom: none;
}

.stock-history__action {
  font-weight: 500;
  color: #666;
}

.stock-history__change {
  font-weight: 600;
}

.stock-history__change--increase {
  color: #2e7d32;
}

.stock-history__change--decrease {
  color: #c62828;
}

/* Low Stock Alerts */
.low-stock-alert {
  background-color: #fff3e0;
  border: 1px solid #ffcc02;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.low-stock-alert__icon {
  color: #f57c00;
  font-size: 1.5rem;
  margin-top: 2px;
}

.low-stock-alert__content {
  flex: 1;
}

.low-stock-alert__title {
  font-weight: 600;
  color: #e65100;
  margin-bottom: 4px;
}

.low-stock-alert__message {
  color: #ef6c00;
  font-size: 0.875rem;
  margin-bottom: 8px;
}

.low-stock-alert__products {
  list-style: none;
  padding: 0;
  margin: 0;
}

.low-stock-alert__product {
  color: #f57c00;
  font-size: 0.75rem;
  margin-bottom: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .stock-input-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .stock-input {
    width: 100%;
    margin-bottom: 8px;
  }
  
  .product-card .stock-status {
    position: static;
    margin-bottom: 8px;
    display: block;
    text-align: center;
  }
  
  .stock-history__item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* Animation for stock updates */
.stock-status--updating {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}
