/* =========================
   FONT IMPORTS
   ========================= */
@font-face {
  font-family: 'AlmendraSC';
  src: url('../fonts/AlmendraSC-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'AlmendraSC';
  src: url('../fonts/AlmendraSC-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
}
@font-face {
  font-family: 'AlmendraSC';
  src: url('../fonts/AlmendraSC-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'AlmendraSC';
  src: url('../fonts/AlmendraSC-BoldItalic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
}

@font-face {
  font-family: 'Bookmania';
  src: url('../fonts/Bookmania-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Bookmania';
  src: url('../fonts/Bookmania-RegularItalic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
}
@font-face {
  font-family: 'Bookmania';
  src: url('../fonts/Bookmania-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'Bookmania';
  src: url('../fonts/Bookmania-BoldItalic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
}

/* =========================
   GLOBAL STYLES
   ========================= */
body {
  background-image: url("https://i.imgur.com/8XflKRc.png");
  font-family: 'Bookmania', Georgia, serif;
  background-attachment: fixed;
  background-size: cover;
  color: #2c2c2c;
  line-height: 1.5;
}

/* Global button style */
button {
  background-color: #492468;
  color: #fff;
  border: none;
  border-radius: 9999px; /* pill shape */
  padding: 6px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button:hover {
  background-color: #6a359c; /* lighter purple on hover */
}

button:link {
  color: #fff;
}

    .nav-buttons {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1em;
      max-width: 2000px;
    }
	
	    .nav-buttons a {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      text-decoration: none;
      color: #fff;
      background-color: #492468;
      border: none;
      border-radius: 9999px;
      padding: 6px 14px;
      font-size: 14px;
      cursor: pointer;
      transition: background-color 0.2s ease;
    }

    .nav-buttons a:hover {
      background-color: #6a359c;
    }
	
    .nav-buttons img {
      width: 24px;
      height: 24px;
      vertical-align: middle;
    }

.nav-link:link,
.nav-link:visited {
  color: #fff;
}


.wrapper {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
.monsterwrapper {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0;
}
        .fixed-image {
            position: absolute;
            top: 20px; /* Adjust this to move image down or up */
            left: 0px; /* Adjust this to move image left or right */
            width: 200px; /* Adjust width for responsiveness */
            height: auto;
            z-index: 5; /* Ensure it stays on top */
        }

/* =========================
   STAT BLOCK
   ========================= */
.stat-block {
  padding-bottom: 1rem;
  padding-top: 0.25rem;
  padding-right: 1rem;
  padding-left: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* =========================
   HEADINGS
   ========================= */
h1 {
  font-family: 'AlmendraSC', Georgia, serif;
  font-weight: 700;
  color: #492468;
  margin: 0;
  font-size: 2rem;
}

h2 {
  font-family: 'Bookmania', Georgia, serif;
  font-weight: 700;
  color: #492468;
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
}

h3 {
  font-family: 'AlmendraSC', Georgia, serif;
  font-weight: 400;
  color: #492468;
  border-bottom: 3px solid #FFBF00; /* gold underline */
  margin-top: 1rem;
  font-size: 1.1rem;
}

h4 {
  font-family: 'Bookmania', Georgia, serif;
  color: #492468;
  margin-top: 0.5em;
  margin-bottom: 0.2em;
}

h5 {
  font-family: 'Bookmania', Georgia, serif;
  color: #492468;
  margin-top: 0.5em;
  margin-bottom: 0.2em;
  font-style: italic;
}

/* =========================
   DIVIDERS
   ========================= */
.orange-border {
  border-top: 3px solid #FFBF00; /* gold border */
  margin: 0.5rem 0;
}

/* =========================
   PROPERTY LINES
   ========================= */
.property-line {
  display: flex;
  justify-content: start;
  margin: 0.25rem 0;
}
.property-line h4 {
  margin: 0;
}
.property-line p {
  margin: 0;
}

/* =========================
   ABILITY SCORES
   ========================= */
.abilities {
  display: flex;
  justify-content: space-between;
  margin: 1rem 0;
}
.abilities div {
  text-align: center;
  flex: 1;
}
.abilities h4 {
  margin: 0;
}
.abilities p {
  margin: 0;
}

/* =========================
   TEXT & ACTIONS
   ========================= */
p {
  margin: 0.5rem 0;
}

strong em {
  font-weight: bold;
  font-style: italic;
}

/* =========================
   CREATURE TYPES HEADER
   ========================= */
#creature-types {
  font-family: 'Bookmania', Georgia, serif;
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: #492468;
}

/* =========================
   SEARCH BAR
   ========================= */
#search {
  display: block;
  margin: 0.5rem auto 1.5rem auto;
  padding: 0.5rem;
  font-size: 1rem;
  width: 60%;
  border: 2px solid #492468;
  border-radius: 5px;
  font-family: 'Bookmania', Georgia, serif;
}

/* =========================
   FILTER BUTTONS
   ========================= */
.filter-bar {
  margin: 0.5em 0 1em;
  text-align: center;
}

.filter-button {
  display: inline-block;
  margin: 0 0.4em 0.2em 0; /* horizontal and small vertical spacing */
  padding: 0.3em 0.6em;
  border-radius: 4px;
  cursor: pointer;
  background: #f4f4f4;
  transition: background 0.2s, color 0.2s;
  font-family: 'Bookmania', Georgia, serif;
  font-size: 0.95rem;
}

.filter-button:last-child::after {
  content: "";
}

.filter-button:hover {
  background: #ddd;
}

.filter-button.active {
  background: #492468;
  color: #fff;
  font-weight: bold;
}

/* =========================
   MONSTER LIST
   ========================= */
#monster-list {
  text-align: start;
  margin-left: 10%;
}
#monster-list h3 {
  margin-top: 1rem;
  font-size: 1.6rem;
  font-family: 'AlmendraSC', Georgia, serif;
  color: #492468;
  border-bottom: 2px solid #FFBF00;
  display: inline-block;
  padding-bottom: 0.2rem;
}
.monster-link {
  margin: 0.3rem 0;
  display: block;
  
}
.monster-link a {
  font-family: 'Bookmania', Georgia, serif;
  font-size: 1.3rem;
  margin-left: 8%;
  text-decoration: none;
  color: #492468;
  transition: color 0.2s;
}
.monster-link a:hover {
  color: #FFBF00;
}
.filter-button {
  cursor: pointer;
  padding: 2px 6px;
  margin: 2px;
  border: 1px solid #888;
  border-radius: 4px;
  display: inline-block;
}
.filter-button.active {
  background: #444;
  color: #fff;
}
/* Make checkbox groups flow horizontally */
.filter-group label {
  display: inline-flex;       /* inline with the next item */
  align-items: center;        /* vertically align checkbox and text */
  margin-right: 1rem;         /* space between items */
  font-family: 'Bookmania', Georgia, serif;
  font-size: 0.95rem;
  color: #492468;
}

.filter-group input[type="checkbox"] {
  margin-right: 0.25rem;      /* small gap between checkbox and text */
}
.filter-group {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
#go-back-btn {
  display: block;
  width: fit-content;   
  margin: 10px auto;   
  padding: 6px 14px;  
  font-size: 14px;
  cursor: pointer;
  background-color: #dbdbdb;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-align: center; 
}

#go-back-btn:hover {
  background-color: #e0e0e0;
}

/* =========================
   CREATURE TABLE
   ========================= */
.creature-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
}

.creature-table th, .creature-table td {
  border: 1px solid #888;
  padding: 0.3rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.creature-table th:nth-child(1),
.creature-table td:nth-child(1) { width: 40%; }
.creature-table th:nth-child(2),
.creature-table td:nth-child(2) { width: 20%; }
.creature-table th:nth-child(3),
.creature-table td:nth-child(3) { width: 15%; }
.creature-table th:nth-child(4),
.creature-table td:nth-child(4) { width: 25%; }

.creature-table th { background-color: #222; color: #fff; }
.creature-table tbody tr { height: 2rem; }
.creature-table tbody tr:hover { background-color: #FFBF00; cursor: pointer; }
.creature-table td.creature-name { font-weight: bold; text-align: left; padding-left: 0.5rem; }

/* =========================
   RESIZER
   ========================= */
.resizer {
  width: 15px;
  background: #FFBF00;
  cursor: col-resize;
  height: 100%;
  flex: 0 0 15px;
}

.initiative-table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  border-radius: 12px;   
}

.initiative-table th,
.initiative-table td {
  border: 1px solid #888;
  padding: 0.3rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.initiative-table tbody tr:hover {
  background-color: #FFBF00;
  cursor: pointer;
}
#right-panel {
  flex: 1;   
  min-width: 250px;
  max-width: 800px;
  overflow-y: auto;
  box-sizing: border-box;

}
/* =========================
   FIXED PANELS
   ========================= */
#left-panel {
  flex: 0 0 300px;   /* fixed starting width */
  min-width: 200px;  /* prevent collapsing */
  max-width: 600px;
  overflow-y: auto;
  box-sizing: border-box;
}

#middle-panel {
  flex: 0 0 600px;   /* fixed starting width */
  min-width: 400px;
  max-width: 1000px;
  overflow-y: auto;
  box-sizing: border-box;
}

/* Prevent content (tables etc.) from forcing panels to grow */
.panel {
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
}

/* Make rows display horizontally */
.row {
  display: flex;
  gap: 10px; /* space between each ability */
  flex-wrap: wrap; /* optional: allows wrapping on small screens */
}

/* Keep labels compact instead of full width */
.row label {
  display: flex;
  flex-direction: column; /* keeps STR above the input */
  align-items: center;
  width: auto; /* prevents stretching */
}
/* ability inputs remain small and horizontal */
.abilities-row input { 
  width: 60px; 
  text-align: center; 
}

/* All form inputs and textareas inside #monster-form */
#monster-form input,
#monster-form textarea {
  width: 100%;            /* full width */
  max-width: 500px;       /* optional max width */
  padding: 8px 12px;      /* internal spacing */
  margin: 4px 0 12px 0;   /* spacing between fields */
  font-size: 14px;        /* readable text */
  border: 2px solid #ccc; /* subtle border */
  border-radius: 12px;    /* rounded corners */
  outline: none;          /* remove default outline */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Focus effect */
#monster-form input:focus,
#monster-form textarea:focus {
  border-color: #492468;          /* purple border on focus */
  box-shadow: 0 0 6px rgba(73, 36, 104, 0.4); /* subtle glow */
}

/* Placeholder style */
#monster-form input::placeholder,
#monster-form textarea::placeholder {
  color: #aaa;
  font-style: italic;
}

#monster-form input.style-input,
#tracker-body input.style-input,
.initiative-table input.style-input {
  border: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: #f2f2f2;
  padding: 4px;
  border-radius: 5px;
  outline: none;
  box-sizing: border-box;
}

/* Force all tracker/table inputs to same size and shrink properly */
.style-input {
  width: 100%;           /* fill the cell */
  min-width: 0;          /* allow shrinking */
  box-sizing: border-box;
  padding: 2px 4px;
  font-size: 14px;
  text-align: center;    /* numbers centered */
}

#monster-form input.style-input:focus,
#tracker-body input.style-input:focus {
  border-color: rgba(73,36,104,0.6);
  box-shadow: 0 0 6px rgba(73,36,104,0.25);
}
/* Make all table inputs fill their cell and scale with it */
.initiative-table td .style-input {
  width: 100%;         /* fill the cell */
  box-sizing: border-box;
  text-align: center;   /* default center */
  padding: 4px;
  min-width: 20px;      /* prevents shrinking too far */
}
.initiative-table td:nth-child(1) .style-input,
.initiative-table td:nth-child(5) .style-input {
  text-align: left; /* Name and Notes aligned left */
}
.initiative-table td:nth-child(2) .style-input,
.initiative-table td:nth-child(3) .style-input,
.initiative-table td:nth-child(4) .style-input {
  width: 100%;          /* still fills cell but cell can shrink */
  max-width: 60px;      /* optional max width for small numbers */
  text-align: center;
}
.initiative-table td:nth-child(5) .style-input {
  min-width: 10px;
}
.initiative-table th:nth-child(n),
.initiative-table td:nth-child(n) {
  width: auto;
}