.tiles-container {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box;
}

.container {
  width: 100% !important;
  max-width: none !important;
  padding: 0 30px !important;
  box-sizing: border-box;
}

/* Base filter button */
.filter-btn {
  padding: 10px 16px;          
  border-radius: 999px;        
  background-color: white;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  display: inline-flex;
  align-items: center;         
  justify-content: center;     
  gap: 6px;
  border: 2px solid #0F4D0F;   
  color: #0F4D0F;
  line-height: normal;         
  vertical-align: middle;
  box-sizing: border-box;
}

/* Emoji inside buttons */
.filter-btn .emoji {
  display: inline-flex;
  align-items: center;
  font-size: 1.2em;
  line-height: 1;
  color: inherit;
}

/* Individual rating colors */
.filter-btn[data-filter="all"] {
  --btn-color: #89CFF0;
  border-color: #89CFF0;
  color: #89CFF0;
}
.filter-btn[data-filter="unsure"] {
  --btn-color: #d9534f;
  border-color: #d9534f;
  color: #d9534f;
}
.filter-btn[data-filter="okay"] {
  --btn-color: #f0ad4e;
  border-color: #f0ad4e;
  color: #f0ad4e;
}
.filter-btn[data-filter="confident"] {
  --btn-color: #5cb85c;
  border-color: #5cb85c;
  color: #5cb85c;
}

.filter-btn[data-filter="grade-boundaries"] {
  --btn-color: #9960f5; /* darker purple */
  border-color: #9960f5;
  color: #9960f5;
}

/* Hover + Active for all filter buttons */
.filter-btn:hover,
.filter-btn.active {
  background-color: var(--btn-color);
  color: white;
}
.filter-btn:hover .emoji,
.filter-btn.active .emoji {
  color: initial;
}

/* Layout container */
.filter-buttons {
  display: flex;
  gap: 10px;
  margin: 5px 0 20px 0;
  width: 100%;            
  box-sizing: border-box;      
  overflow-x: auto; /* allow scroll if needed */
}

/* Mobile: fix width + no overflow */
@media (max-width: 768px) {
  .container {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    box-sizing: border-box;
  }

  .filter-buttons {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 10px;
    padding-right: 10px;
  }

  .filter-btn {
    flex: 0 0 auto;
    width: auto;
    padding: 10px 16px;
  }

  .table-wrapper {
    display: block;
    width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-papers {
    min-width: auto;
    table-layout: auto;
    width: 100% !important;
  }

  .table-papers th:first-child,
  .table-papers td.paper-title,
  .table-papers th:last-child,
  .table-papers td.options-col {
    width: auto;
  }
}

/* Desktop: full width, buttons stretch evenly */
@media (min-width: 769px) {
  .filter-buttons {
    justify-content: stretch;
    flex-wrap: nowrap;
    width: 100%;
    box-sizing: border-box;
  }

  .filter-btn {
    flex: 1;
    min-width: 200px;
    text-align: center;
  }
}

/* Table styling */
.table-wrapper { 
  width: 100%; 
  overflow-x: auto; 
  margin: 0 auto; 
  padding: 0 8px; 
  box-sizing: border-box; 
}

.table-papers { 
  width: 100%; 
  max-width: 100%;
  border-collapse: collapse; 
  margin: 0;             
  table-layout: fixed; 
}

.table-papers th, .table-papers td { 
  padding: 10px 12px; /* slightly taller rows */
  border: 1px solid #ddd; 
  text-align: center; 
  font-size: 15px; /* slightly larger text */
  font-family: Verdana, Arial, Helvetica, sans-serif; /* apply font */
}

/* Paper title link: no underline by default */
.paper-title a { 
  text-decoration: none; 
  color: black; 
  display: inline; 
  font-family: Verdana, Arial, Helvetica, sans-serif; /* apply font */
}
.paper-title a:hover {
  text-decoration: underline;
}

/* Table columns */
.table-papers th:first-child, 
.table-papers td.paper-title { 
  width: 70%; 
}

.table-papers th:last-child, 
.table-papers td.options-col { 
  width: 30%; 
}

/* Row hover shading */
.paper-row {
  transition: background-color 0.2s ease;
}
.paper-row[data-user-rating="confident"]:hover {
  background-color: #9ee6c6 !important; /* darker green */
}
.paper-row[data-user-rating="okay"]:hover {
  background-color: #e8d48a !important; /* darker yellow */
}
.paper-row[data-user-rating="unsure"]:hover {
  background-color: #e8aaa7 !important; /* darker red */
}
.paper-row[data-user-rating=""]:hover,
.paper-row:not([data-user-rating]):hover {
  background-color: #f5f5f5 !important; /* grey hover if no rating */
}

/* Menu + dropdown styling */
.details-container { 
  display: inline-block; 
  position: relative; 
}

.menu-button { 
  padding: 8px 14px; /* slightly bigger */
  font-size: 15px; 
  cursor: pointer; 
  border: none; 
  border-radius: 4px; 
  background: #eee; 
  transition: background-color 0.2s ease;
  width: 70px;
  text-align: center;
}

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

.menu-popup { 
  position: absolute; 
  display: none; 
  min-width: 200px; 
  z-index: 9999; 
  background: white; 
  border: 1px solid #ddd; 
  border-radius: 6px; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.2); 
  right: 0;      
  left: auto;
}

.menu-popup ul { 
  list-style: none; 
  margin: 0; 
  padding: 0; 
}

.menu-popup ul li { 
  padding: 10px 14px; 
  cursor: pointer; 
  border-bottom: 1px solid #ddd; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  font-size: 15px;
  font-family: Verdana, Arial, Helvetica, sans-serif; /* apply font to menu items */
}

.menu-popup ul li:last-child { 
  border-bottom: none; 
}

.menu-popup ul li:hover { 
  background: #f0f0f0; 
}

/* Rating emojis */
.menu-popup .rate-option[data-rating="unsure"]::after { 
  content: "😞"; 
}
.menu-popup .rate-option[data-rating="okay"]::after { 
  content: "😐"; 
}
.menu-popup .rate-option[data-rating="confident"]::after { 
  content: "🙂"; 
}

.guest-table thead tr {
  background-color: rgba(15, 77, 15, 0.9); /* #0F4D0F with 0.9 opacity */
  color: white;
}
