/* ===== MODERN ENTERPRISE-GRADE UI STYLES ===== */

/* CSS Variables for consistent theming */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --background-color: #f8fafc;
  --surface-color: #ffffff;
  --border-color: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
}

/* Container and layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.form-container {
  background: var(--surface-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 2.5rem;
  margin: 2rem auto;
  max-width: 800px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.form-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--success-color));
}

/* Form header */
.form-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.form-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--success-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-subtitle {
  color: var(--text-secondary);
  font-size: 1.125rem;
}

/* Form sections */
.form-section {
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: var(--background-color);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.form-section:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 1.5rem;
  background: var(--primary-color);
  border-radius: 2px;
}

/* Form fields */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--surface-color);
  color: var(--text-primary);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
  transform: translateY(-1px);
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
textarea:hover,
select:hover {
  border-color: var(--primary-color);
}

.pricing-info-container {
  display: none;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: 0.775rem;
  margin-top: 0.5rem;
  height: fit-content;
}

.pricing-info-container input[type="number"] {
  font-size: 0.775rem;
  padding: 0.55rem 0.7rem;
  width: 50%;
}

.pricing-info-container label {
  font-size: 0.775rem;
  color: var(--text-primary);
  margin-bottom: 0;
  letter-spacing: 0.05em;
  text-transform: inherit;
  font-weight: 400;
  letter-spacing: 0;
}

.pricing-info-single-block {
  font-size: 0.775rem;
  /* display: flex;
  justify-content: space-between;
  align-items: center; */
  width: 33%;
}

.pricing-info-container span {
  text-align: left;
}
/* Stock Items Section */
.stock-items-section {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
}

.stock-item-row {
  background: var(--background-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  position: relative;
}

.stock-item-row:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stock-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.stock-item-header h5 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.remove-item-btn {
  background: transparent;
  color: var(--error-color);
  border: 1px solid var(--error-color);
  padding: 0.375rem 0.75rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: var(--transition);
  opacity: 0.8;
}

.remove-item-btn:hover {
  background: var(--error-color);
  color: white;
  opacity: 1;
  transform: scale(1.01);
}

/* Supplier Container */
.supplier-container {
  position: relative;
  margin-bottom: 1rem;
  transition: all 0.3s ease-out;
}

.supplier-container.expanded {
  margin-bottom: 220px;
}

/* Supplier Dropdown */
.supplier-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
  animation: slideDown 0.2s ease-out;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) #e5e7eb;
}

.supplier-dropdown::-webkit-scrollbar {
  width: 6px;
}

.supplier-dropdown::-webkit-scrollbar-track {
  background: #e5e7eb;
  border-radius: 3px;
}

.supplier-dropdown::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

.supplier-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}

.supplier-options {
  padding: 0.5rem 0;
}

.supplier-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}

.supplier-option:hover {
  background: var(--primary-color);
  color: white;
  transform: translateX(4px);
}

.supplier-option.selected {
  background: var(--primary-color);
  color: white;
}

.add-new-supplier {
  padding: 0.75rem 1rem;
  border-top: 2px solid var(--border-color);
  background: var(--background-color);
}

.add-new-supplier button {
  background: var(--success-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 0.875rem;
  transition: var(--transition);
  width: 100%;
}

.add-new-supplier button:hover {
  background: #059669;
  transform: scale(1.02);
}

/* Warehouse Container */
.warehouse-container {
  position: relative;
  transition: all 0.3s ease-out;
}

/* Warehouse Radio Container */
.warehouse-radio-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.5rem 0;
}

.warehouse-radio-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.warehouse-radio {
  margin-right: 0.5rem;
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
}

.warehouse-radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.warehouse-radio-label:hover {
  color: var(--primary-color);
}

.warehouse-radio:checked + .warehouse-radio-label {
  color: var(--primary-color);
  font-weight: 600;
}

