/* General Body and Link Styles */
body {
  background-color: rgba(40, 40, 40, 0.9);
  color: white;
  margin-left: 200px;
  margin-right: 200px;
  padding-left: 20px;
  padding-right: 20px;
  text-align: justify;
  text-justify: inter-word;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  font-family: Roboto, tahoma, verdana, arial, sans-serif;
  padding: 10px;
}

.content-body-wrapper {
  /* --- MODIFICATION FOR FIXED WIDTH --- */
  width: 90%; /* Example fixed width. Adjust this to your desired content width. */
                 /* This was previously width: 100%; */
 margin: 0 auto;

  /* Optional: if you want it to not shrink below this, but still be able to be wider
     if content pushes it (though with a fixed width this is less common)
  min-width: 1200px;
  width: auto; /* or a percentage if you want it to try and fill up to a max-width */

  background-color: #f0f0f0;
  padding: 15px;
  box-sizing: border-box;

  /* If the content-body-wrapper itself should get scrollbars when the viewport
     (within the body's margins) is narrower than 1200px: */
  overflow-x: auto; /* This will make this specific div scrollable if its content overflows */
                    /* Or, if you want the browser's main scrollbar (for the body/html)
                       to handle it, you might not need this here, depending on parent overflow settings. */
}
header table {
  font-size: medium;
  width: 100%; /* Table will be 100% of the fixed-width .content-body-wrapper */
}

a {
  color: black;
}

a:visited {
  color: gray;
}

a:hover,
a:active {
  color: black;
}

b { /* Used for "Remaining:" points text */
  color: red;
}

h1 {
  text-align: center;
}

table,
tr,
th,
td,
caption {
    border: 1px solid black;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    font-size: medium;
    border-collapse: collapse;
    padding: 0.5rem;
    text-align: center;
}

.container {
  max-width: 1100px;
  margin: 2rem auto;
  text-align: center;
  background-color: #333;
  padding: 15px;
  border-radius: 8px;
}

label, select, input[type="number"], button {
  font-size: 1rem;
  margin: 0.5rem;
  color: #ccc;
}
input[type="number"], select, button {
  background-color: #444;
  color: white;
  border: 1px solid #555;
  padding: 5px;
  border-radius: 3px;
}
button {
  cursor: pointer;
}
button:hover {
  background-color: #555;
}

/* Unlock Nodes Area */
.unlock-nodes {
  margin: 1rem 0;
  padding: 10px;
  background-color: #2a2a2a;
  border-radius: 5px;
}

.unlock-nodes .talent-node {
  display: inline-block;
  margin: 0.3rem;
  padding: 0.5rem 1rem;
  border: 1px solid #555;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  background: #eee;
  color: black;
}
.unlock-nodes .talent-node:hover {
  background: #ddd;
}


/* Tab Navigation Styling */
.tab-navigation {
  margin-bottom: 10px;
  border-bottom: 1px solid #555;
  padding-bottom: 5px;
  text-align: left;
}

.tab-button {
  padding: 8px 15px;
  cursor: pointer;
  border: 1px solid #555;
  border-bottom: none;
  background-color: #4a4a4a;
  color: #ccc;
  margin-right: 2px;
  border-radius: 5px 5px 0 0;
  font-weight: bold;
}

.tab-button.active {
  background-color: #383838;
  color: white;
  border-bottom: 1px solid #383838; /* Match container background for seamless look */
  position: relative;
  top: 1px;
}

.tab-content { /* This is the table itself now */
  padding: 0; /* Tables will have their own padding/borders */
}

/* Class Content Container - For background images and general layout */
.class-content-container {
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #555;
    border-radius: 5px;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    color: #333; /* Default text for content, but headers will override */
}
.class-content-container.hidden {
    display: none !important;
}


/* Talent Table Styling (for core, subclass, and spell tables) */
.talent-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    background-color: transparent; /* Make table background transparent */
    border-radius: 0 0 4px 4px;
}

