@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap");

:root {
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --background-color: #1a1a1a;
  --surface-color: #2c2c2c;
  --text-color: #ffffff;
  --text-secondary: #b3b3b3;
}

body {
  font-family: "Roboto", sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
}

.container {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  align-items: center;
}

header {
  text-align: center;
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: 800px;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

#user-count {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.input-section {
  margin-bottom: 1rem;
  width: 100%;
  max-width: 800px;
}

.text-input-group {
  display: flex;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.text-input-group textarea {
  font-family: "Roboto", sans-serif;
  flex-grow: 1;
  width: 100%;
  padding: 0.7rem;
  border-radius: 14px;
  border: none;
  background-color: #3a3a3a;
  color: var(--text-color);
  font-size: 1rem;
  resize: vertical;
  min-height: 40px;
  max-height: 150px;
}

.text-input-group button {
  padding: 0.7rem;
  border-radius: 14px;
  border: none;
  background-color: var(--primary-color);
  color: var(--text-color);
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.text-input-group button:hover {
  background-color: #2980b9;
}

.file-input-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.75rem;
}

.file-input-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1rem;
  background-color: #3a3a3a;
  color: var(--text-color);
  border-radius: 14px;
  cursor: pointer;
  font-size: 1rem;
  height: 40px;
  box-sizing: border-box;
}

.file-input-group .choose-text {
}

.file-input-group .file-name {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: 0;
}

.file-input-group input[type="file"] {
  position: absolute;
  left: -9999px;
}

.button-group {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-direction: row;
}

.button-group button {
  flex: 1;
  padding: 0.7rem;
  border-radius: 14px;
  border: none;
  background-color: var(--primary-color);
  color: var(--text-color);
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.button-group button:hover {
  background-color: #2980b9;
}

.progress-container {
  width: 100%;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease-out, opacity 0.4s ease-out;
}

.progress-container.visible {
  max-height: 300px;
  opacity: 1;
}

.progress-container.hidden {
  max-height: 0;
  opacity: 0;
}

.progress-wrapper {
  background-color: #3a3a3a;
  padding: 0.7rem;
  border-radius: 14px;
  margin-bottom: 0.5rem;
}

.progress-label {
  color: var(--text-color);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: #444;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background-color: var(--secondary-color);
  transition: width 0.2s ease;
}

.error-message {
  color: #e74c3c;
  background-color: rgba(231, 76, 60, 0.1);
  padding: 0.7rem;
  border-radius: 14px;
  margin-top: 0.5rem;
}

.output-section {
  display: flex;
  flex: 1;
  width: 100%;
  min-height: 300px;
  max-width: 800px;
}

.received-data {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.content-box {
  background-color: #3a3a3a;
  border-radius: 14px;
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.content-box > *:not(:last-child) {
  border-bottom: 1px solid #4a4a4a;
  padding-bottom: 0.7rem;
  margin-bottom: 0.7rem;
}

.content-box p {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-word;
  font-size: 0.95rem;
}

.received-file {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.received-file img,
.received-file video,
.received-file audio,
.received-file iframe {
  max-width: 100%;
  border-radius: 8px;
}

.received-file a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
}

.received-file a:hover {
  color: var(--primary-color);
}

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (min-aspect-ratio: 9/16) {
  body {
    margin: 2rem;
  }

  .container {
    height: calc(100vh - 6rem);
  }
}

@media (max-aspect-ratio: 9/16) {
  body {
    margin: 0.75rem;
  }

  .container {
    height: calc(100vh - 3.5rem);
  }
}
