/* Complete styles for donor form - replaces style.css */

/* Base styles */
body {
  font-family: 'Segoe UI', sans-serif;
  background: #f7f9fc;
  margin: 0;
  padding: 0;
  font-size: 14px;
}

/* Layout with sidebar */
.app-container {
  display: flex;
  min-height: 100vh;
  gap: 15px;
}

.sidebar {
  width: 400px;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  padding: 15px;
  box-shadow: 2px 0 8px rgba(0,0,0,0.1);
  overflow-y: auto;
  max-height: 100vh;
}

.main-content {
  flex: 1;
  padding: 15px;
}

/* Sidebar styling */
.sidebar h3 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 1.1rem;
}

.sidebar-search {
  margin-bottom: 10px;
}

.sidebar-search input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  box-sizing: border-box;
}

.sidebar-search input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
}

.sidebar-filters {
  margin-bottom: 12px;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.filter-checkbox input[type="checkbox"] {
  width: auto;
}

.filter-checkbox label {
  margin: 0;
  font-size: 0.8rem;
  color: #666;
  cursor: pointer;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 15px;
}

.stat-card {
  background: #f8f9fa;
  padding: 8px;
  border-radius: 6px;
  text-align: center;
  border: 1px solid #e9ecef;
}

.stat-number {
  font-size: 1.3rem;
  font-weight: bold;
  color: #007bff;
  display: block;
}

.stat-label {
  font-size: 0.75rem;
  color: #666;
  margin-top: 2px;
}

.donor-list {
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}

.donor-item {
  padding: 6px 10px;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}

.donor-item:hover {
  background: #f8f9fa;
  border-color: #007bff;
}

.donor-item.active {
  background: #e3f2fd;
  border-color: #007bff;
}

.donor-item.hidden {
  display: none;
}

.donor-name {
  font-weight: 600;
  color: #333;
  font-size: 0.85rem;
}

.donor-company {
  color: #666;
  font-size: 0.75rem;
  margin-top: 1px;
}

.donor-items {
  color: #007bff;
  font-size: 0.75rem;
  margin-top: 2px;
  font-weight: 500;
}

.donor-items.no-items {
  color: #999;
}

.no-results {
  text-align: center;
  color: #666;
  padding: 15px;
  font-style: italic;
}

/* Compact form styling */
.form-container {
  max-width: 750px;
}

.form-header {
  color: black;
  padding: 12px;
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
  text-align: center;
}

.form-header h1 {
  margin: 0;
  font-size: 1.3rem;
}

.form-header p {
  margin: 2px 0 0 0;
  opacity: 0.9;
  font-size: 0.85rem;
}

form {
  background: #fff;
  padding: 12px;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-top: 0;
}

/* Very compact form sections */
.form-section {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 8px;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}

/* Tight input styling */
label { 
  display: block; 
  margin-bottom: 2px; 
  font-weight: 600;
  font-size: 0.8rem;
  color: #555;
}

input[type="text"], input[type="email"], input[type="tel"], input[type="number"], 
textarea, select { 
  width: 100%; 
  padding: 5px 8px; 
  border: 1px solid #ddd; 
  border-radius: 4px; 
  box-sizing: border-box; 
  font-family: 'Segoe UI', sans-serif;
  font-size: 0.8rem;
  transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
}

.flex-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.flex-row > div {
  flex: 1;
}

/* Compact item boxes */
.item-box {
  background: #f8f9fa;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid #e9ecef;
}

.item-box textarea {
  margin-bottom: 6px;
  grid-row: 2;
}

/* CRITICAL: Horizontal inline layout for Category, Quantity, Value */
.item-inline-row {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 6px;
}

.item-inline-row .category-field {
  flex: 2;
  min-width: 0;
}

.item-inline-row .quantity-field,
.item-inline-row .value-field {
  flex: 1;
  min-width: 70px;
}

.item-inline-row label {
  display: block;
  margin-bottom: 2px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #555;
}

/* .item-inline-row input,
.item-inline-row select {
  width: 100%;
  padding: 4px 6px;
  font-size: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 3px;
  box-sizing: border-box;
}

.item-inline-row input:focus,
.item-inline-row select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
}
  */
/* Remove number input arrows across browsers */
.item-inline-row input[type="number"] {
  -moz-appearance: textfield; /* Firefox */
  -webkit-appearance: none;   /* Chrome, Safari, Edge */
  appearance: none;           /* Standard */
}

/* Remove spin buttons in WebKit browsers */
.item-inline-row input[type="number"]::-webkit-inner-spin-button,
.item-inline-row input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Shared input/select styling */
.item-inline-row input,
.item-inline-row select {
  width: 100%;
  padding: 4px 6px;
  font-size: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 3px;
  box-sizing: border-box;
}

/* Focus styles */
.item-inline-row input:focus,
.item-inline-row select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
}




/* New category section */
.new-category-section {
  margin-top: 6px;
  padding: 6px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.new-category-inputs {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.new-category-inputs input {
  flex: 1;
  padding: 4px 6px;
  font-size: 0.75rem;
}

.new-category-inputs button {
  padding: 4px 8px;
  font-size: 0.7rem;
}

/* Compact button styling */
.btn-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 8px;
}

button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.8rem;
}

button[type="submit"] { 
  background: #007bff; 
  color: white; 
  padding: 8px 16px;
  font-size: 0.85rem;
}

button[type="submit"]:hover { 
  background: #0056b3; 
}

button[type="button"] { 
  background: #6c757d; 
  color: white;
}

button[type="button"]:hover { 
  background: #545b62; 
}

#addItemBtn {
  background: #28a745;
  color: white;
}

#addItemBtn:hover {
  background: #1e7e34;
}

/* Item action buttons - very small */
.item-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 6px;
}

.item-actions button {
  padding: 3px 6px;
  font-size: 0.7rem;
}

.btn-repeat {
  background: #17a2b8;
  color: white;
}

.btn-repeat:hover {
  background: #138496;
}

.btn-remove {
  background: #dc3545;
  color: white;
}

.btn-remove:hover {
  background: #c82333;
}

/* Category management buttons */
.btn-save-category {
  background: #007bff;
  color: white;
  padding: 3px 6px;
  border-radius: 3px;
  border: none;
  font-size: 0.7rem;
}

.btn-cancel-category { 
  background: #dc3545; 
  color: white; 
  padding: 3px 6px;
  border-radius: 3px;
  border: none;
  font-size: 0.7rem;
}

/* Messages */
.error { 
  color: #dc3545; 
  background: #f8d7da; 
  padding: 6px 10px; 
  border-radius: 4px; 
  margin: 8px 0; 
  font-size: 0.8rem;
}

.success { 
  color: #155724; 
  background: #d4edda; 
  padding: 6px 10px; 
  border-radius: 4px; 
  margin: 8px 0; 
  font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    max-height: 250px;
  }
  
  .flex-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .item-inline-row {
    flex-direction: column;
    gap: 6px;
  }
}