/* ===========================
   Global reset & base styles
   =========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.5;
  color: #333333;                     /* var(--text-primary) */
  background-color: #f9fafb;          /* fixed light-grey */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;                      /* var(--spacing-4) */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===========================
   Header
   =========================== */
header {
  text-align: center;
  margin-bottom: 2rem;                /* var(--spacing-8) */
  padding: 1.5rem 0;                  /* var(--spacing-6) 0 */
}

header h1 {
  font-size: 2.5rem;
  font-weight: 600;
  color: #3367d6;                     /* var(--primary-color) */
  margin-bottom: 0.5rem;              /* var(--spacing-2) */
}

header p {
  color: #6b7280;                     /* var(--text-secondary) */
  font-size: 1.125rem;
}

/* ===========================
   Main two-column layout
   =========================== */
main {
  display: flex;
  gap: 1.5rem;                        /* var(--spacing-6) */
  flex-grow: 1;
}

.generator-card {
  width: 30%;                         /* var(--generator-width) */
  background-color: #ffffff;
  border-radius: 0.5rem;              /* var(--border-radius-lg) */
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.1),
              0 2px 4px -1px rgba(0,0,0,.06); /* var(--shadow-md) */
  padding: 1.5rem;                    /* var(--spacing-6) */
  height: fit-content;
}

.results-card {
  width: 70%;                         /* var(--results-width) */
  background-color: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.1),
              0 2px 4px -1px rgba(0,0,0,.06);
  padding: 1.5rem;
  height: fit-content;
}

/* ===========================
   Headings & helpers
   =========================== */
h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;              /* var(--spacing-6) */
  color: #333333;
}

h3 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.75rem;             /* var(--spacing-3) */
  color: #333333;
}

.required { color: #dc2626; }         /* var(--error-color) */

/* ===========================
   Button family
   =========================== */
.btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.75rem 1.5rem !important;        /* 3 & 6 */
  border-radius: 0.375rem !important;        /* md */
  font-weight: 500 !important;
  font-size: 1rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  border: none !important;
  outline: none !important;
}

.btn:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}

.btn-primary       { background-color: #3367d6 !important; color: #ffffff !important; }
.btn-primary:hover { background-color: #0d47a1 !important; transform: translateY(-1px) !important; }
.btn-primary:active{ transform: translateY(0) !important; }

.btn-secondary {
  background-color: #f5f7fa !important;
  color: #333333 !important;
  border: 1px solid #e5e7eb !important;
}
.btn-secondary:hover:not(:disabled) { background-color: #e9ecef !important; }

.btn-icon {
  padding: 0.5rem !important;                /* spacing-2 */
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  color: #3367d6 !important;
  border-radius: 0.25rem !important;         /* sm */
}
.btn-icon:hover:not(:disabled) { background-color: rgba(51,103,214,.1) !important; }
.btn-icon:disabled            { color: #6b7280 !important; cursor: not-allowed !important; }

.btn-icon .icon {
  font-size: 1.25rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.btn-remove {
  color: #dc2626 !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  padding: 0.25rem 0.5rem !important;        /* 1 & 2 */
  border-radius: 0.25rem !important;
  font-size: 0.875rem !important;
  transition: all 0.2s ease !important;
}
.btn-remove:hover { background-color: rgba(220,38,38,.1) !important; }

.btn:active:not(:disabled) { transform: scale(.98) !important; }

.btn-success { animation: pulse .4s ease !important; color: #10b981 !important; }

/* action bar above results */
.results-actions {
  margin-bottom: 1rem;
  display: flex;
  justify-content: flex-end;
}

/* ===========================
   Forms
   =========================== */
.generator-form { display: flex; flex-direction: column; gap: 1rem; }

.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1rem; }

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #333333;
}

/* Input / textarea / select base */
.form-control,
.form-control:focus,
.form-control::placeholder,
.form-control.error {
  /* every declaration ends with !important per “input” requirement */
}

.form-control {
  width: 100% !important;
  padding: 0.75rem !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 0.375rem !important;
  font-size: 1rem !important;
  color: #333333 !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}

.form-control:focus {
  outline: none !important;
  border-color: #5e8eff !important;
  box-shadow: 0 0 0 3px rgba(51,103,214,.2) !important;
}

.form-control::placeholder {
  color: #6b7280 !important;
  opacity: .7 !important;
}

.form-control.error { border-color: #dc2626 !important; }

.error-message {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.25rem;                /* spacing-1 */
}

.form-actions { display: flex; gap: 1rem; margin-top: 1rem; }

/* preview block inside generator */
.sku-preview {
  background-color: #f5f7fa;
  padding: 1rem;
  border-radius: 0.375rem;
  margin: 1rem 0;
}

.preview-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
  padding: 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
	overflow-x:scroll;
}

.sku-preview-text {
  font-family: monospace;
  font-size: 1.125rem;
  color: #0d47a1;
  font-weight: 600;
}

/* ===========================
   Results summary header
   =========================== */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.results-count        { font-size: 1rem; color: #6b7280; font-weight: 500; }
.results-count span   { color: #3367d6;  font-weight: 600; }

/* ===========================
   Table & scroll wrapper
   =========================== */
.table-container {
  overflow-y: auto;
  max-height: 600px;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
}

table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 0.9rem !important;
}

thead {
  position: sticky;
  top: 0;
  background-color: #f5f7fa;
  z-index: 10;
}

th {
  text-align: left !important;
  padding: 0.75rem !important;
  font-weight: 600 !important;
  color: #333333 !important;
  border-bottom: 2px solid #e5e7eb !important;
}

td {
  padding: 0.75rem !important;
  border-bottom: 1px solid #e5e7eb !important;
  color: #333333 !important;
}

tbody tr:hover { background-color: rgba(51,103,214,.05); }

/* monospace cell */
.sku-cell { font-family: monospace; font-weight: 500; color: #0d47a1; }

tr.new-row { animation: fadeIn .3s ease-out; }

/* ===========================
   Animations
   =========================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ===========================
   Responsive tweaks
   =========================== */
@media (max-width: 968px) {
  main { flex-direction: column; }
  .generator-card,
  .results-card { width: 100%; margin-bottom: 1.5rem; }
}

@media (max-width: 768px) {
  .table-container { overflow-x: auto; }
  table            { min-width: 700px !important; }
	.preview-container {
  display: block;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
  padding: 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
		overflow-x:scroll;
}
}

@media (max-width: 640px) {
  #app { padding: 1rem 0.5rem; }              /* spacing-4 & 2 */
  header h1 { font-size: 2rem; }
  .generator-card,
  .results-card { padding: 1rem; }            /* spacing-4 */
  .form-row { grid-template-columns: 1fr; }
}
