/* ============================================================================
   Variables & Base
============================================================================ */
:root {
  --color-primary: #f89b1c;
  --color-accent: #ffc600;
  --color-danger: #cc0000;
  --color-text-dark: #1a1a1a;
  --color-bg-light: #f4f6f8;
  --color-bg-lighter: #ffffff;
  --color-bg-dark: #1a1a1a;
  --font-sans: 'Segoe UI', sans-serif;
  --transition-fast: 0.2s ease;
  --breakpoint-mobile: 600px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--color-bg-light);
  color: var(--color-text-dark);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100vh;
}

main {
  flex: 1;
}

/* ============================================================================
   Dark Mode
============================================================================ */
.dark-mode {
  background-color: var(--color-bg-dark);
  color: #eee;
}

.dark-mode h1,
.dark-mode h2,
.dark-mode h3,
.dark-mode p,
.dark-mode .greeting,
.dark-mode table th,
.dark-mode table td {
  color: #eee;
}

.dark-mode .tab-pane p {
  color: #ccc;
}

.dark-mode .btn--primary {
  background-color: #ffc600;
  color: #1a1a1a;
}

.dark-mode .btn--danger {
  background-color: #cc0000;
  color: #fff;
}

/* ============================================================================
   Typography & Utility
============================================================================ */
h1, h2, h3, h4, h5 {
  margin: 0 0 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
}

a {
  text-decoration: none;
  color: inherit;
  transition: opacity var(--transition-fast);
}

a:hover {
  opacity: 0.8;
}

p {
  margin: 0 0 1rem;
}

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

.container {
  padding: 2rem;
  max-width: 960px;
  margin: 0 auto;
}

/* ============================================================================
   Header Bar (Admin)
============================================================================ */
.header-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background-color: white;
  border-bottom: 1px solid #eee;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.greeting {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-dark);
}

.top-logo img {
  width: 180px;
  max-width: 180px;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.top-logo img:hover {
  opacity: 1;
  transform: scale(1.02);
}

/* ============================================================================
   Sidebar Menu (Admin)
============================================================================ */
.sidebar-menu {
  position: fixed;
  top: 64px;
  left: 0;
  width: 240px;
  height: calc(100% - 64px);
  background: white;
  border-right: 1px solid #ddd;
  box-shadow: 2px 0 8px rgba(0,0,0,0.05);
  display: none;
  flex-direction: column;
  padding: 1rem;
  z-index: 999;
  overflow-y: auto;
}

.sidebar-menu.open {
  display: flex;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-nav li a {
  color: var(--color-primary);
  font-weight: 600;
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.sidebar-nav li a:hover,
.sidebar-nav li.active a {
  background-color: var(--color-bg-light);
}

.logout-dropdown {
  color: var(--color-danger);
  font-weight: bold;
}

/* ============================================================================
   Hamburger Button
============================================================================ */
.hamburger {
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-primary);
}

/* ============================================================================
   Main Content Area (Admin)
============================================================================ */
.main-content {
  flex: 1;
  padding: 2rem;
  margin-left: 240px;
  margin-top: 64px;
}

@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
  }

  .sidebar-menu {
    width: 100%;
    height: auto;
    position: absolute;
    top: 64px;
    left: 0;
  }
}

/* ============================================================================
   Tab Content (Admin)
============================================================================ */
.tab-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.tab-pane h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.tab-pane p {
  font-size: 0.95rem;
  color: #555;
}

/* ============================================================================
   Table Styling
============================================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

table th,
table td {
  padding: 0.75rem;
  border: 1px solid #ddd;
  text-align: left;
  font-size: 0.9rem;
}

table th {
  background-color: var(--color-bg-lighter);
  font-weight: 600;
}

/* ============================================================================
   Buttons
============================================================================ */
.btn {
  display: inline-block;
  padding: 0.4rem .75rem;
  border-radius: 0.25rem;
  font-weight: bold;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  font-size: .85rem;
}

.btn--primary {
  background-color: var(--color-primary);
  color: white;
  border: none;
}

.btn--danger {
  background-color: var(--color-danger);
  color: white;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.15);
}

