/* General body styling */
body {
  margin: 0;
  padding: 0;
  background: url('./dark-wood.png');
  background-color: #402203;
  font-family: 'Georgia', serif;
  overflow-x: hidden;
}

/* Quest board layout */
#quest-board {
  max-width: 100vw;
  padding: 20px;
  text-align: center;
}

h1 {
  font-size: 3em;
  margin-bottom: 20px;
  color: #6e4b1c;
  text-shadow: 1px 1px 1px #fff2c2;
}

/* Grid layout for quests */
#quests-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding: 10px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Quest card styling */
.quest {
  background: url('./natural-paper.png');
  background-color: #efdfbb;
  border: 2px solid #8b5e3c;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
  text-align: left;
  transition: transform 0.2s ease;
}

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

.quest.completed {
  opacity: 0.6;
  text-decoration: line-through;
}

/* Top-level quest detail element */
.quest-detail {
  overflow: hidden; /* Allows JS to animate height */
  border: none;
  padding: 0;
}

/* Summary title */
.quest-title {
  font-size: 1.5em;
  color: #4a2e0d;
  font-family: 'Ink Free';
  font-weight: bold;
  cursor: pointer;
}

/* Inner content block */
.quest-content {
  padding: 10px 0;
}

/* Issuer / reward / status rows */
.quest .issuer,
.quest .reward,
.quest .status {
  margin: 5px 0;
  font-size: 1em;
  font-weight: bold;
}

/* Nested detail (e.g. Description) */
.quest .description summary {
  cursor: pointer;
  font-weight: bold;
}

.quest .description p {
  margin: 5px 0 0;
  padding-left: 10px;
  font-size: 0.95em;
  color: #2c1c0c;
}

.quest .description {
  overflow: hidden;
  margin-top: 5px;
}

#import-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px 30px;
  max-width: 700px;
  margin: 0 auto 20px;
  align-items: center;
  justify-items: center;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}


.input-group label {
  white-space: nowrap;
  font-weight: bold;
  color: #fff2c2;
  font-size: 1.1em;
}

#json-upload {
  border: 1px solid #8b5e3c;
  padding: 5px;
  font-size: 1em;
  color: #fff2c2;
  border-radius: 10px;
}

.input-group input {
  flex: 1;
  min-width: 0; /* Allows shrinking */
  box-sizing: border-box;
  width:fit-content;
}

/* --- Base Styling (Works for all browsers) --- */
#party-level {
  padding: 6px 12px;
  font-size: 1em;
  color: #fff2c2;
  /* Semi-transparent wood tint to blend with background */
  background-color: rgba(139, 94, 60, 0.2); 
  border: 1px solid #8b5e3c;
  border-radius: 8px;
  font-family: 'Georgia', serif;
  cursor: pointer;
  
  /* Remove default browser arrow */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  
  /* Custom SVG Arrow (White/Gold) */
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff2c2'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  
  padding-right: 30px;
  transition: all 0.2s ease;
}

/* Hover and Focus states */
#party-level:hover {
  background-color: rgba(139, 94, 60, 0.4);
  border-color: #fff2c2;
}

#party-level:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 242, 194, 0.3);
  border-color: #fff2c2;
}

#party-level option {
  background-color: #402203;
  color: #fff2c2;
  font-family: 'Georgia', serif;
  padding: 8px;
}

.browse-button {
  padding: 6px 12px;
  border: 1px solid #8b5e3c;
  border-radius: 8px;
  color: #fff2c2;
  background: transparent;
  cursor: pointer;
  font-size: 1em;
  transition: background 0.2s ease;
}

.browse-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.tooltip-wrapper {
  position: relative;
  display: inline-block;
}

.tooltip-icon {
  display: inline-block;
  margin-left: 8px;
  background-color: #8b5e3c;
  color: #fff2c2;
  font-weight: bold;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  text-align: center;
  line-height: 20px;
  cursor: pointer;
  font-size: 0.9em;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
}

.tooltip-text {
  visibility: hidden;
  width: 280px;
  background-color: #333;
  color: #fff2c2;
  text-align: left;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  font-size: 0.9em;
  box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.4);
}

.tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.tooltip-wrapper:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}
