/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Fonts & Body */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background-color: #f9fafb;
  color: #111827;
  padding: 20px;
}

/* Layout Containers */
main {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

span {
  white-space: pre-wrap;
}

/* Navigation */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #111827;
  padding: 1rem 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  color: white;
}

nav .logo {
  list-style: none;
  font-weight: bold;
  font-size: 1.2rem;
  text-decoration: none;
  color: #f9fafb;
}

.logo-container {
  display: flex;
  align-items: center;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  /* aligns username to the right */
}

#user-name {
  font-size: 0.9rem;
  color: #9ca3af;
  /* lighter gray so it's subtle */
  margin-bottom: 4px;
  /* a little space above the links */
}

nav .nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
}

nav .nav-links a {
  color: #f9fafb;
  text-decoration: none;
  font-weight: 500;
}

nav .nav-links a:hover {
  text-decoration: underline;
}

/* Headings */
h1,
h2,
h3 {
  margin-bottom: 1rem;
  font-weight: 600;
}

/* Buttons */
.button,
.button-outline,
.button-danger {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.button {
  background-color: #2563eb;
  color: white;
}


.button:hover {
  background-color: #1d4ed8;
}

.button-outline {
  background: transparent;
  border: 2px solid #2563eb;
  color: #2563eb;
}

.button-outline:hover {
  background-color: #eff6ff;
}

.button-danger {
  background-color: #dc2626;
  color: white;
}

.button-danger:hover {
  background-color: #b91c1c;
}

#delete-button {
  background-color: red;
}

#clone-button {
  background-color: green;
}

/* Forms */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

input,
textarea {
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px #bfdbfe;
}

/* Item List */
.item-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.item-card {
  background-color: white;
  border: 1px solid #e5e7eb;
  padding: 1rem;
  border-radius: 8px;
  transition: box-shadow 0.2s ease;
}

.item-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.item-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.summary {
  margin-top: 0.5rem;
  color: #4b5563;
}

/* Tags */
.tag {
  display: inline-block;
  background-color: #e0f2fe;
  color: #0369a1;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-right: 0.4rem;
}

/* Item Details */
.item-detail .meta {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.description {
  margin-top: 1rem;
  line-height: 1.8;
}

.actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
}

/* Messages */
.success-message {
  color: #16a34a;
  font-weight: 500;
}

.error-message {
  color: #dc2626;
  font-weight: 500;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 3rem;
  color: #6b7280;
  font-size: 0.9rem;
}

.details-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1.5rem;
}

