* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: white;
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  text-align: center;
  padding: 20px;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #ddd;
  background: white;
  z-index: 1000;
}

.home-icon {
  position: absolute;
  left: 20px;
  display: flex;
  align-items: center;
  height: 100%;
}

.home-icon img {
  height: 25px;
  width: 25px;
}

.header-title {
  font-size: 20px;
  font-weight: 600;
  color: #3c4043;
}

.title {
  font-size: 64px;
  font-weight: 900;
  margin-top: 80px;
  margin-bottom: 20px;
  color: #1a1a1a;
}

.subtitle {
  font-size: 18px;
  color: #5f6368;
  margin-bottom: 40px;

}

.form {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.form-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
}

select {
  padding: 16px 20px;
  border: none;
  border-radius: 40px;
  background-color: #f1f5fb;
  font-size: 16px;
  width: 240px;
  color: #333;
}

select:focus {
  outline: none;
  box-shadow: 0 0 0 2px #cbdffd;
}

.generate-btn {
  margin-top: 10px;
  padding: 16px 40px;
  border: none;
  border-radius: 40px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
  border: 1px solid #1a73e8;
  color: #1a73e8;
  transition: all 0.8s;
}

.generate-btn:hover {
  background: #1a73e8;
  color: white;
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}


.camera-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 450px;
  height: 300px;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  background-color: #f0f0f0;
  margin: 20px auto;
  position: relative;
  margin-top: 120px;
}

.camera-container.hidden {
  display: none;
}

#video-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.capture-btn-container {
  text-align: center;
  margin-top: 20px;
}

.capture-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 5px solid white;
  background-color: #1a73e8;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  outline: none;
}

.capture-btn:hover {
  background-color: #1a56b8;
  transform: scale(1.1);
}

#captured-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transform: scaleX(-1);
}

.hidden {
  display: none;
}

#loading {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

#loading-gif {
  margin-top: 250px;
  width: 110px;
  height: 110px;
}

.output-section {
  margin-top: 40px;
  padding: 20px;
}

.object-title {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #1a1a1a;
}

.object-block {
  margin-bottom: 40px;
}

.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  grid-template-columns: repeat(3, 1fr);
}

.card {
  background-color: #eef3fb;
  border-radius: 20px;
  padding: 20px;
  width: 300px;
  text-align: left;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.word-header {
  margin-bottom: 12px;
}

.word {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
}

.translation {
  font-size: 16px;
  color: #555;
}

.sentence-box {
  margin-top: 10px;
  padding: 12px;
  background-color: #dce8f8;
  border-radius: 12px;
}

.sentence {
  font-size: 16px;
  color: #222;
}

.sentence-translation {
  font-size: 14px;
  color: #444;
  margin-top: 4px;
}

.object-title-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.text-and-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.word-header {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sentence-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.translation, .sentence-translation {
  color: #888;
  font-size: 14px;
  font-style: italic;
  width: 100%;
  text-align: left;
}

.speak-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #888;
  line-height: 1;
  padding: 0;
  transition: color 0.3s ease;
  background: none;
}

.speak-btn:hover {
  color: #1a73e8;
}

#speaker-img{
  width: 20px;
  height: 20px;
  background: none;
}

#backBtn {
  position: absolute;
  top: 70px;
  left: 10px;
}

#backBtn-img {
  width: 35px;
  height: 35px;
}

.languageSwitcher {
  position: absolute;
  top: 50%;
  right: 30px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 15px;
  white-space: nowrap;
}

.languageSwitcher select {
  width: 120px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background-color: white;
  cursor: pointer;
  font-size: 15px;
}

.languageSwitcher select:hover {
  background-color: #f0f0f0;
}

@media (max-width: 768px) {

  .languageLabel{
    visibility: hidden;
  }
    
  .languageSwitcher select {
    font-size: 13px;
  }
    
  .header-title {
    font-size: 13px;
  }
}