/* === FILE LIST STYLING === */
.file-list {
  list-style: none;
  padding: 0;
  margin: 2em auto;
  width: 1000px; /* wider on desktop */
}

/* Make it wider on larger screens */
@media (max-width: 1080px) {
  .file-list {
    max-width: 500px;
  }
}


.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between; /* keeps buttons on right */
  background: rgba(255, 255, 255, 0.05);
  padding: 1em 1.5em;
  margin-bottom: 1em;
  border-radius: 15px;
  box-shadow: 0 0 15px rgba(204, 0, 227, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.file-list li:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(204, 0, 227, 0.3);
}

.file-name {
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%; /* more space for file name */
}

.file-list a {
  text-decoration: none;
  margin-left: 0.5em;
  padding: 0.5em 0.9em;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9em;
  transition: all 0.2s ease;
}

.btn-open {
  background: var(--purple);
  color: #fff;                 /* keep text white */
  text-decoration: none;
}

.btn-open:hover {
  background: var(--purple-light);
  color: #fff;                 /* keep text white on hover */
}


.btn-download {
  background: var(--accent);
  color: #1a1a1a;
}

.btn-download:hover {
  background: var(--accent-dark);  /* use darker accent */
  color: #1a1a1a;                  /* keep text/icon color */
  box-shadow: 0 0 10px rgba(204, 0, 227, 0.3);
}

/* Buttons container: keep buttons together */
.file-list li .btn-open,
.file-list li .btn-download {
  margin-left: 0.3em; /* smaller gap between buttons */
}

/* Adjust buttons alignment */
.file-list li a {
  display: inline-flex;
  align-items: center;
  gap: 0.3em; /* icon + text gap */
}

/* Responsive adjustments for mobile */
@media (max-width: 700px) {
  .file-list {
    width: unset;        /* let width adapt to screen */
    margin: 1.5em auto;
  }
  .file-list li {
    flex-direction: column;          /* stack content vertically */
    align-items: flex-start;
    text-align: left;
    padding: 1em;
    width: unset;
  }

  .file-name {
    max-width: 100%;
    white-space: normal;
    margin-bottom: 0.6em;
  }

  .file-list li span:last-child {
    width: 100%;
    justify-content: flex-start;     /* align buttons left */
    gap: 0.6em;
  }

  .btn-open,
  .btn-download {
    flex: 1 1 auto;                 /* make buttons scale better */
    text-align: center;
  }
}