.radio-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* Shipping Fee Container */
.shipping-fee-container {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-symbol {
  position: absolute;
  left: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  z-index: 1;
  pointer-events: none;
}

.shipping-fee-container input {
  padding-left: 2rem;
}

/* Flatpickr Date Picker Customization */
.flatpickr-calendar {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  font-family: 'Inter', sans-serif;
  padding: 1rem;
  width: 320px !important;
  z-index: 99999 !important;
  position: relative !important;
}

/* Ensure all flatpickr elements have high z-index */
.flatpickr-calendar.open {
  z-index: 99999 !important;
}

.flatpickr-calendar.arrowTop,
.flatpickr-calendar.arrowBottom {
  z-index: 99999 !important;
}

.flatpickr-months {
  margin-bottom: 1rem;
}

.flatpickr-month {
  background: var(--primary-color);
  color: white;
  border-radius: var(--border-radius);
  padding: 0.5rem;
  margin-bottom: 0.5rem;
}

.flatpickr-current-month {
  font-size: 1.1rem;
  font-weight: 600;
}

.flatpickr-monthDropdown-months,
.flatpickr-current-month .numInputWrapper {
  background: transparent;
  border: none;
  color: white;
  font-weight: 600;
}

.flatpickr-weekdays {
  margin-bottom: 0.5rem;
}

.flatpickr-weekday {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
}

.flatpickr-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}

.flatpickr-day {
  border-radius: var(--border-radius);
  transition: var(--transition);
  border: 1px solid transparent;
  height: 2.5rem;
  line-height: 2.5rem;
  text-align: center;
  cursor: pointer;
  font-weight: 500;
}

.flatpickr-day:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.05);
  border-color: var(--primary-color);
}

.flatpickr-day.selected {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  font-weight: 600;
}

.flatpickr-day.today {
  border-color: var(--primary-color);
  color: var(--primary-color);
  font-weight: 600;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: var(--text-secondary);
  opacity: 0.5;
}

.flatpickr-day.disabled {
  color: var(--text-secondary);
  opacity: 0.3;
  cursor: not-allowed;
}

.flatpickr-input {
  cursor: pointer;
}

/* Remove the month/year dropdown styling */
.flatpickr-months .flatpickr-month {
  background: transparent;
  color: var(--text-primary);
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  color: var(--primary-color);
  fill: var(--primary-color);
  padding: 0.5rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  background: var(--primary-color);
  color: white;
  fill: white;
}

/* Field Icons */
.field-icon {
  margin-right: 0.5rem;
  color: var(--primary-color);
  vertical-align: middle;
}

/* Button Icons */
.button-icon {
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* Placeholder styling */
input::placeholder,
textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
  font-style: italic;
}

input:focus::placeholder,
textarea:focus::placeholder {
  opacity: 0.4;
}

/* Additional Flatpickr improvements */
.flatpickr-calendar.open {
  animation: slideDown 0.3s ease-out;
}

.flatpickr-calendar.arrowTop:before,
.flatpickr-calendar.arrowTop:after {
  border-bottom-color: var(--border-color);
}

.flatpickr-calendar.arrowBottom:before,
.flatpickr-calendar.arrowBottom:after {
  border-top-color: var(--border-color);
}

/* Hide the month/year dropdown completely */
.flatpickr-months .flatpickr-monthDropdown-months {
  display: none !important;
}

.flatpickr-months .numInputWrapper {
  display: none !important;
}

/* Product Search Container */
.product-search-container {
  position: relative;
  margin-bottom: 1rem;
  transition: all 0.3s ease-out;
}

.product-search-container.expanded {
  margin-bottom: 220px;
}

.product-search-filters {
  margin-bottom: 0.5rem;
}

/* Category Search Container */
.category-search-container {
  position: relative;
  width: 100%;
}

.category-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  transition: var(--transition);
  background: var(--surface-color);
  color: var(--text-primary);
}

.category-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.category-search-input:hover {
  border-color: var(--primary-color);
}

/* Category Search Dropdown */
.category-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
  animation: slideDown 0.2s ease-out;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) #e5e7eb;
}

.category-search-dropdown::-webkit-scrollbar {
  width: 6px;
}

.category-search-dropdown::-webkit-scrollbar-track {
  background: #e5e7eb;
  border-radius: 3px;
}

.category-search-dropdown::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

.category-search-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}

.category-search-options {
  padding: 0.5rem 0;
}

.category-search-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}

.category-search-option:hover {
  background: var(--primary-color);
  color: white;
  transform: translateX(4px);
}