/* ============================================================================
   Dashboard Cards
============================================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--color-bg-lighter);
  border-radius: 0.5rem;
  padding: 1.25rem;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease;
}

.card:hover {
  transform: scale(1.02);
}

/* ============================================================================
   Hero / Coming Soon / Login
============================================================================ */
.hero,
.coming-soon-wrapper {
  position: relative;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: var(--color-bg-lighter);
  padding: 5rem 1rem;
  overflow: hidden;
}

.hero .overlay {
  position: absolute;
  inset: 0;
  opacity: 0.05;
}

.hero .content {
  position: relative;
  padding: 1rem;
  max-width: 480px;
  margin: 0 auto;
}

.hero-title,
.message h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.hero-subtitle,
.message p {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  color: #555;
}

.hero-logo,
.logo img {
  max-width: 400px;
  width: 100%;
  margin: 0 auto 2rem;
  display: block;
  animation: logo-bounce 2s ease-in-out infinite;
}

.hero-buttons {
  margin-top: 1.5rem;
}

.hero-buttons .btn {
  margin: 0 0.5rem;
  animation: fade-in-up 1.4s ease-out forwards;
}

/* ============================================================================
   Login Styles
============================================================================ */
.login-wrapper,
.login-screen {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(to bottom, #e6e9f0, #eef1f5);
  padding: 2rem;
}

.login-box {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.1);
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.login-panel {
  width: 100%;
  max-width: 360px;
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-logo {
  width: 120px;
  margin-bottom: 1rem;
}

.login-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.login-header {
  margin: 0;
  text-align: center;
  font-size: 1.75rem;
  color: var(--color-primary);
}

.login-subtitle,
.login-sub {
  font-size: 0.95rem;
  color: #666;
  text-align: center;
}

.login-sub {
  margin-top: 0.25rem;
  margin-bottom: 1rem;
}

.login-subtitle {
  margin-bottom: 1.5rem;
}

.login-error {
  color: var(--color-danger);
  margin-bottom: 1rem;
  text-align: center;
  font-weight: bold;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.form-group label {
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  font-weight: bold;
  text-align: left;
}

.form-group input {
  height: 2.5rem;
  font-size: 0.95rem;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 0.25rem;
}

.login-reset {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.login-reset a {
  color: var(--color-primary);
  text-decoration: underline;
  transition: color 0.2s ease;
}

.login-reset a:hover {
  color: var(--color-danger);
}

/* ============================================================================
   Footer
============================================================================ */
.site-footer {
  text-align: center;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  color: #555;
  background-color: var(--color-bg-lighter);
  border-top: 1px solid #ddd;
  box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.05);
  width: 100%;
  margin-top: auto;
}

.site-footer p {
  margin: 0.25rem 0;
  text-align: center;
}

.site-footer strong a {
  color: var(--color-primary);
  font-weight: 600;
}

/* ============================================================================
   Animations
============================================================================ */
@keyframes logo-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

@keyframes fade-in {
  0% { opacity: 0; transform: translateY(-20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-up {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ============================================================================
   Responsive Tweaks
============================================================================ */
@media (max-width: var(--breakpoint-mobile)) {
  .hero-title,
  .message h1 {
    font-size: 1.75rem;
  }

  .hero-subtitle,
  .message p {
    font-size: 0.9rem;
  }

  .top-logo img {
    width: 120px;
  }

  .main-content {
    padding: 1rem;
  }

  .login-panel {
    padding: 1.5rem;
  }
}

/* ============================================================================
   New Items Workspace
============================================================================ */
.workspace {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.names-column,
.photos-column {
  flex: 1;
  min-width: 280px;
}

.names-column h3,
.photos-column h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  color: var(--color-primary);
}


/* ============================================================================
   Name List with Radio Buttons and Dropdown
============================================================================ */
#nameList {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  background-color: var(--color-bg-lighter);
}

#nameList li {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eee;
  transition: background 0.2s ease;
}

#nameList li:hover {
  background-color: var(--color-bg-light);
}

#nameList li label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  cursor: pointer;
}

#nameList input[type="radio"] {
  accent-color: var(--color-primary);
  width: 18px;
  height: 18px;
}

#nameList li.attached {
  opacity: 0.5;
  pointer-events: none;
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.caret-toggle {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--color-primary);
}

.item-details {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: var(--color-bg-light);
  border-radius: 0.5rem;
  border: 1px solid #ddd;
}

.item-details.hidden {
  display: none;
}
.match-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.photo-indicator {
  color: green;
  font-size: 1rem;
  margin-left: 6px;
}

/* ============================================================================
   Photo Grid with Checkboxes
============================================================================ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
}

.photo-check {
  position: relative;
  display: block;
  padding-bottom: 1.5rem;
}

.photo-check img {
  width: 100%;
  height: auto;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.photo-check img:hover {
  transform: scale(1.02);
  border-color: var(--color-accent);
}

.photo-check img.selected {
  border-color: var(--color-primary);
  opacity: 0.9;
}

.photo-check img.attached {
  opacity: 0.5;
  pointer-events: none;
}

.photo-check input[type="checkbox"] {
  position: absolute;
  bottom: 6px;
  left: 6px;
  z-index: 2;
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.photo-check img.selected {
  box-shadow: 0 0 0 3px var(--color-primary);
}
  
  /* ============================================================================
   Modal Styling (continued)
============================================================================ */
.modal-content .form-group {
  margin-bottom: 1rem;
}

.modal-content .form-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
}