.talent-table th, .talent-table td {
    border: 1px solid rgba(187, 187, 187, 0.5); /* Lighter, semi-transparent border for table cells */
    padding: 8px;
    text-align: left;
    vertical-align: top;
    /* color is set by the span or default */
}

/* Level X header */
.talent-table tbody[data-level] > tr:first-child th {
  background-color: transparent; /* Transparent background */
  text-align: center;
  font-style: italic;
  color: white; /* Default color if span fails */
  padding: 6px; /* Adjust padding for the th itself */
}
.talent-table tbody[data-level] > tr:first-child th > span.level-text-bg {
  display: inline-block;
  background-color: rgba(20, 20, 20, 0.7); /* Opaque dark background for level text */
  color: #e0e0e0; /* Light text on dark bg */
  padding: 3px 8px;
  border-radius: 3px;
  font-style: normal; /* Override italic if only span should be normal */
}



/* Content Cells (for talents and spells) */
.talent-table td.talent-content-cell,
.talent-table td.spell-content-cell {
    min-height: 60px;
    background-color: rgba(255, 255, 255, 0.05); /* Very subtle, mostly transparent background for the cell area */
                                              /* This helps define the cell if it's empty, but nodes will cover it */
}

/* Talent and Spell Node Styling */
.talent-node, .spell-node {
    display: inline-block; 
    margin: 5px; 
    padding: 6px 10px; 
    border: 1px solid #777; /* Slightly darker border for nodes to stand out on transparent bg */
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    background: rgba(240, 240, 240, 0.9); /* Light, slightly transparent background for nodes */
    color: #222; /* Dark text for nodes */
    position: relative; 
    font-size: 0.9em;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2); /* Add subtle shadow to nodes */
}
.talent-node:hover, .spell-node:hover {
    border-color: #555;
    background-color: rgba(255, 255, 255, 0.95);
}

.talent-node.hidden, .spell-node.hidden {
  display: none !important;
}

.talent-node.locked, .spell-node.locked { 
  opacity: 0.6; /* Slightly more opaque locked nodes for visibility */
  pointer-events: none;
  background-color: rgba(200, 200, 200, 0.8); /* Darker locked background */
}

.talent-node .rank, .spell-node .rank {
  font-weight: bold;
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8em;
  text-align: right;
}

/* Popover Styling */
.popover {
  position: absolute;
  z-index: 2000;
  display: none;
  max-width: 320px; 
  padding: 10px; 
  border: 1px solid #222; 
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  background: rgba(30, 30, 30, 0.95); 
  color: #e0e0e0; 
  text-align: left; 
  font-size: 0.9em; 
}
.popover strong {
    color: #ffc107; 
}
.popover p {
    margin: 5px 0;
}
.popover em { 
    color: #aaa;
    font-style: normal;
}
.popover ul {
    padding-left: 20px;
    margin: 5px 0;
}
.popover table {
    width: 100%;
    font-size: 0.9em;
    margin-top: 5px;
    background-color: rgba(255,255,255,0.05);
}
.popover table th, .popover table td {
    border: 1px solid #444;
    padding: 3px;
    color: #ccc;
}
.popover table th {
    background-color: rgba(255,255,255,0.1);
}


/* Spell Management Area */
.spell-management-area table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background-color: #3a3a3a; 
  border-radius: 4px;
}

.spell-management-area td {
  vertical-align: top;
  padding: 10px;
  border: 1px solid #555;
}

.search-controls-cell {
  width: 40%;
  position: relative;
}

.added-spells-cell {
  width: 60%;
}

#added-spells-container {
    min-height: 100px;
    border: 1px dashed #666; 
    padding: 5px;
    background-color: #2f2f2f; 
}

#added-spells-container .spell-node {
    margin: 5px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    display: inline-block;
    position: relative;
    border-color: #00ff00; 
}

/* talent-tree.css additions for drag & drop visual feedback */