.category-search-option.selected {
  background: var(--primary-color);
  color: white;
}

/* Product Label Container - Inline layout for label and category filter */
.product-label-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.product-label-container label {
  flex: 1;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  font-weight: 500;
  color: var(--text-primary);
}

/* Category Filter Container */
.category-filter-container {
  position: relative;
  width: auto;
  min-width: 200px;
  margin-bottom: 0;
}

/* Category Filter Dropdown Wrapper */
.category-filter-dropdown-wrapper {
  position: relative;
  width: 100%;
}

/* Category Filter Button */
.category-filter-button {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  transition: var(--transition);
  background: var(--surface-color);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.category-filter-button:hover {
  border-color: var(--primary-color);
}

.category-filter-button:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.category-filter-text {
  flex: 1;
  text-align: left;
}

.category-filter-arrow {
  margin-left: 0.5rem;
  transition: transform 0.2s ease;
}

.category-filter-button[aria-expanded="true"] .category-filter-arrow {
  transform: rotate(180deg);
}

/* Category Filter Dropdown */
.category-filter-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-height: 250px;
  overflow: hidden;
  animation: slideDown 0.2s ease-out;
}

/* Category Filter Search */
.category-filter-search {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--background-color);
}

.category-filter-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  transition: var(--transition);
  background: var(--surface-color);
  color: var(--text-primary);
}

.category-filter-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Category Filter Options */
.category-filter-options {
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) #e5e7eb;
}

.category-filter-options::-webkit-scrollbar {
  width: 6px;
}

.category-filter-options::-webkit-scrollbar-track {
  background: #e5e7eb;
  border-radius: 3px;
}

.category-filter-options::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

.category-filter-options::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}

.category-filter-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}

.category-filter-option:hover {
  background: var(--primary-color);
  color: white;
  transform: translateX(4px);
}

.category-filter-option.selected {
  background: var(--primary-color);
  color: white;
}

.category-filter-option:last-child {
  border-bottom: none;
}

/* Legacy Category Filter Select Dropdown (for backward compatibility) */
.category-filter-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  transition: var(--transition);
  background: var(--surface-color);
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

.category-filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.category-filter-select:hover {
  border-color: var(--primary-color);
}

/* Legacy category filter styles for backward compatibility */
.category-filter {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--surface-color);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: var(--transition);
}

.category-filter:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.product-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--surface-color);
}

.product-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* Product Search Dropdown */
.product-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
  animation: slideDown 0.2s ease-out;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) #e5e7eb;
}

.product-search-dropdown::-webkit-scrollbar {
  width: 6px;
}

.product-search-dropdown::-webkit-scrollbar-track {
  background: #e5e7eb;
  border-radius: 3px;
}

.product-search-dropdown::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

.product-search-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-search-options {
  padding: 0.5rem 0;
}

.product-category-header {
  padding: 0.5rem 1rem;
  background: var(--background-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  margin-top: 0.5rem;
}

.product-search-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}

.product-search-option:hover {
  background: var(--primary-color);
  color: white;
  transform: translateX(4px);
}

.product-search-option.selected {
  background: var(--primary-color);
  color: white;
}

.add-new-product-option {
  padding: 0.75rem 1rem;
  border-top: 2px solid var(--border-color);
  background: var(--background-color);
}