.section {
  background: white;
  border: 1px solid #e5e7eb;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Two-column middle layout */
.two-columns {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
}

.two-columns .section {
  flex: 1;
}

/* Responsive: stack columns on small screens */
@media (max-width: 768px) {
  .two-columns {
    flex-direction: column;
  }
}

.meta {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

/* Print-specific styling */
@media print {

  /* Hide the top back button and bottom actions completely */
  #back-subs,
  .actions,
  nav {
    display: none !important;
  }

  /* Reset layout to simple vertical flow for print */
  body,
  main.form-container {
    margin: 0;
    padding: 0;
    width: 100%;
  }

  .details-container {
    display: block !important;
    /* force vertical flow */
  }



  .section {
    page-break-inside: avoid;
    /* prevent sections from splitting across pages */
    margin-bottom: 1rem;
  }

  /* Ensure headings and text don't overlap */
  h2,
  h3,
  p,
  span,
  div {
    position: static !important;
  }
}

/* Container for options */
.options-container {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.option-card {
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  flex: 1;
  min-width: 350px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-option-card {
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  flex: 1;
  min-width: 350px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Search results */
.search-results {
  list-style: none;
  margin-top: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background-color: #fff;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  padding: 0;
}

.search-results li {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.search-results li:hover {
  background-color: #f3f4f6;
}

/* Style for Select Dropdowns */
select {
  appearance: none;
  /* Remove default arrow on most browsers */
  -webkit-appearance: none;
  -moz-appearance: none;

  background-color: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.75rem 2rem 0.75rem 0.75rem;
  /* Add room for custom arrow */
  font-size: 1rem;
  line-height: 1.5;
  color: #111827;
  cursor: pointer;

  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280'%3E%3Cpath d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

select:focus {
  outline: none;
  border-color: #2563eb;
  /* Match your focus color for inputs */
  box-shadow: 0 0 0 2px #bfdbfe;
}

/* Make disabled selects visually distinct */
select:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 1rem;
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.styled-table th,
.styled-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.styled-table thead {
  background-color: #f3f4f6;
  font-weight: bold;
}

.styled-table tr:hover {
  background-color: #eff6ff;
}

/* General form container */
.form-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
  font-family: Arial, sans-serif;
}

/* Section (fieldset) styling */
.form-section {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background-color: #f9f9f9;
}

.form-section legend {
  font-size: 1.2rem;
  font-weight: bold;
  color: #333;
  padding: 0 0.5rem;
}

/* Labels and inputs */
label {
  display: block;
  margin-top: 1rem;
  font-weight: bold;
  color: #444;
}

input[type="text"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
}

/* Radio groups */
.form-section div {
  margin: 0.5rem 0;
}

input[type="radio"] {
  margin-right: 0.25rem;
}

/* Submit button */
button.button {
  background-color: #0073e6;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 1rem;
}

button.button:hover {
  background-color: #005bb5;
}

/* Optional collapsible sections */
.form-section.collapsible>legend {
  cursor: pointer;
  position: relative;
}

.form-section.collapsible>legend::after {
  content: '▼';
  font-size: 0.8rem;
  position: absolute;
  right: 0;
  transition: transform 0.2s ease;
}

.form-section.collapsible.collapsed>legend::after {
  transform: rotate(-90deg);
}

.form-section.collapsed {
  max-height: 2rem;
  overflow: hidden;
  padding-bottom: 0.5rem;
}

/* Style radio button groups horizontally */
.radio-group {
  display: flex;
  gap: 1.5rem;
  /* space between each radio option */
  margin-top: 0.5rem;
  align-items: center;
}

.radio-group label {
  margin: 0;
  font-weight: normal;
  color: #333;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  /* space between the button and the label text */
}

.pub-pair {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.pub-pair select,
.pub-pair input[type="date"] {
  flex: 1;
}

/* Quick styles for the navigation arrows */
.carousel-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.carousel-btn {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  background-color: #0077cc;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.carousel-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.carousel-btn:hover:not(:disabled) {
  background-color: #005fa3;
}

/* Header container for the form */
.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

/* Style for the title on the left */
.form-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

/* Style for the submission ID on the right */
.submission-id {
  font-size: 1.2rem;
  font-weight: 500;
  color: #4b5563;
  margin: 0;
}

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  width: 300px;
  position: relative;
}

.close {
  position: absolute;
  right: 12px;
  top: 10px;
  font-size: 20px;
  cursor: pointer;
}

.excel-enabled {
  min-height: 120px;
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
  overflow-x: auto;
  white-space: pre-wrap;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.rendered-table {
  border-collapse: collapse;
  /* removes double borders */
  table-layout: fixed;
  /* uniform column widths */
  width: 100%;
  /* optional: fill container */
}

.rendered-table td,
.rendered-table th {
  border: 1px solid #000;
  padding: 4px;
  vertical-align: top;
  /* aligns multi-line cells */
  text-align: left;
  overflow-wrap: break-word;
  /* wraps long text */
  min-width: 50px;
  /* optional: prevents very narrow columns */
}

/* New Additions for Ads */
.modal-content {
  width: 500px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-btn {
  padding: 6px 14px;
  background: #0077ff;
  border: none;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.filter-btn:hover {
  background: #005fd4;
}

#productFilter {
  width: 200px;
  padding: 4px;
}

.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center; /* vertical center alignment */
  flex-wrap: nowrap;   /* prevent wrapping to new line */
  gap: 20px;
  margin-bottom: 20px;
  width: 98%;
}

/* LEFT + RIGHT SPLIT */
.controls-left, .controls-right {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
  min-width: 0;
}

/* LEFT: status + product filters */
.controls-left {
  flex: 0 0 50%; /* fixed half of container */
}

/* RIGHT: date filters */
.controls-right {
  flex: 0 0 50%; /* fixed half of container */
  justify-content: flex-end; /* align to right */
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

#productFilterGroup {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#productFilterGroup label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
}

.filter-btn {
  padding: 6px 14px;
  background: #0077ff;
  border: none;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.filter-btn:hover {
  background: #005fd4;
}

.multi-select-dropdown {
  position: relative;
  width: 200px;
  min-width: 150px;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  background: white;
}

.multi-select-dropdown .selected {
  padding: 6px 10px;
}

.multi-select-dropdown .options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  border: 1px solid #ccc;
  border-top: none;
  background: white;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
}

.multi-select-dropdown .options label {
  display: block;
  padding: 4px 10px;
}

.multi-select-dropdown .options.hidden {
  display: none;
}

