body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #1e1e1e;
  color: #ddd;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1, h2 {
  color: #fff;
  text-align: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #333;
  padding-bottom: 10px;
  width: 80%;
  max-width: 600px;
}

.container {
  width: 90%;
  max-width: 800px;
  padding: 25px;
  background-color: #2d2d2d;
  border-radius: 12px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  margin-top: 25px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #bbb;
}

input[type="text"],
textarea,
select {
  width: 98%;
  padding: 12px;
  margin-bottom: 20px;
  border: 1px solid #444;
  background-color: #333;
  color: #eee;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 1em;
  transition: border-color 0.2s ease;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  border-color: #5a9bff;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23bbb' d='M1.47 0L6 4.53 10.53 0l.94 1.47L6 7.47.53 1.47z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

select::-ms-expand {
  display: none;
}

button {
  padding: 12px 25px;
  background-color: #4CAF50;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  margin-right: 12px;
  font-size: 1em;
  font-weight: 600;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

button:hover {
  background-color: #5cb85c;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Button Container (for spacing) */
#button-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

#button-container button {
  margin: 0 10px;
}


/* View Mode Controls */
#viewModeControls {
  margin-bottom: 0px;
  text-align: center;
}

#viewModeControls button {
  margin: 0 5px;
  padding: 8px 16px;
  background-color: #555;
  border: none;
  border-radius: 6px;
  color: #eee;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#viewModeControls button:hover {
  background-color: #666;
}

/* Filter & Sort Controls */
#controlsContainer {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
  align-items: center;
}

#filterControls, #sortControls {
  display: flex;
  align-items: center;
}

#filterControls label, #sortControls label {
  margin-right: 5px;
  white-space: nowrap;
}

#filterControls select, #sortControls select {
  margin-right: 10px;
}

/* List View Styles */
#modList.list-view {
  list-style: none;
  padding: 0;
}

#modList.list-view .mod-item {
  background-color: #333;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
  display: flex;
  align-items: flex-start;
}

#modList.list-view .mod-item:hover {
  transform: translateY(-3px);
}

#modList.list-view .mod-item strong {
  color: #fff;
  font-size: 1.2em;
  margin-bottom: 5px;
  display: block;
}

#modList.list-view .mod-item p {
  color: #ccc;
  margin-bottom: 10px;
  line-height: 1.5;
}

#modList.list-view .mod-item .mod-details {
  flex-grow: 1;
}

#modList.list-view .status-buttons {
  display: flex;
  justify-content: space-around;
  margin-bottom: 15px;
}

#modList.list-view .status-buttons button {
  background-color: #607d8b;
  color: #fff;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.9em;
  transition: background-color 0.2s ease;
}

#modList.list-view .status-buttons button:hover {
  background-color: #798ea3;
}

a {
  color: #8bc34a;
  text-decoration: none;
}

a:hover {
  color: #a5d6a7;
}


/* 3-dots Menu */
.three-dots {
  cursor: pointer;
  font-size: 1.5em;
  color: #aaa;
  padding: 5px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  position: relative; /* For the dropdown positioning */
  margin-left: auto;  /* Push to the right */
}

.three-dots:hover {
  background-color: #444;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #333;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
  right: 0; /* Align dropdown to the right of the dots */
  border-radius: 6px;
}


.dropdown-content button {
  color: #ddd;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 1px solid #444; /* Add a subtle border */
  border-radius: 0;
}

.dropdown-content button:hover {
  background-color: #444;  /* Darker shade on hover */
}

.dropdown-content button:last-child {
  border-bottom: none; /* Remove the border for the last item */
}

.show { display: block; }

/* Tooltip Styles - for the three dots. */
.tooltip {
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #eee;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9em;
  z-index: 1;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.button-with-tooltip:hover .tooltip {
  opacity: 1;
}

/* Feedback Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
  background-color: #2d2d2d;
  margin: 15% auto;
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 500px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5);
  position: relative;
}

.close-button {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-button:hover,
.close-button:focus {
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  outline: none;
}

/* Feedback Form Styles */

.feedback-form label{ /* shared modal styles */
  margin-bottom: 5px;
  color: #bbb;
  display: block;
}
.feedback-form  input[type="text"],
.feedback-form textarea,
.feedback-form select{ /* shared modal styles */
width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #444;
  background-color: #333;
  color: #eee;
  border-radius: 6px;
  box-sizing: border-box;
}

.feedback-form button {
  background-color: #4CAF50;
  color: white;
  padding: 12px 25px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.feedback-form button:hover {
  background-color: #43A047;
}

     /* Add Mod Modal Form Styles (Shared with feedbackForm  rules) */

/* Grid View Styles */
#modList.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

#modList.grid-view .mod-item {
  display: block;
  padding: 15px;
  text-align: center;
  border: 1px solid #444;
}

#modList.grid-view .mod-item strong {
  margin-bottom: 10px;
}
/* Table View Styles */
#modList.table-view {
  width: 100%; /* Take full container width */
  border-collapse: collapse; /* Remove spacing between table borders */
}