.spell-content-cell.drag-over-valid,
#added-spells-container.drag-over-valid {
    background-color: rgba(76, 175, 80, 0.3) !important; /* Light green with opacity */
    border: 2px dashed #4CAF50 !important; /* Dashed green border */
    box-shadow: inset 0 0 10px rgba(76, 175, 80, 0.5); /* Inner glow */
}

.spell-content-cell.drag-over-invalid {
    background-color: rgba(244, 67, 54, 0.3) !important; /* Light red with opacity */
    border: 2px dashed #f44336 !important; /* Dashed red border */
    box-shadow: inset 0 0 10px rgba(244, 67, 54, 0.5); /* Inner glow */
}

/* General styling for cells designated as drop zones to indicate they can receive items */
.spell-content-cell {
    /* You might want a subtle default state to indicate it's a potential drop zone */
    /* For example, a slightly different background or a very subtle border pattern when empty */
    min-height: 60px; /* Ensure it has some height even when empty */
    /* transition: background-color 0.2s ease-in-out, border 0.2s ease-in-out; */ /* Smooth transitions */
}

.autocomplete-suggestions {
  border: 1px solid #777; 
  background: #444; 
  color: #ddd; 
  overflow: auto;
  max-height: 150px;
  position: absolute;
  z-index: 1000;
  width: calc(100% - 22px);
  box-sizing: border-box;
  display: none;
}

.autocomplete-suggestion-item {
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.autocomplete-suggestion-item:hover {
  background: #555; 
}

.delete-spell-node {
  position: absolute;
  top: -7px; 
  right: -7px;
  background: red;
  color: white;
  border-radius: 50%;
  width: 18px; 
  height: 18px;
  text-align: center;
  line-height: 16px; 
  font-size: 13px;
  cursor: pointer;
  font-weight: bold;
  padding: 1px;
  z-index: 10;
  border: 1px solid darkred;
}


/* Background Images for Class Containers */
#class-container-Druid {
  background-image: url('../img/Forest%20Backdrop.jpg');
}
#class-container-Mage {
  background-image: url('../img/Islands%20Backdrop.jpg');
}
#class-container-Priest {
  background-image: url('../img/Cathedral%20Backdrop.jpg');
}
#class-container-Ranger {
  background-image: url('../img/Cabin%20Backdrop.jpg');
}
#class-container-Rogue {
  background-image: url('../img/Alleyway%20Night%20Backdrop.jpg');
}
#class-container-Warlock {
  background-image: url('../img/Swamp%20Backdrop.jpg');
}
#class-container-Warrior {
  background-image: url('../img/Colosseum%20Backdrop.jpg');
}

/* Clearfix */
.clearfix {clear:both;}
.clearfix:after {
  content: ".";
  display: block;
  clear: both;
  visibility: hidden;
  line-height: 0;
  height: 0;
}
html[xmlns] .clearfix {
  display: block;
}
* html .clearfix {
  height: 1%;
}

/* Card styles from original - these might need review/consolidation with spell-popup.css */
.card { 
  width: 350px; 
  float: left; 
  margin-right: 20px;
  border: 1px solid #000000;
  font-size: 11px;
  margin-top: 10px;
  margin-bottom: 10px;
  color: #333333;
  position: relative;
  background-color: #ffffff;
}
.card a {
  color: #333333;
  text-decoration: none;
}
.card img.star {
    display: block;
    position: relative;
    top: 0px;
    left: 0px;
    width: 20px;
    height: 19px
}
.card.card-backs {
  border-color: #ffffff;
  float: right;
}
.card.card-backs section, .card.card-backs header {
  visibility: hidden;
}

