/* General body and layout styling */
body {
  margin: 0;
  padding: 0;
  background: url('Background.png') no-repeat center center fixed;
  background-size: cover;
  font-family: 'Georgia', serif;
  color: #5a4e4b;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 100vh;
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

html {
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(250, 235, 215, 0.7);
  z-index: -1;
}

/* ?? Ensure Header is Fully Centered */
header {
  width: 100%;
  text-align: center;
  padding: 50px 20px;
  background: rgba(0, 0, 0, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* ?? Centering the Logo 
header img {
  display: block;
  margin: 0 auto;
  width: 25vw;
  max-width: 1000px;
}*/

/* ?? Centering Header Text */
header p {
  font-size: 22px;
  color: #B727C4;
  margin-top: 10px;
  text-align: center;
}



/* ?? Button Hover Effect */
.button-container a:hover {
  background-color: #68156F;
}

/* ?? Book List Section */
.review-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1200px;
  margin: 20px auto;
  padding: 20px;
}

/* ?? Review Card Styling */
.review-card {
  background-color: black;
  border-radius: 15px;
  width: 280px;
  margin: 15px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.55);
  border: 3px solid #000000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  height: auto; /* Allow dynamic height */
  min-height: 380px; /* Ensure uniform size */
  transition: transform 0.3s ease;
}

/* ?? Ensure Book Covers Stay Consistent */
.review-card img {
  width: 100%;
  height: 250px;
  object-fit: contain; /* Ensures full image visibility */
  background-color: black;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  display: block;
  margin: 10px auto 0;
}

/* ?? Ensure Title Text is Consistent & Wrapped */
.review-card h3 {
  color: #ffffff;
  font-size: 16px; /* Slightly reduced font size for better fit */
  text-align: center;
  background-color: black;
  padding: 10px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word;
  line-height: 1.3; /* Adjust spacing for readability */
  min-height: 50px;
  max-height: 70px;
}

/* ?? Centering Filter and Book List Headings */
.reviews h2 {
  text-align: center;
  font-size: 36px;
  color: #6e4446;
  margin-bottom: 30px;
  width: 100%;
}



.MessageText {
  font-size: 22px;
  color: #FFFFFF;
  margin: 10px auto 0 auto; /* Centers the element horizontally */
  background-color: rgba(0, 0, 0, 0.5);
  padding: 10px 15px;
  border-radius: 10px;
  display: table; /* table or block ensures proper auto margins */
  text-align: center;
}

/* ?? Centering and Styling Dropdowns */
#filter-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  max-width: 100%;
  overflow: hidden;

  /* NEW SPACING & HORIZONTAL LINE */
  margin-top: 5px;                 /* 5px gap above container */
  padding-bottom: 5px;             /* ensures the line is 5px below dropdowns */
  border-bottom: 2px solid #5a4e4b;/* horizontal line color/width */
  margin-bottom: 30px;             /* space below the line (use your original or adjust) */
}

/* ?? Dark Academia Dropdown Styling (Uniform Width) */
#filter-container select {
  padding: 10px;
  font-size: 18px;
  font-family: 'Georgia', serif;
  border-radius: 5px;
  border: 2px solid #3b2f2f; /* Dark muted brown */
  background-color: #2e1f1f; /* Deep dark red-brown */
  color: #f4f0e6; /* Warm parchment color */
  text-align: center;
  width: 240px; /* Ensures uniform dropdown width */
  transition: all 0.3s ease-in-out;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* ?? Dropdown Hover Effect */
#filter-container select:hover {
  background-color: #453534;
  border-color: #a67b5b;
  color: #f4e8d6;
}

/* ?? Dropdown Focus (When Clicked) */
#filter-container select:focus {
  outline: none;
  border-color: #c4a484;
  box-shadow: 0 0 8px rgba(196, 164, 132, 0.6);
}



.spice-legend {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px auto;
  
  /* Semi-transparent background & some padding */
  background-color: rgba(0, 0, 0, 0.5); 
  padding: 10px;
  border-radius: 8px; /* optional, for rounded corners */
}

.spice-legend strong {
  font-size: 18px;
  color: #fff; /* If you want the label text inside to be white for contrast */
}

.legend-box {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  font-weight: bold;
  color: #fff;
  margin: 0 8px;
  cursor: pointer;
}


/* Spice level colors (80% opacity) */

.level-0 {
  background-color: rgba(148,148,148,1.00);      /* green */
}

.level-1 {
  background-color: rgba(0, 128, 0, 0.8);      /* green */
}
.level-2 {
  background-color: rgba(144, 238, 144, 0.8);  /* light green */
}
.level-3 {
  background-color: rgba(255, 215, 0, 0.8);    /* gold */
}
.level-4 {
  background-color: rgba(255, 165, 0, 0.8);    /* orange */
}
.level-5 {
  background-color: rgba(255, 0, 0, 0.8);      /* red */
}
.level-99 {
  background-color: rgba(60, 12, 36, 0.8);      /* Purple */
}


/* ?? Ensure Buttons Stay Visible */
.review-card button {
  width: 100%;
  padding: 10px;
  background-color: rgb(5, 154, 144);
  border: none;
  color: white;
  font-size: 16px;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  cursor: pointer;
  text-align: center;
  margin-top: auto;
  min-height: 50px;
}

/* ?? Button Hover Effect */
.review-card button:hover {
  background-color: #68156F;
}

