.terms-button {
  margin-right: 10px; /* reduced margin */
  background-color: #555; /* dark gray background */
  border: none;
  padding: 5px 10px;
  font-size: 12px; /* reduced font size */
  cursor: pointer;
  border-radius: 5px;
}

.filesp {
  margin: 10px;
}

.terms-button a {
  color: #fff;
  text-decoration: none;
}

.terms-button:hover {
  background-color: #666; /* darker gray background on hover */
}

.button-container {
  display: flex; /* Add flexbox to the button container */
  justify-content: flex-end; /* Align items to the right */
  margin-bottom: 20px; /* Add some margin below the button */
}

/* Enhanced download button with gradient background */
#download-all-button {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  background: linear-gradient(90deg, #007bff, #0056b3);
  color: #ffffff; /* White text */
  cursor: pointer;
  transition: background-color 0.3s; /* Add transition effect */
}

#download-all-button:hover {
  background: linear-gradient(90deg, #0056b3, #003f7f);
}

#download-all-button:disabled {
  background-color: #999; /* Gray background when disabled */
  cursor: not-allowed;
}

.container {
  margin-top: 20px; /* Add margin to separate the button from the file list */
}

#file-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#file-list li {
  display: flex;
  align-items: center;
  margin-bottom: 10px; /* Add spacing between files */
}

#file-list li:last-child {
  border-bottom: none;
}

#file-list button {
  background-color: #4caf50;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-left: auto; /* Add this line */
}

#file-list button:hover {
  background-color: #3e8e41; /* Darker green background on hover */
}

#file-list span {
  font-weight: bold;
  color: #fff; /* White text */
  margin-right: 10px;
  display: inline-block;
  width: 150px;
  text-align: left;
}

#file-list .file-name {
  font-weight: bold;
  color: #fff; /* White text */
  margin-right: 30px;
  width: 150px;
  text-align: left;
}

#file-list .file-date {
  font-size: 0.8em;
  color: #999; /* Light gray text */
  margin-right: 10px; /* Add some margin to the right */
}

#file-list .file-creator {
  font-size: 0.8em;
  color: #666; /* Darker gray text */
  margin-right: 10px; /* Add some margin to the right */
}

.download-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #333;
  color: #fff;
  border: none;
  padding: 13px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.download-button:hover {
  background-color: #555; /* add a nice hover effect */
}

/* Filter styles */
.filter-container {
  display: flex;
  align-items: center;
  background-color: #333;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: space-between;
  margin-left: 10px;
  margin-right: 10px;
  width: calc(100% - 20px);
  box-sizing: border-box;
}

/* Button group for organizing action buttons */
.button-group {
  display: flex;
  gap: 10px;
  margin-left: auto;
  align-items: center;
}

/* Consistent styling for all buttons in the filter bar */
.button-group button {
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Style for download all button in the filter bar */
#download-all-button {
  padding: 0 20px;
  background: linear-gradient(90deg, #007bff, #0056b3);
  color: #ffffff;
  gap: 8px;
}

#download-all-button:hover {
  background: linear-gradient(90deg, #0056b3, #003f7f);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#download-all-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Refresh button styling */
#refresh-button {
  background-color: #444;
  color: #fff;
  width: 40px;
}

#refresh-button:hover {
  background-color: #555;
  transform: rotate(180deg);
}

#refresh-button:active {
  background-color: #666;
  transform: rotate(360deg);
}

.filter-container label {
  color: #fff;
  margin-right: 5px;
}

#platform-filter {
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #555;
  background-color: #444;
  color: #fff;
  margin-right: 15px;
  cursor: pointer;
}

#file-search {
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #555;
  background-color: #444;
  color: #fff;
  width: 200px;
}

.file-counter {
  color: #999;
  font-size: 0.9em;
  margin-bottom: 10px;
}

/* Platform indicator */
.file-platform {
  font-size: 0.8em;
  color: #4caf50;
  background-color: rgba(76, 175, 80, 0.1);
  padding: 3px 8px;
  border-radius: 3px;
  margin-right: 15px;
  width: 70px !important;
  text-align: center !important;
}

