/* =====================================================
 * PRICE LIST - BLUEPRINT NOIR DARK THEME
 * Search, quick add, and table styles
 * ===================================================== */

/* ===== SEARCH BAR ===== */
.search-bar-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-copper-light);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: #E5E7EB;
  background: var(--color-slate-dark);
  border: 1px solid rgba(212, 165, 116, 0.2);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-copper-light);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2),
              0 0 0 3px rgba(212, 165, 116, 0.15);
}

.search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 165, 116, 0.1);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  padding: 0;
  color: var(--color-copper-light);
}

.search-clear:hover {
  background: rgba(212, 165, 116, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.search-clear svg {
  width: 1rem;
  height: 1rem;
}

.search-divider {
  font-size: 0.875rem;
  color: #6B7280;
}

.search-count {
  font-size: 0.875rem;
  color: #9CA3AF;
  white-space: nowrap;
}

/* ===== QUICK ADD FORM ===== */
.quick-add-form {
  background: var(--color-slate-dark);
  border: 1px solid rgba(212, 165, 116, 0.15);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-subtle);
}

.quick-add-fields {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 1rem;
  align-items: end;
}

.quick-add-input {
  padding: 0.875rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: #E5E7EB;
  background: var(--color-slate-darker);
  border: 1px solid rgba(212, 165, 116, 0.2);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.quick-add-input:focus {
  outline: none;
  border-color: var(--color-copper-light);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2),
              0 0 0 3px rgba(212, 165, 116, 0.15);
}

.quick-add-input-small {
  max-width: 8rem;
}

.quick-add-input-medium {
  max-width: 12rem;
}

/* ===== PRICE LIST TABLE ===== */
.price-list-table-container {
  background: var(--color-slate-dark);
  border: 1px solid rgba(212, 165, 116, 0.15);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
}

.price-list-table {
  width: 100%;
  border-collapse: collapse;
}

.price-list-table thead {
  background: var(--color-slate-darker);
  border-bottom: 2px solid rgba(212, 165, 116, 0.2);
}

.price-list-table th {
  padding: 1rem 1.5rem;
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-copper-light);
}

.price-list-table tbody tr {
  border-bottom: 1px solid rgba(212, 165, 116, 0.1);
  transition: all var(--transition-quick);
}

.price-list-table tbody tr:hover {
  background: rgba(212, 165, 116, 0.05);
}

.price-list-table tbody tr:last-child {
  border-bottom: none;
}

.price-list-table td {
  padding: 1rem 1.5rem;
  font-size: 0.9375rem;
  color: #E5E7EB;
}

.th-name {
  width: auto; /* Takes remaining space - maximize for name */
}

.th-unit {
  width: 15%; /* Small - just enough for unit */
}

.th-price {
  width: 20%;
  white-space: nowrap; /* No line breaks */
}

.th-actions {
  width: 100px; /* Fixed width - exactly 2 icon buttons */
  text-align: right;
}

.td-name {
  font-weight: 500;
  color: #FFFFFF;
}

.td-unit {
  color: #9CA3AF;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.td-price {
  color: var(--color-gold-accent);
  font-family: var(--font-mono);
  font-weight: 600;
  white-space: nowrap; /* No line breaks for price values */
}

.td-actions {
  text-align: right;
  white-space: nowrap; /* Keep action buttons in one line */
}

/* ===== PRICE LIST ITEM ACTIONS ===== */
.price-list-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.price-list-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: rgba(26, 31, 38, 0.6);
  border: 1px solid rgba(212, 165, 116, 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  padding: 0;
  color: var(--color-copper-light);
  text-decoration: none;
}

.price-list-action-btn:hover {
  background: rgba(26, 31, 38, 0.9);
  border-color: var(--color-copper-light);
  transform: scale(1.1);
}

.price-list-action-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

.price-list-action-danger {
  color: #FCA5A5;
  border-color: rgba(239, 68, 68, 0.3);
}

.price-list-action-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #FCA5A5;
}

/* ===== INLINE EDIT MODE ===== */
.price-list-edit-cell {
  padding: 0 !important;
  background: var(--color-slate-darker);
}

.price-list-edit-form {
  width: 100%;
}

.price-list-edit-fields {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.5rem;
}

.price-list-edit-field {
  display: flex;
  flex-direction: column;
}

.price-list-edit-field-name {
  grid-column: 1;
}

.price-list-edit-input {
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: #E5E7EB;
  background: var(--color-slate-dark);
  border: 1px solid rgba(212, 165, 116, 0.3);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.price-list-edit-input:focus {
  outline: none;
  border-color: var(--color-copper-light);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2),
              0 0 0 3px rgba(212, 165, 116, 0.15);
}

.price-list-edit-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-edit-save {
  padding: 0.625rem 1.25rem;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1A1F26;
  background: linear-gradient(135deg, #D4A574 0%, #C89860 100%);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-edit-save:hover {
  background: linear-gradient(135deg, #E0B580 0%, #D4A574 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-edit-save:active {
  transform: translateY(0);
}

.btn-edit-cancel {
  padding: 0.625rem 1.25rem;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9CA3AF;
  background: transparent;
  border: 1px solid rgba(156, 163, 175, 0.3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-edit-cancel:hover {
  color: #E5E7EB;
  border-color: rgba(156, 163, 175, 0.5);
  background: rgba(156, 163, 175, 0.1);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .quick-add-fields {
    grid-template-columns: 1fr;
  }

  .quick-add-input-small,
  .quick-add-input-medium {
    max-width: none;
  }
}

@media (max-width: 1024px) {
  .search-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input-wrapper {
    max-width: none;
  }

  .search-bar-container {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }

  .search-count {
    text-align: center;
  }

  /* Compact 2-row, 3-column grid layout for mobile and tablets */
  .data-table thead {
    display: none; /* Hide table header on mobile */
  }

  .data-table tbody,
  .data-table tr {
    display: block;
    width: 100%;
  }

  .data-table tr {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(212, 165, 116, 0.15);
    border-radius: var(--radius-md);
    background: var(--color-slate-dark);
    padding: 0.75rem;
  }

  .data-table tr:hover {
    border-color: rgba(212, 165, 116, 0.3);
  }

  .data-table-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 !important;
    border: none;
  }

  /* Show label on mobile using data-label attribute */
  .data-table-cell::before {
    content: attr(data-label);
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--color-copper-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  /* Row 1: Numer | Klient | Status */
  .data-table-cell:nth-child(1) { grid-column: 1; grid-row: 1; }
  .data-table-cell:nth-child(2) { grid-column: 2; grid-row: 1; }
  .data-table-cell:nth-child(3) { grid-column: 3; grid-row: 1; }

  /* Row 2: Data | Kwota netto | Akcje */
  .data-table-cell:nth-child(4) { grid-column: 1; grid-row: 2; }
  .data-table-cell:nth-child(5) { grid-column: 2; grid-row: 2; }
  .data-table-cell:nth-child(6) { grid-column: 3; grid-row: 2; }

  .price-list-actions {
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .price-list-action-btn {
    width: 2rem;
    height: 2rem;
  }

  .price-list-action-btn svg {
    width: 1rem;
    height: 1rem;
  }

  /* Inline edit mode on mobile */
  .price-list-edit-cell {
    display: block !important;
    grid-template-columns: 1fr !important;
  }

  .price-list-edit-fields {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1rem;
  }

  .price-list-edit-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn-edit-save,
  .btn-edit-cancel {
    width: 100%;
    justify-content: center;
  }
}
