body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background-color: #f5f5f5;
  min-width: 1300px;
}

.navigation {
    margin-bottom: 15px;
}
.index-container > .navigation {
    margin-bottom: 40px;
}


a:visited { color: rgb(16, 67, 84); }
a:link    { color: rgb(25, 123, 155); }
a:hover   { color: rgb(25, 123, 155); background-color: rgb(232, 237, 238); }
a:active  { color: rgb(16, 67, 84); background-color: rgb(232, 237, 238); }

.card-container {
  position: relative;
  display: inline-block;
  margin: 5px;
  transition: transform 0.2s;
}

.card-container:hover {
  transform: scale(1.05);
  z-index: 10;
}

.card-remove-btn, .remove-card-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  background-color: #bd0310b2;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  font-weight: bold;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 20;
}

.card-container:hover .card-remove-btn,
.card-container:hover .remove-card-btn {
  opacity: 1;
}

.card-remove-btn:hover,
.remove-card-btn:hover {
  background-color: #bd0310e6;
}

.card-img {
  width: 340px;
  border-radius: 14px;
  padding: 4px;
}

.card-img:hover {
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.picked-card {
  border: 4px solid #217516;
  padding: 0;
  box-shadow: 0 0 15px #4CAF5099;
}

.card-weight {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 14px;
}

.meta-info {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  justify-content: space-between;
  gap: 15px;
}

.meta-header-row {
  display: flex;
  align-items: center;
  background-color: #fff;
  border-radius: 5px;
  border: 1px solid #ccc;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.meta-info h3 {
  margin: 0px 20px 0px 0px;
  color: #333;
}

.meta-info p {
  margin-bottom: 0;
  font-family: monospace;
  font-size: 14px;
  line-height: 1.4;
  color: #555;
  word-break: break-word;
}

.meta-table {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-value {
  display: inline-block;
  margin-right: 12px;
  position: relative;
}

.meta-space {
  flex-grow: 1;
}

.header-select {
  width: auto;
  padding: 6px 30px 6px 10px;
  border: none;
  border-radius: 4px;
  background-color: #f5f5f5;
  font-family: monospace;
  font-size: 14px;
  color: transparent;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
}

.header-select:hover {
  background-color: #efefef;
}

.header-select:open {
  outline: none;
  background-color: #fff;
}
.header-select:focus {
  box-shadow: 0 0 5px rgba(79, 144, 206, 0.5);
}

.select-display-wrapper {
  position: absolute;
  inset: 0px;
  pointer-events: none;
  display: flex;
  align-items: center;
  padding-left: 10px;
  z-index: 1;
}
.select-display-text {
  font-family: monospace;
  font-size: 14px;
  color: #555;
  background-color: transparent;
}

/* Style for dropdown options */
.header-select option {
  padding: 6px;
  color: #555;
  background-color: #fff;
}

/* Make sure select has a proper arrow */
.header-select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
}

.pick-container {
  display: flex;
  flex-direction: column;
  margin-bottom: 30px;
}

.pack-tabs-container {
  display: flex;
}

.pack-tab {
  padding: 12px 24px;
  background-color: #e9e9e9;
  border: 1px solid #ccc;
  border-radius: 5px 5px 0 0;
  margin-right: 5px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1em;
  border-bottom-style: none;
}

.pack-tab.active {
  background-color: #fff;
}

.pack-content {
  display: none;
  flex-direction: column;
  background-color: #fff;
  border-radius: 0 5px 5px 5px;
  border: 1px solid #ccc;
  padding: 15px;
  margin-bottom: 20px;
}

.pack-content.active {
  display: flex;
}

.pick-tabs-container {
  display: flex;
  border-bottom: 1px solid #ddd;
}

.pick-tab {
  padding: 8px 16px;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 5px 5px 0 0;
  margin-right: 5px;
  cursor: pointer;
  font-weight: bold;
  border-bottom-style: none;
}

.pick-tab.active {
  background-color: #fff;
}

.pick-content {
  display: flex;
  background-color: #fff;
  padding: 20px;
  border-radius: 0 5px 5px 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.pack-section {
  flex: 3;
  margin-right: 20px;
}

.title-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.title-container h3 {
  margin: 0;
}

.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: solid 2px #666;
  color: #666;
  font-size: 16px;
  font-weight: bold;
  cursor: help;
  user-select: none;
  transition: background-color 0.2s;
}

.help-icon:hover {
  background-color: #ccc;
}

.info-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 280px;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.picked {
  margin-top: 20px;
  border-top: 1px solid #ddd;
  padding-top: 10px;
}

.picked h3 {
  margin-top: 0;
  color: #555;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}

.table th, .table td {
  padding: 6px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.table th {
  background-color: #f2f2f2;
  font-weight: bold;
}

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

.table td:first-child {
  font-weight: bold;
  width: 50px;
}

.table td:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.card-name {
  cursor: pointer;
  text-decoration: underline dotted;
  color: rgb(25, 123, 155);
}

.card-name:hover {
  color: rgb(25, 123, 155);
  background-color: rgb(232, 237, 238);
}

.card-preview {
  position: fixed;
  display: none;
  z-index: 1000;
  max-width: 340px;
  filter: drop-shadow(0 0 10px rgba(0,0,0,0.5));
  pointer-events: none;
}

.card-preview img {
  width: 100%;
  border-radius: 10px;
}

.add-card-container {
  position: relative;
  display: inline-block;
  margin: 5px;
  transition: transform 0.2s;
  cursor: pointer;
}

.add-card-container:hover {
  transform: scale(1.05);
  z-index: 10;
}

.add-card-box {
  width: 340px;
  height: 460px;
  border-radius: 14px;
  border: 2px dashed #aaa;
  background-color: #f8f8f8;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #777;
}

.add-card-box:hover {
  background-color: #e8e8e8;
  border-color: #888;
  color: #555;
}

.add-card-box .plus-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.add-card-box .add-text {
  font-size: 16px;
}

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

.card-add-modal.active {
  display: flex;
}

.modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h2 {
  margin-top: 0;
  margin-bottom: 20px;
}

.modal-content .card-input-area {
  width: calc(100% - 22px);
  min-height: 150px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 20px;
  font-family: monospace;
  font-size: 1.2em;
  resize: vertical;
}

.modal-content .buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-content button {
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  border: none;
}

.modal-content button.cancel {
  background-color: #e0e0e0;
}

.modal-content button.submit {
  background-color: #e9f1e8;
  color: #217516;
}

.modal-content button:hover {
  opacity: 0.9;
}

.pick-content {
  display: none;
}

.pick-content.active {
  display: flex;
}

.store-weights-section {
  display: flex;
  gap: 10px;
}

.meta-header-row .store-weights-section {
  margin: 0;
  padding: 0;
  border: none;
}

.store-weights-btn {
  padding: 10px 20px;
  background-color: #197b9b;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}

.store-weights-btn:hover {
  background-color: #197b9b;
}

.clear-weights-btn {
  padding: 10px 20px;
  background-color: #7f0a13;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}

.clear-weights-btn:hover {
  background-color: #7f0a13;
}

/* Index page styles */
.index-container {
  max-width: 800px;
  margin: 0 auto;
}

.index-container h1 {
  text-align: center;
  color: #333;
  margin-bottom: 40px;
  font-size: 2.5em;
}

.index-section {
  background-color: #fff;
  border-radius: 8px;
  border: 1px solid #ccc;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.index-section h2 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #333;
  font-size: 1.8em;
}

.create-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: bold;
  color: #555;
  font-size: 1.1em;
}

.form-group select,
.form-group input {
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1em;
  background-color: #fff;
}

.form-group select:focus,
.form-group input:focus {
  outline: none;
  border-color: #197b9b;
  box-shadow: 0 0 5px rgba(25, 123, 155, 0.3);
}

.create-form button {
  padding: 15px 30px;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.2em;
  font-weight: bold;
  margin-top: 10px;
  transition: background-color 0.2s;
}

.create-form button:disabled {
  background-color: #aaa;
  cursor: not-allowed;
}

.create-btn { background-color: #217516; }
.create-btn:hover { background-color: #1a5e11; }
.load-random-btn { background-color: #197b9b; }
.load-random-btn:hover { background-color: #156682; }
.import-btn { background-color: #d27c11; }
.import-btn:hover { background-color: #b06910; }

.index-section p {
  margin-bottom: 20px;
  color: #666;
  font-size: 1.1em;
  line-height: 1.5;
}

#notice {
  color: #888;
}