/* Add responsive styles for smaller screens */
@media (max-width: 768px) {
  .filter-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  #file-search {
    width: 100%;
  }
  
  #file-list li {
    flex-wrap: wrap;
  }
  
  #file-list span {
    margin-bottom: 5px;
  }
  
  #file-list button {
    margin-top: 10px;
    margin-left: 0;
  }
}

/* Base responsive styles - Mobile First approach */
html {
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: inherit;
}

/* Content container styling */
.container.filesp {
  padding: 0 10px;
  max-width: 100%;
  margin: 0 auto;
}

/* Responsive typography */
h1 {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  text-align: center;
  width: 100%;
}

/* Enhanced responsive styles for different screen sizes */
/* Small phones (portrait) */
@media (max-width: 480px) {
  .filter-container {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
  }
  
  .filter-container label {
    display: block;
    margin-bottom: 5px;
  }
  
  #platform-filter {
    width: 100%;
    margin-right: 0;
    margin-bottom: 10px;
  }
  
  #file-search {
    width: 100%;
  }
  
  .button-group {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
  
  #download-all-button {
    flex: 1;
  }
  
  #file-list li {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
  }
  
  #file-list .file-name {
    width: 100%;
    margin-right: 0;
    font-size: 1rem;
  }
  
  #file-list .file-platform,
  #file-list .file-date,
  #file-list .file-creator {
    width: auto !important;
    margin: 2px 5px 2px 0;
    display: inline-block;
  }
  
  #file-list button {
    margin: 10px 0 0 0;
    width: 100%;
  }
  
  /* Footer responsive styling for small devices */
  .footer {
    padding: 0;
    flex-direction: column;
    min-height: 50px;
  }
  
  .footer p {
    margin: 8px 0 4px 0;
  }
  
  .footer-buttons {
    width: 100%;
    justify-content: center;
    margin-bottom: 8px;
  }
  
  .terms-button {
    margin-right: 5px;
    margin-left: 5px;
  }
  
  body {
    padding-bottom: 65px; /* Increased padding to accommodate larger footer */
  }
}

/* Medium devices (tablets) */
@media (min-width: 481px) and (max-width: 768px) {
  .filter-container {
    flex-wrap: wrap;
    padding: 12px;
  }
  
  .filter-container > * {
    margin-bottom: 8px;
  }
  
  .button-group {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
  
  #file-search {
    width: 100%;
  }
  
  #file-list li {
    flex-wrap: wrap;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
  }
  
  #file-list .file-name {
    width: 100%;
    margin-bottom: 8px;
  }
  
  #file-list .file-platform {
    margin-left: 0;
  }
  
  #file-list button {
    margin-top: 8px;
  }
}

/* Larger tablets and small laptops */
@media (min-width: 769px) and (max-width: 1024px) {
  .filter-container {
    padding: 12px;
  }
  
  #file-search {
    width: 160px;
  }
  
  #file-list li {
    padding: 8px 5px;
    border-radius: 5px;
    margin-bottom: 8px;
    background-color: rgba(255, 255, 255, 0.02);
  }
  
  #file-list .file-name {
    width: 130px;
  }
  
  #file-list span {
    width: auto;
    margin-right: 15px;
  }
}

/* Desktop and larger screens */
@media (min-width: 1025px) {
  .container.filesp {
    max-width: 1200px;
    margin: 0 auto;
  }
  
  #file-list li {
    transition: background-color 0.2s ease;
    padding: 8px 10px;
    border-radius: 5px;
  }
  
  #file-list li:hover {
    background-color: rgba(255, 255, 255, 0.05);
  }
  
  /* Make room for the platform indicator */
  #file-list .file-name {
    width: 180px;
  }
}

/* Dark mode and reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* Touch device optimizations */
@media (hover: none) {
  .button-group button,
  #file-list button {
    padding: 12px 20px;  /* Larger touch targets */
  }
  
  #file-list li {
    padding: 12px 8px;
  }
}
