/* === CSS Variables for Consistent Themming === */
:root {
  --primary-color: #007bff;
  --primary-hover: #0056b3;
  --success-color: #28a745;
  --success-hover: #1f7a33;
  --danger-color: #dc3545;
  --text-color: #333;
  --bg-color: #f4f4f4;
  --surface-color: #fff;
  --border-color: #ccc;
  --border-radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --spacing-xs: 5px;
  --spacing-sm: 10px;
  --spacing-md: 15px;
  --spacing-lg: 20px;
}

/* === Mobile-First Base Styles === */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-color);
  margin: 0;
  padding: var(--spacing-sm);
  color: var(--text-color);
  line-height: 1.5;
  font-size: 16px; /* Base font size for rem units */
}

.container {
  background: var(--surface-color);
  width: 100%;
  margin: 0 auto;
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

/* === Typography === */
h1, h2, h3 {
  text-align: center;
  font-weight: 600;
  margin: 0 0 var(--spacing-md) 0;
  line-height: 1.3;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }

/* === Form Elements - Mobile Optimized === */
label {
  font-weight: 600;
  display: block;
  margin-top: var(--spacing-md);
  font-size: 0.95rem;
}

input, select, textarea {
  width: 100%;
  padding: var(--spacing-sm);
  margin-top: var(--spacing-xs);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  background: #fff;
  -webkit-appearance: none; /* Remove iOS default styling */
  appearance: none;
}

/* Improve touch targets for mobile */
input, select, textarea, button {
  min-height: 44px; /* Minimum touch target size */
}

textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.4;
}

/* === Buttons - Mobile Friendly === */
button {
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  border-radius: var(--border-radius);
  background: var(--primary-color);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: var(--spacing-md);
  transition: all 0.2s ease;
  display: inline-block;
  text-align: center;
  min-height: 44px; /* Touch-friendly */
}

button:hover, button:focus {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.small-btn {
  background: var(--success-color);
  font-size: 0.9rem;
  padding: 8px 12px;
  min-height: 36px;
}

.small-btn:hover {
  background: var(--success-hover);
}

/* Button group for multiple buttons */
.button-group {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.button-group button {
  flex: 1;
  min-width: 120px;
}

/* === Lists - Responsive Layout === */
ul {
  list-style: none;
  padding: 0;
  margin-top: var(--spacing-md);
}

li {
  background: #f9f9f9;
  padding: var(--spacing-sm);
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-sm);
  display: flex;
  flex-direction: column; /* Stack on mobile */
  gap: var(--spacing-sm);
}

li > div:first-child {
  flex: 1;
}

/* List actions (buttons in list items) */
.list-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: flex-end;
}

.list-actions button {
  margin-top: 0;
  flex: none;
  min-width: 80px;
}

/* === Messages === */
#msg {
  margin-top: var(--spacing-md);
  text-align: center;
  font-weight: bold;
  padding: var(--spacing-sm);
  border-radius: var(--border-radius);
}

.success { 
  color: var(--success-color);
  background: #f8fff9;
  border: 1px solid var(--success-color);
}

.error { 
  color: var(--danger-color);
  background: #fff8f8;
  border: 1px solid var(--danger-color);
}

/* === Tablet Styles (768px and up) === */
@media (min-width: 768px) {
  body {
    padding: var(--spacing-lg);
  }
  
  .container {
    max-width: 600px;
    padding: var(--spacing-lg);
  }
  
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.3rem; }
  
  /* Switch list items to horizontal layout on tablet */
  li {
    flex-direction: row;
    align-items: center;
  }
  
  .list-actions {
    flex-shrink: 0;
  }
  
  /* Form elements can be slightly larger */
  input, select, textarea {
    padding: 12px;
  }
}

/* === Desktop Styles (1024px and up) === */
@media (min-width: 1024px) {
  .container {
    max-width: 800px;
    padding: 30px;
  }
  
  body {
    font-size: 17px;
  }
  
  /* Larger touch targets aren't needed on desktop */
  input, select, textarea, button {
    min-height: auto;
  }
  
  button {
    min-height: 44px; /* But keep buttons accessible */
  }
}

/* === Very Small Mobile Devices (under 360px) === */
@media (max-width: 359px) {
  body {
    padding: 8px;
    font-size: 15px;
  }
  
  .container {
    padding: 12px;
    border-radius: 6px;
  }
  
  h1 { font-size: 1.3rem; }
  h2 { font-size: 1.1rem; }
  h3 { font-size: 1rem; }
  
  button, .small-btn {
    width: 100%;
    margin-top: var(--spacing-sm);
  }
  
  .button-group {
    flex-direction: column;
  }
}

/* === Utility Classes === */
.text-center { text-align: center; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.hidden-mobile { display: none; }

@media (min-width: 768px) {
  .hidden-mobile { display: block; }
  .hidden-desktop { display: none; }
}

/* === Focus States for Accessibility === */
input:focus, select:focus, textarea:focus, button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ===== Optional: header-related helpers if any page uses them ===== */
.header-gear {
  font-size: 1.3rem;
  text-decoration: none;
  color: #ecf0f1;
}

.header-gear:hover {
  opacity: 0.8;
}

/* === Inventory.php table header ===*/
/* Inventory table ONLY */
.inventory-table thead th {
    background-color: #000 !important;
    color: #fff !important;
}

.inventory-table thead th i {
    color: #fff !important; /* keep icons visible */
}

/* ================================
   Variants table header (Michelle²)
   ================================ */
.variants-head th {
    background: #2c3e50;      /* Michelle² dark blue */
    color: #ffffff;           /* High contrast text */
    font-weight: 600;
    padding: 12px;
    border-bottom: 2px solid #1a252f;
    white-space: nowrap;
}

.variants-head th{
  background:#2c3e50;
  color:#fff;
  font-weight:600;
  border-bottom:2px solid #1a252f;
  white-space:nowrap;
}