.add-new-product-btn {
  background: var(--success-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 0.875rem;
  transition: var(--transition);
  width: 100%;
}

.add-new-product-btn:hover {
  background: #059669;
  transform: scale(1.02);
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.add-stock-item-btn {
  background: transparent;
  color: var(--success-color);
  border: 1px solid var(--success-color);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: var(--transition);
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.add-stock-item-btn:hover {
  background: var(--success-color);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Submit button container for centering */
.submit-button-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

/* Submit button - Professional and Centered */
.submit-btn {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  padding: 0.75rem 2rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: auto;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  position: relative;
  overflow: hidden;
  z-index: 10;
}

.submit-btn:hover:not(:disabled) {
  background: var(--primary-color);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Button text transitions */
.btn-text {
  transition: var(--transition);
  font-weight: 600;
}

/* Professional Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease-out;
}

.loading-content {
  background: white;
  padding: 3rem;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  z-index: 10000;
}

.loading-spinner-container {
  position: relative;
  width: 60px;
  height: 60px;
}

.loading-spinner-circle {
  width: 100%;
  height: 100%;
  border: 3px solid #e5e7eb;
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text-container {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.loading-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: #374151;
}

.loading-dots {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary-color);
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0%, 20% { opacity: 0; }
  40% { opacity: 1; }
  60% { opacity: 1; }
  80%, 100% { opacity: 1; }
}

/* Success Overlay */
.success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease-out;
}

.success-content {
  background: white;
  padding: 3rem;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  z-index: 10000;
}

.success-icon-container {
  width: 80px;
  height: 80px;
  background: var(--success-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: successBounce 0.6s ease-out;
}

.success-icon {
  color: white;
  animation: successCheck 0.6s ease-out 0.2s both;
}

.success-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.success-message {
  font-size: 1rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes successBounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes successCheck {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 768px) {
  /* Container adjustments */
  .container {
    padding: 0.5rem;
    margin: 0;
    max-width: 100%;
  }
  
  .form-container {
    padding: 1rem;
    margin: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  /* Header adjustments */
  .form-title, h1 {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
  }
  
  /* Form grid adjustments */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Product label container - stack on mobile */
  .product-label-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }
  
  .product-label-container label {
    flex: none;
    width: 100%;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }
  
  /* Category filter container - full width on mobile */
  .category-filter-container {
    width: 100%;
    min-width: unset;
    margin-bottom: 0.75rem;
  }
  
  /* Product search filters - full width stack */
  .product-search-filters {
    margin-bottom: 0.75rem;
  }
  
  /* Product search container - mobile optimized */
  .product-search-container {
    width: 100%;
    margin-bottom: 1.5rem;
  }
  
  /* Product search input - larger touch target */
  .product-search-input {
    width: 100%;
    padding: 1rem;
    font-size: 16px !important;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    background: var(--surface-color);
    margin-bottom: 0;
  }
  
  .product-search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  }
  
  /* Stock item fields - better mobile layout */
  .stock-item-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  .stock-item-fields label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
  }
  
  .stock-item-fields input[type="number"] {
    padding: 1rem;
    font-size: 16px !important;
    border-radius: 8px;
    border: 2px solid var(--border-color);
  }
  
  /* Input adjustments - prevent zoom on iOS */
  input, textarea, select {
    font-size: 16px !important;
    padding: 0.875rem 1rem;
    border-radius: 8px;
  }
  
  /* Button adjustments */
  .btn {
    padding: 0.875rem 1rem;
    font-size: 1rem;
    width: 100%;
    justify-content: center;
    border-radius: 8px;
  }
  
  .add-stock-item-btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  .submit-btn {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1rem;
    min-width: unset;
  }
  
  /* Stock item adjustments */
  .stock-item-row {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
  }
  
  .stock-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .stock-item-header h5 {
    margin-bottom: 0;
    font-size: 1rem;
  }
  
  .remove-item-btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
    font-size: 0.875rem;
  }
  
  /* Dropdown adjustments */
  .product-search-dropdown,
  .category-filter-dropdown {
    max-height: 40vh;
    font-size: 1rem;
    border-radius: 8px;
  }
  
  .product-search-option,
  .category-filter-option {
    padding: 1rem;
    font-size: 1rem;
  }
  
  /* Category filter button */
  .category-filter-button {
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border-radius: 8px;
  }
  
  /* Search inputs */
  .product-search-input,
  .category-filter-search-input {
    font-size: 16px !important;
    padding: 0.875rem 1rem;
    border-radius: 8px;
  }
  
  /* Expanded container adjustment */
  .product-search-container.expanded {
    margin-bottom: 45vh;
  }
  
  /* Product search dropdown - mobile optimized */
  .product-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 50vh;
    overflow-y: auto;
    margin-top: 0.25rem;
  }
  
  /* Product search options - mobile friendly */
  .product-search-option {
    padding: 1rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
  }
  
  .product-search-option:hover,
  .product-search-option.selected {
    background: var(--primary-color);
    color: white;
  }
  
  .product-search-option:last-child {
    border-bottom: none;
  }
  
  /* Category headers in product dropdown */
  .product-category-header {
    padding: 0.75rem 1rem;
    background: var(--background-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    margin: 0;
  }
  
  /* Add new product button in dropdown */
  .add-new-product-option {
    padding: 1rem;
    border-top: 2px solid var(--border-color);
    background: var(--background-color);
  }
  
  .add-new-product-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 8px;
    background: var(--success-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
  }
  
  .add-new-product-btn:hover {
    background: #059669;
  }
  
  /* Loading and success overlays */
  .loading-content,
  .success-content {
    padding: 2rem;
    margin: 1rem;
    width: calc(100% - 2rem);
    max-width: 350px;
  }
  
  .loading-text,
  .success-title {
    font-size: 1rem;
  }
  
  .success-message {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  /* Extra small screens */
  .container {
    padding: 0.25rem;
  }
  
  .form-container {
    padding: 0.75rem;
    margin: 0.25rem;
  }
  
  .form-title, h1 {
    font-size: 1.25rem;
  }
  
  /* Smaller gaps and padding */
  .form-grid {
    gap: 0.75rem;
  }
  
  .product-label-container {
    gap: 0.25rem;
  }
  
  input, textarea, select {
    padding: 0.75rem;
    font-size: 16px !important;
  }
  
  .btn {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  
  .stock-item-row {
    padding: 0.75rem;
  }
  
  .stock-item-header h5 {
    font-size: 0.9rem;
  }
  
  /* Smaller dropdown options */
  .product-search-option,
  .category-filter-option {
    padding: 0.875rem;
    font-size: 0.9rem;
  }
  
  /* Product search container - extra small screens */
  .product-search-container {
    margin-bottom: 1.25rem;
  }
  
  /* Product search input - compact */
  .product-search-input {
    padding: 0.875rem;
    font-size: 16px !important;
  }
  
  /* Product label container - tighter spacing */
  .product-label-container {
    margin-bottom: 0.5rem;
  }
  
  .product-label-container label {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
  }
  
  /* Category filter - compact */
  .category-filter-container {
    margin-bottom: 0.5rem;
  }
  
  .category-filter-button {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  
  /* Stock item fields - compact */
  .stock-item-fields {
    gap: 0.75rem;
  }
  
  .stock-item-fields label {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
  }
  
  .stock-item-fields input[type="number"] {
    padding: 0.875rem;
  }
  
  /* Product dropdown - smaller on tiny screens */
  .product-search-dropdown {
    max-height: 45vh;
  }
  
  .product-category-header {
    padding: 0.5rem 0.875rem;
    font-size: 0.75rem;
  }
  
  .add-new-product-option {
    padding: 0.875rem;
  }
  
  .add-new-product-btn {
    padding: 0.625rem 0.875rem;
    font-size: 0.9rem;
  }
  
  /* Adjust expanded height for very small screens */
  .product-search-container.expanded {
    margin-bottom: 50vh;
  }
  
  /* Very small screen overlays */
  .loading-content,
  .success-content {
    padding: 1.5rem;
    margin: 0.5rem;
  }
  
  .loading-text,
  .success-title {
    font-size: 0.9rem;
  }
  
  .success-message {
    font-size: 0.8rem;
  }
}

/* Loading animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Success/Error messages */
.message {
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  margin: 1rem 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-md);
  border-left: 4px solid;
  animation: slideInFromTop 0.3s ease-out;
}

@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.success {
  background: #f0fdf4;
  color: #166534;
  border-left-color: #22c55e;
}

.message.error {
  background: #fef2f2;
  color: #dc2626;
  border-left-color: #ef4444;
}

.message::before {
  content: '';
  width: 20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.message.success::before {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2322c55e' stroke-width='2'%3e%3cpath d='M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z'/%3e%3c/svg%3e");
}

.message.error::before {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ef4444' stroke-width='2'%3e%3ccircle cx='12' cy='12' r='10'/%3e%3cline x1='15' y1='9' x2='9' y2='15'/%3e%3cline x1='9' y1='9' x2='15' y2='15'/%3e%3c/svg%3e");
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
} 