/* ?? Ensure Links Wrap Around Cards Correctly */
.review-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 15px;
}

.review-link:hover {
  transform: scale(1.2);
}


/* ๐น Search Bar Container */
.search-container {
    position: relative;
    text-align: center;
    margin: 20px auto;
    width: 100%;
    max-width: 400px;
}

/* ๐น Search Input */
#search-box {
    width: 100%;
    padding: 10px;
    font-size: 18px;
    font-family: 'Georgia', serif;
    border-radius: 5px;
    border: 2px solid #3b2f2f;
    background-color: #2e1f1f;
    color: #f4f0e6;
    text-align: center;
}

/* ๐น Search Results Dropdown */
#search-results {
    position: absolute;
    width: 100%;
    background-color: #2e1f1f;
    
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

/* ๐น Search Result Item */
.search-result {
    padding: 10px;
    color: #f4f0e6;
    font-size: 16px;
    font-family: 'Georgia', serif;
    border-bottom: 1px solid #3b2f2f;
    cursor: pointer;
}

.search-result:hover {
    background-color: #453534;
}
/* Existing tooltip styles (unchanged) */
.tooltip-container {
  position: relative;
  cursor: pointer;
}
.tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  left: 50%; 
  transform: translateX(-50%); 
  bottom: 110%; 
  background-color: rgba(0,0,0,0.85);
  color: #fff;
  text-align: left;
  border-radius: 6px;
  padding: 10px;
  width: 220px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  z-index: 999;
  transition: opacity 0.3s, visibility 0.3s;
  font-size: 14px;
  line-height: 1.4;
  white-space: normal;        /* allow wrapping */
  overflow-wrap: break-word;  /* break long words */
}
.tooltip-container:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}
.tooltip-header {
  text-align: center;
  background: #B727C4;
  padding: 5px;
  margin: -10px -10px 10px -10px;
  border-radius: 6px 6px 0 0;
  font-weight: bold;
}
.tooltip-body {
  font-size: 14px;
  line-height: 1.4;
}




/* Book tooltip container - specific styling for large summaries */
.tooltip-container-book {
  position: relative;
  cursor: pointer;
}

.tooltip-text-book {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  left: 50%; 
  bottom: 100%;
  transform: translateX(-50%);
  background-color: rgba(0,0,0,0.9);
  color: #fff;
  border-radius: 10px;
  padding: 15px;
  width: 600px;          /* Wider tooltip */
  max-width: 80vw;       /* Ensure it doesn't overflow on smaller screens */
  box-shadow: 0 8px 15px rgba(0,0,0,0.4);
  z-index: 1000;
  transition: opacity 0.3s, visibility 0.3s;
  font-size: 16px;
  line-height: 1.5;
  text-align: justify;
  white-space: normal;
  overflow-wrap: break-word;
}

.trope-icon {
  width: 128px;
  height: 128px;
  object-fit: contain;
  margin: 5px;
  border: 2px solid #059A90;
}

.tooltip-tropes {
  margin-top: 10px;
  text-align: center; 
  /* or left, if you prefer */
}


/*
.tooltip-container-book:hover .tooltip-text-book {
  visibility: visible;
  opacity: 1;
}

.tooltip-text-book .tooltip-header {
  text-align: center;
  background: #B727C4;
  padding: 6px;
  margin: -15px -15px 12px -15px;
  border-radius: 10px 10px 0 0;
  font-weight: bold;
  font-size: 18px;
}

.tooltip-text-book .tooltip-body {
  font-size: 15px;
  line-height: 1.5;
  padding: 5px;
}*/


.tooltip-text-book {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s;
}

.tooltip-text-book.visible {
  visibility: visible;
  opacity: 1;
}

/* Only apply hover on devices that have a real mouse pointer */
@media (hover: hover) and (pointer: fine) {
  .tooltip-container-book:hover .tooltip-text-book {
    visibility: visible;
    opacity: 1;
  }
}


/* Social share icons row (no text) */
.social-share {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  /* if you had margin-top: 15px, it's optional now, 
     since we rely on .purchase-spice > gap: 15px */
}

/* share-btn, social-icon remain the same */
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;  
  transition: transform 0.2s;
  margin: 0 3px;          
}

.share-btn:hover {
  transform: scale(1.05);
}

.social-icon {
  width: 40px;
  height: 40px;
  display: block;
}

/* put this anywhere after the existing .tooltip-text-book block */
.tooltip-text-book.below{
  top:100%;         /* anchor below the card  */
  bottom:auto;      /* disable the old bottom */
}

/* ?? Footer */
footer {
  padding: 30px;
  text-align: center;
  background-color: black;
  border-top: 2px solid white;
}

footer p {
  color: white;
}

footer a {
  color: white;
  text-decoration: none;
}

footer a:hover {
  color: #68156F;
}

@media (max-width: 600px) {
  .tooltip-text {
    left: 50%;
    transform: translateX(-50%);
    max-width: 80vw;        /* ensures it wont exceed 80% of viewport width */
    white-space: normal;    /* allow wrapping */
    word-wrap: break-word;  /* break long words if needed */
    bottom: 110%;           /* keep it above the box */
    right: auto;            /* override any previous 'right: 0;' */
  }
	 .tooltip-text-book {
    width: 90vw;         /* Slightly narrower on smaller screens */
    font-size: 14px;
  }
}


