*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

body{
  font-family:'Segoe UI',sans-serif;
  background:linear-gradient(180deg,#f6f8fc,#fff);
  color:#333;
}

.header {
  position: fixed;
  top: 0;
  width: 100%;
  height: 60px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.home-icon {
  position: absolute;
  left: 20px;
}

.home-icon img {
  width: 24px;
}

.header-title {
  font-size: 20px;
  font-weight: 600;
}

.user-menu {
  position: absolute;
  top: 50%;
  right: 30px;
  transform: translateY(-50%);
  z-index: 1500;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0f4f9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  border: 1px solid #c7c7c7;
  transition: background 0.3s;
}

.avatar:hover {
  background: #e8f0fe;
}

.user-popup {
  position: absolute;
  top: 55px;
  right: 0;
  width: 280px;
  background: white;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
  padding: 16px;
}

.hidden {
  display: none;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-btn {
  flex: 1;
  padding: 6px 0;
  border-radius: 20px;
  border: 1px solid #1a73e8;
  background: white;
  cursor: pointer;
  font-weight: bold;
}

.tab-btn.active {
  background: #1a73e8;
  color: white;
}

.auth-form input {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.full {
  width: 100%;
  text-align: center;
  margin-bottom: 10px;
}

.divider {
  text-align: center;
  font-size: 13px;
  color: #5f6368;
  margin: 10px 0;
}

.google-btn {
  width: 100%;
  background: white;
  border: 1px solid #1a73e8;
  color: #1a73e8;
  border-radius: 30px;
  padding: 10px 20px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.8s;
}

.google-btn:hover {
  background: #1a73e8;
  color: white;
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.user-name {
  font-weight: bold;
  margin-bottom: 4px;
}

.user-email {
  font-size: 13px;
  color: #5f6368;
  margin-bottom: 12px;
}

.card-button {
  display: inline-block;
  background: white;
  border: 1px solid #1a73e8;
  color: #1a73e8;
  border-radius: 30px;
  padding: 10px 20px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.8s;
}

.card-button:hover {
  background: #1a73e8;
  color: white;
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.logout {
  border-color: #d93025;
  color: #d93025;
}

.logout:hover {
  background: #d93025;
  color: white;
}

#user-img {
  width: 25px;
  height: 25px;
}

.languageSwitcher {
  position: absolute;
  top: 50%;
  right: 90px;
  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;
}

.pageContainer{
  max-width:900px;
  margin:auto;
  padding:90px 20px 40px;
}

.languageGrid{
  display:flex;
  flex-direction:column;
  gap:18px;
  align-items:center;
}

.languageCard{
  width:100%;
  max-width:480px;
  background:#fff;
  border-radius:18px;
  padding:18px;
  display:flex;
  gap:18px;
  align-items:center;
  cursor:pointer;
  box-shadow:0 6px 20px rgba(0,0,0,.08);
}

.languageFlag{
  font-size:34px;
}

.languageName{
  font-size:20px;font-weight:bold;
}

.languageCount{
  font-size:14px;
  color:#5f6368;
}

.wordsHeader{
  position:relative;
  margin-bottom:20px;
}

.backBtn{
  position:absolute;
  left:0;
  font-size:22px;
  background:none;
  border:none;
  cursor:pointer;
}

.wordsTitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  text-align: center;
  font-size: 26px;
}

.wordsList{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.wordCard{
  background:#fff;
  border-radius:16px;
  padding:16px;
  box-shadow:0 4px 14px rgba(0,0,0,.08);
  display:flex;
  justify-content:space-between;
  align-items:center;
  position:relative;
}

.wordText{
  font-size:18px;
  font-weight:600;
}

.wordTranslation{
  color:#5f6368;
}

.deleteBtn{
  background:none;
  border:none;
  font-size:20px;
  cursor:pointer;
  color:#d93025;
}

.confirmPopup {
  position: absolute;
  bottom: 100%;
  right: 10px;
  margin-bottom: 10px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
  min-width: 200px;
}

.confirmBtns {
  display: flex;
  gap: 8px;
}

.confirmBtns button {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.confirmPopup button{
  border:none;
  border-radius:6px;
  padding:6px;
  cursor:pointer;
}

.confirmYes{
  background:#d93025;
  color:#fff;
}

.confirmNo{
  background:#eee;
}

.addCard{
  border:2px dashed #1a73e8;
  justify-content:center;
  font-size:26px;
  color:#1a73e8;
  cursor:pointer;
}

.addForm{
  display:flex;
  gap:10px;
  width:100%;
}

.addForm input{
  flex:1;
  padding:8px;
  border-radius:8px;
}

.addForm button{
  width:38px;height:38px;
  border-radius:50%;
  background:#1a73e8;
  color:#fff;
  border:none;
}

.scrollTopBtn {
  position: fixed !important;
  right: 25px;
  bottom: 25px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #1a73e8;
  z-index: 10000;
  display: flex; 
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  visibility: visible;
}

.scrollTopBtn.hidden {
  display: none ;
}

.loadMoreBtn {
  margin: 20px auto;
  width: 50px; 
  height: 50px;
  border-radius: 50%;
  border: none;
  background: #1a73e8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.hidden{
  display:none
}

html, body {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

.languageFlagImage{
  width: 50px;
  height: 50px;
}

#bin-img{
  width: 30px;
  height: 30px;
}

#plus-img{
  width: 30px;
  height: 30px;
}

#check-img{
  width: 15px;
  height: 15px;
}

#user-img{
  width: 25px;
  height: 25px;
}

#backBtn-img{
  width: 40px;
  height: 40px;
}

#downArrow-img{
  width: 15px;
  height: 15px;
}

#upArrow-img{
  width: 15px;
  height: 15px;
}

.headerFlag {
  width: 35px;
  height: 35px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.languageCard{
  position: relative;
}

.languageInfo{
  flex: 1;
}

.studyBtn{
  margin-left: auto;
  padding: 8px 18px;
  border-radius: 999px;
  border: none;
  background: #1a73e8;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.studyBtn:hover{
  background: #1558c0;
}

.studyBtn:active{
  transform: scale(0.96);
}

@media(max-width:600px){
  
  .wordCard{
    flex-direction:column;
    align-items:flex-start;
  }
  
  .addForm{
    flex-direction:column;
  }

    .languageLabel{
    visibility: hidden;
  }

  .languageSwitcher select {
    font-size: 10px;
    width: 90px;
  }

  .header-title {
    font-size: 10px;
  }
}
