* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

header {
  background: white;
  padding: 20px 30px;
  border-radius: 10px;
  margin-bottom: 30px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  color: #333;
  font-size: 2em;
}

nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

nav a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  padding: 10px 20px;
  border: 2px solid #667eea;
  border-radius: 5px;
  transition: all 0.3s ease;
}

nav a:hover {
  background: #667eea;
  color: white;
}

.reset-btn {
  background: #dc3545;
  color: white;
  border: 2px solid #dc3545;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.reset-btn:hover {
  background: #c82333;
  border-color: #c82333;
  transform: translateY(-2px);
}

.cloud-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

main {
  background: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  flex: 1;
}

.qr-sidebar {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
  min-width: 250px;
}

.qr-sidebar h3 {
  color: #333;
  margin-bottom: 10px;
  font-size: 1.3em;
}

.qr-sidebar p {
  color: #666;
  margin-bottom: 20px;
  font-size: 0.95em;
}

#qrcode {
  display: inline-block;
  padding: 15px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#qrcode img {
  display: block;
  margin: 0 auto;
}

.form-container {
  max-width: 500px;
  margin: 0 auto 40px;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 600;
  font-size: 1.1em;
}

input[type="text"] {
  width: 100%;
  padding: 12px 15px;
  font-size: 1em;
  border: 2px solid #ddd;
  border-radius: 5px;
  transition: border-color 0.3s ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: #667eea;
}

.autocomplete-wrapper {
  position: relative;
}

.autocomplete-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #667eea;
  border-top: none;
  border-radius: 0 0 5px 5px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-item {
  padding: 12px 15px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
  background-color: #f0f0ff;
  color: #667eea;
}

button[type="submit"] {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
}

button[type="submit"]:hover {
  transform: translateY(-2px);
}

button[type="submit"]:active {
  transform: translateY(0);
}

.message {
  display: none;
  padding: 12px;
  margin-top: 15px;
  border-radius: 5px;
  text-align: center;
  font-weight: 600;
}

.message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.info {
  text-align: center;
  padding: 30px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-top: 30px;
}

.info h2 {
  color: #333;
  margin-bottom: 15px;
}

.info p {
  color: #666;
  font-size: 1.1em;
  line-height: 1.6;
}

#wordCloud {
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.word {
  display: inline-block;
  padding: 8px 12px;
  margin: 5px;
  cursor: default;
  transition: transform 0.2s ease;
  font-weight: 600;
}

.word:hover {
  transform: scale(1.1);
}

.empty-state {
  text-align: center;
  color: #999;
  font-size: 1.2em;
  padding: 60px 20px;
}

.loading {
  text-align: center;
  color: #666;
  font-size: 1.2em;
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  header h1 {
    font-size: 1.5em;
  }

  nav {
    flex-direction: column;
    width: 100%;
  }

  nav a,
  .reset-btn {
    width: 100%;
  }

  .cloud-layout {
    flex-direction: column;
  }

  main {
    padding: 20px;
  }

  .qr-sidebar {
    width: 100%;
  }
}