.modal-content .form-group input,
.modal-content .form-group select {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 0.25rem;
}

.modal-content button {
  margin-top: 1rem;
  margin-right: 0.5rem;
}

.modal {
    opacity:0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

/* ============================================================================
   Modal Container (Popup Overlay)
============================================================================ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================================
   Modal Content Box
============================================================================ */
.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 0.5rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
  position: relative;
  z-index: 10001;
}

/* ============================================================================
   Utility Class to Hide Modals
============================================================================ */
.hidden {
  display: none;
}
/* ============================================================================
   Drop Zone for Drag-and-Drop Upload
============================================================================ */
.drop-zone {
  border: 2px dashed #ccc;
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  background-color: var(--color-bg-lighter);
  transition: background 0.2s ease;
}

.drop-zone:hover {
  background-color: var(--color-bg-light);
}

.drop-zone input[type="file"] {
  display: none;
}

/* ============================================================================
   Checkbox Group for Flags
============================================================================ */
.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin-right: 0.25rem;
}


.checkbox-group label {
  font-size: 0.9rem;
  cursor: pointer;
}

/* ============================================================================
   Price Input with Dollar Prefix
============================================================================ */
.price-input {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.price-input span {
  font-weight: bold;
  font-size: 1rem;
}

/* ============================================================================
   Responsive Tweaks
============================================================================ */
@media (max-width: 768px) {
  .workspace {
    flex-direction: column;
  }

  .search-filter-row,
  .add-buttons-row,
  .match-row {
    flex-direction: column;
    text-align: left;
  }

  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .modal-content {
    padding: 1.5rem;
  }
}

.hidden {
    display: none;
}
}

/*============================================================================
Matched In Admin Portal
============================================================================*/
.matched {
  opacity: 0.6;
  pointer-events: none;
}
.match-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #d4edda;
  color: #155724;
  padding: 2px 6px;
  font-size: 0.8rem;
  border-radius: 4px;
}

.item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.item-header label {
  flex: 1;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.status-badge {
  padding: 4px 8px;
  background-color: #eee;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: nowrap;
  margin-left: 8px;
}


/*===========================================================================
  Inventory Tab Style
==========================================================================*/
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2rem;
  padding-top: 2rem;
}

.product-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  padding: 1rem;
  text-align: center;
}

.product-card img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.price {
  font-weight: bold;
  color: #0073e6;
  margin-top: 0.5rem;
}

.inventory-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

#searchInput, #classFilter, #conditionFilter {
  padding: 0.6rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2rem;
}

.product-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  padding: 1rem;
  text-align: center;
}

.product-card img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.condition {
  font-size: 0.9rem;
  color: #555;
}

.price {
  font-weight: bold;
  color: #0073e6;
  margin-top: 0.5rem;
}

.btn-preview,
.btn-cart-mock {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.btn-preview {
  background-color: #eee;
}

.btn-cart-mock {
  background-color: #2b9348;
  color: #fff;
}

.main-photo img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: opacity 0.3s ease;
}

.photo-thumbnails {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  overflow-x: auto;
}

.thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.thumbnail:hover {
  transform: scale(1.05);
}