.modify-stat-button { 
  margin-right: 3px;
  padding: 0 4px;
  font-size: 8px;
  line-height: 1;
  border: 1px solid #666;
  background: #eee;
  cursor: pointer;
}

   /* Tab navigation styling */
   .tab-navigation {
    margin-bottom: 10px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
  }
  .tab-button {
    padding: 8px 15px;
    cursor: pointer;
    border: 1px solid #ccc;
    border-bottom: none;
    background-color: #f1f1f1;
    margin-right: 2px;
    border-radius: 5px 5px 0 0;
    font-weight: bold;
  }
  .tab-button.active {
    background-color: rgba(30, 30, 30, 0.85);
    position: relative;
    top: 1px;
  }
  .tab-content {
    /* border: 1px solid #ccc; */ /* Border now on table itself */
    padding: 0; /* Tables will have their own padding/borders */
  }
  .talent-table { /* Applied to core, subclass, and spell tables */
      width: 100%;
      border-collapse: collapse;
      margin-bottom: 20px; /* Space between class sections if multiple are shown */
  }
  .talent-table th, .talent-table td {
      border: 1px solid #ddd;
      padding: 8px;
      text-align: left;
      vertical-align: top;
  }
  .talent-table thead th {
    background-color: transparent !important; /* Ensure transparency, overriding other rules if necessary */
    text-align: center;
    color: white; /* Fallback color, actual text color will be on the span */
    padding: 8px; /* Original padding, adjust if needed */
  }
  
  .talent-table thead th > span.heading-text-bg {
    display: inline-block; /* Allows padding and background */
    background-color: rgba(30, 30, 30, 0.85); /* Dark, semi-opaque background for readability */
    color: #f0f0f0; /* Light text color */
    padding: 5px 10px; /* Padding around the text */
    border-radius: 4px; /* Rounded corners for the background block */
    font-weight: bold; /* As it's a header */
  }
  
  
  .talent-table td.talent-content-cell,
  .talent-table td.spell-content-cell {
      min-height: 60px;
      background-color: rgba(255, 255, 255, 0.05); /* Very subtle, mostly transparent background */
  }

  .talent-node, .spell-node {
      margin-bottom: 5px;
      padding: 5px;
      border: 1px solid #eee;
      background-color: #fff;
      border-radius: 3px;
  }
  .hidden {
    display: none !important; /* Ensure hidden class works */
  }
  .class-content-container {
      margin-bottom: 20px;
      padding: 10px;
      border: 1px solid #ccc;
      border-radius: 5px;
  }

  /* For the Hide/Show button - you can style it further if needed */
.toggle-table-visibility-button {
  /* Example: Give it a slightly different look or spacing */
  margin-left: 8px; /* Adds some space from the content tabs */
  /* background-color: #5a5a5a; */ /* Optional: different background */
}

/* This class will hide the tbody elements of a table */
.talent-table.table-body-collapsed > tbody {
  display: none;
}

.level-meta-node {
  display: inline-block; /* Allows it to flow with other nodes */
  background-color: rgba(30, 30, 30, 0.85); 
  color: #e0e0e0; 
  padding: 4px 10px; /* Adjusted padding for a slightly larger feel */
  border-radius: 3px; 
  font-style: normal; /* Or 'italic' if you preferred that from the old headers */
  font-weight: bold;   /* Make it stand out a bit */
  margin-right: 10px;  /* Space between it and the actual talent/spell nodes */
  margin-bottom: 5px;  /* Space if nodes wrap to the next line */
  vertical-align: top; /* Align with the top of other nodes in the cell */
  border: 1px solid rgba(200, 200, 200, 0.5); /* Subtle border similar to nodes */
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.subclass-choice-node {
  border-color: #ffd700; /* Example: Gold border */
  background-color: rgba(255, 245, 200, 0.9); /* Lighter, distinct background */
  /* Add any other specific styles */
}

.subclass-choice-node:hover {
  background-color: rgba(255, 250, 220, 0.95);
}

/* New styles for specialization-choice-node */
.specialization-choice-node {
  border-color: #ffd700; /* Gold border - same as subclass choice */
  background-color: rgba(255, 245, 200, 0.9); /* Lighter, distinct background - same as subclass choice */
  /* Add any other specific styles if needed */
}

.specialization-choice-node:hover {
  background-color: rgba(255, 250, 220, 0.95); /* Same hover as subclass choice */
}