#modList.table-view li {
  display: block; /* Override flexbox display */
}

#modList.table-view .mod-item {
  display: table;
  width: 100%;
  margin-bottom: 0;
  padding: 0; /*Remove padding*/
  box-shadow: none; /* Remove the box-shadow from list items */
  border: 1px solid #444; /* Add borders to each row */
}

#modList.table-view .mod-item:hover {
transform: translateY(0); /* Remove hover effect */
}

#modList.table-view .mod-details,
#modList.table-view .status-buttons,
#modList.table-view button,
#modList.table-view .three-dots{
  display: table-cell;
  padding: 10px;
  vertical-align: middle; /* Vertically center content */
}

#modList.table-view .mod-details strong{
display: inline;/*  Make strong elements display inline */
margin: 0 ; /* Reset  margin */
}

#modList.table-view .mod-details p {
 margin: 0;
 padding:0;
 text-align: left;
 display: inline; /* Make paragraph display inline */
}

#modList.table-view .status-buttons {
text-align: center;
}

/* Remove some items from the table for a cleaner look */
#modList.table-view button{
margin: 0 5px 0 5px;
}
#modList.table-view button:first-child{
margin-left: 0;
}
#modList.table-view button:last-child{
margin-right: 0;
}

#modList.table-view .mod-details {
  width: 40%; /* Adjust the width of the details column */
  text-align: left; /* Align text to the left */
}

/* Toast Styles */
#toastContainer {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10;
  pointer-events: none; /* Allows clicks to pass through toasts */
}

.toast {
  background-color: #333;
  color: #fff;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  opacity: 0;
  animation: fadeInOut 0.5s ease forwards;
  pointer-events: auto; /* Reactivate pointer events when toast is visible */
  position: relative; /* Needed for the close button positioning */
}

.toast::before { /* optional: adds an icon for feedback */
  content: '\2713'; /* Checkmark icon */
  margin-right: 10px;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(20px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(20px); }
}

/* Close Button Style */
.toast-close {
  position: absolute;
  top: 5px;
  right: 5px;
  color: #aaa;
  font-size: 1.2em;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s ease;
  pointer-events: auto; /* Ensure click events are captured */
}

.toast-close:hover {
  opacity: 1;
}
      /* Responsive adjustments */
@media (max-width: 600px) {
  .container {
      width: 95%;
      padding: 15px;
  }

  input[type="text"],
  textarea,
  select,
  button {
      font-size: 0.95em;
  }

   /* Adjust controls container */
  #controlsContainer {
      flex-direction: column; /* Stack controls on small screens */
      align-items: stretch; /* Make controls full width */
  }

  #filterControls, #sortControls {
      width: 100%; /* Make filter and sort controls full width */
      margin-bottom: 10px; /* Add a margin for spacing */
      justify-content: space-between; /* distribute space for inner controls */
  }

  #filterControls label, #sortControls label{
       white-space: normal;
  }
  #filterControls select, #sortControls select {
      width: 90%;
      margin-bottom: 10px;
  }

  /* Grid View Adjustments */
  #modList.grid-view {
      grid-template-columns: 1fr; /* Single column on smaller screens */
  }

  #modList.table-view .mod-details {
      width: 80%;
  }

 /* Adjustments for the status buttons as well, make them much more usable. */
 .status-buttons {
      flex-direction: row; /* Make status buttons a row */
       justify-content: center; /* center the status buttons */
   }

    #modList.table-view .status-buttons button{
       margin-right: 0.5em; /* More spacing  in table view */
  }
  #modList.table-view button{ /* make buttons more narrow. */
      padding: 8px 10px;
      font-size: 0.85em;
  }
  #button-container {
       flex-direction: column;
       align-items: stretch;
   }

  #button-container button {
      margin: 5px 0;
      width: 100%;  /* Make buttons full width */
      text-align:center;
  }
  #source-input{
      flex-direction: column; /* stack the components */
  }
  #source-input button{
      width:100%;
      margin-top:  5px;/* and add a margin*/

  }
   #filterControls label, #sortControls label {
     font-size: 0.85em;
    }
   #filterControls select, #sortControls select {
     font-size: 0.85em;
    }
}
 @media (max-width: 400px) {  /* Further adjustments for very small screens */
   #viewModeControls button,
  #filterControls label,
  #sortControls label {
     font-size: 0.85em; /* Reduce text size for very small screens */
    }
/* Make the table more usable on Extremely narrow screens by reducing some padding */
 #modList.table-view .mod-details,
#modList.table-view .status-buttons,
 #modList.table-view button {
      padding: 8px;
  }
/* Make sure there is padding so elements dont appear to be right against each other.*/

  #addModModal .modal-content,
  #feedbackModal .modal-content{
      width: 95%;
      margin: 2.5% auto;
  }
#controlsContainer{
   text-align: center;
}
#controlsContainer select{
  margin: 5px;
}

}