* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f7fa;
  color: #333;
  font-size: 16px;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  text-align: center;
  margin-bottom: 15px;
  color: #007bff;
  padding-top: 30px;
}

#login {
  text-align: center;
  background-color: #fff;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  min-width: 400px;
  margin: 0 auto;
  overflow: hidden;
}

#login h2 {
  margin-bottom: 15px;
}

#login input {
  padding: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 auto 10px;
  display: block;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
}

#main {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  transition: all 0.3s ease;
  margin: 0 10px 10px 10px;
}

.panel {
  width: 50%;
  padding: 15px;
  box-sizing: border-box;
}

.left {
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
}

.right {
  display: flex;
  flex-direction: column;
}

h3 {
  margin-top: 0;
  color: #007bff;
  font-size: 18px;
}

textarea {
  width: 100%;
  flex-grow: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
  font-size: 14px;
  box-sizing: border-box;
  margin-bottom: 10px;
}

.buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.buttons button {
  width: 50%;
}

.upload-wrapper {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

input[type="file"] {
  width: 100%;
  font-size: 16px;
  cursor: pointer;
  color: transparent;
}

input[type="file"]::-webkit-file-upload-button,
input[type="file"]::file-selector-button {
  padding: 10px 20px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
  font-size: 16px;
}

input[type="file"]::-webkit-file-upload-button:hover,
input[type="file"]::file-selector-button:hover {
  background-color: #0056b3;
}

button {
  padding: 12px 24px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s, opacity 0.3s;
  font-size: 16px;
  min-height: 32px;
}

button:hover {
  background-color: #0056b3;
}

button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.delete {
  background-color: #dc3545;
}

button.delete:hover {
  background-color: #c82333;
}

#progress {
  color: #007bff;
  font-weight: bold;
  font-size: 16px;
  white-space: nowrap;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 10px;
  background-color: #f9f9f9;
}

li {
  margin: 8px 0;
  padding: 10px;
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

li a {
  display: inline-block;
  flex-grow: 1;
  word-break: break-word;
  max-width: none;
}

li span.timestamp {
  color: #666;
  margin-left: 5px;
  font-size: 12px;
}

li button.file-delete {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #dc3545;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
}

li button.file-delete:hover {
  color: #c82333;
}

a {
  text-decoration: none;
  color: #007bff;
  word-break: break-all;
}

a:hover {
  text-decoration: underline;
}

/* Responsive cho mobile */
@media (max-width: 600px) {
  body {
    padding: 0;
  }

  header {
    padding-top: 30px;
  }

  #main {
    flex-direction: column;
    flex-wrap: nowrap;
    margin: 0 5px 5px 5px;
  }

  #login {
    max-width: 100%;
  }

  .panel {
    width: 100% !important;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px;
  }

  .left {
    border-bottom: 1px solid #e0e0e0;
    border-right: none !important;
  }

  textarea {
    height: 150px;
    min-height: 100px;
  }

  ul {
    max-height: 200px;
  }

  button, input[type="file"] {
    width: 100%;
    margin-bottom: 10px;
  }

  #login input, #login button {
    width: 100%;
    margin: 5px 0;
  }

  .buttons {
    flex-direction: column;
    gap: 10px;
  }

  .buttons button {
    width: 100%;
    margin-bottom: 0;
  }

  .upload-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }

  #progress {
    margin-left: 0;
    margin-top: 5px;
  }

  li {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  li a {
    flex-basis: calc(100% - 30px);
  }

  li button.file-delete {
    flex-basis: 20px;
  }
}