body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background-color: white;
  min-height: 100vh;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 2px solid #eee;
  margin-bottom: 30px;
}

.logo-container h1 {
  color: #2c3e50;
  margin: 0;
  font-size: 24px;
}

#user-status {
  font-size: 14px;
  color: #666;
}

main {
  padding: 20px 0;
}

#kanji-selection {
  padding: 30px;
  border-radius: 10px;
  background-color: #ffffff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
}

#kanji-selection h3 {
  color: #2c3e50;
  margin-bottom: 25px;
  font-size: 20px;
}

.select-all-button {
  margin-bottom: 15px !important;
  padding: 8px 16px !important;
  background: #2196f3 !important;
  color: white !important;
  border: none !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  transition: background-color 0.3s ease !important;
}

.select-all-button:hover {
  background: #1976d2 !important;
}

#kanji-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
  max-height: 400px;
  overflow-y: auto;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #fafafa;
}

.kanji-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background-color: white;
  transition: all 0.3s ease;
  cursor: pointer;
}

.kanji-item:hover {
  border-color: #4caf50;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.kanji-item input[type="checkbox"] {
  margin-bottom: 8px;
  transform: scale(1.2);
}

.kanji-item label {
  font-size: 24px;
  font-weight: bold;
  color: #2c3e50;
  cursor: pointer;
  user-select: none;
}

.kanji-item input[type="checkbox"]:checked + label {
  color: #4caf50;
}

.kanji-item:has(input[type="checkbox"]:checked) {
  border-color: #4caf50;
  background-color: #f0f8f0;
}

#generate-sentence-button {
  background: linear-gradient(135deg, #4caf50, #45a049);
  color: white;
  padding: 15px 30px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(76, 175, 80, 0.3);
}

#generate-sentence-button:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(76, 175, 80, 0.4);
}

#generate-sentence-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

#generate-sentence-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#generated-sentence {
  margin-top: 30px;
  padding: 20px;
  border-radius: 8px;
  background-color: #f8f9fa;
  border-left: 4px solid #4caf50;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1.6;
  color: #2c3e50;
}

#generated-sentence:empty {
  display: none;
}

#loading {
  margin-top: 20px;
  padding: 15px;
  background-color: #e3f2fd;
  border-radius: 8px;
  color: #1976d2;
  font-style: italic;
}

footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  text-align: center;
}

footer a {
  color: #4caf50;
  text-decoration: none;
  padding: 10px 20px;
  border: 2px solid #4caf50;
  border-radius: 8px;
  transition: all 0.3s ease;
}

footer a:hover {
  background-color: #4caf50;
  color: white;
}

/* Responsive design */
@media (max-width: 600px) {
  .container {
    padding: 10px;
  }

  #kanji-list {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    padding: 15px;
  }

  .kanji-item {
    padding: 8px;
  }

  .kanji-item label {
    font-size: 20px;
  }
}

/* Loading animation */
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

#loading {
  animation: pulse 1.5s ease-in-out infinite;
}
