/* VIDEO POPUP */
.welcome-video-popup{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.welcome-video-box{
  position: relative;
  width: min(900px, 92vw);
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  animation: fadeInUp 0.35s ease;
}

.welcome-video-box video{
  display: block;
  width: 100%;
  height: auto;
  max-height: 85vh;
  object-fit: cover;
  background: #000;
}

.close-video-popup{
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  border: none;
  background: rgba(220, 53, 69, 0.95);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,0.2);
  transition: transform 0.2s ease, background 0.2s ease;
}

.close-video-popup:hover{
  transform: scale(1.08);
  background: rgba(200, 35, 51, 1);
}

.welcome-video-popup.hide{
  display: none;
}

@keyframes fadeInUp{
  from{
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to{
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#i4u-ai-assistant{
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#i4u-ai-toggle{
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #4a86e8, #2f67c8);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(74, 134, 232, 0.28);
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

#i4u-ai-toggle:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(74, 134, 232, 0.34);
}

#i4u-ai-toggle-icon{
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

#i4u-ai-box{
  width: 360px;
  height: 600px;
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  display: none;
  box-shadow: 0 18px 45px rgba(74, 134, 232, 0.20);
  margin-bottom: 12px;
  opacity: 0;
  transform: translateY(20px) scale(.96);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity .32s ease, transform .32s ease;
  flex-direction: column;
  border: 1px solid rgba(74, 134, 232, 0.14);
}

#i4u-ai-box.active{
  display: flex;
}

#i4u-ai-box.show{
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  display: flex;
}

#i4u-ai-header{
  background: linear-gradient(135deg, #4a86e8, #2f67c8);
  color: #fff;
  padding: 16px 18px;
}

#i4u-ai-header-top{
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#i4u-ai-title{
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}

#i4u-ai-subtitle{
  font-size: 12px;
  opacity: .92;
  margin-top: 4px;
}

#i4u-ai-close{
  background: rgba(255,255,255,.16);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: .2s ease;
}

.i4u-ai-bubble a{
  color: #3b78de;
  text-decoration: underline;
  font-weight: 600;
}

#i4u-ai-close:hover{
  background: rgba(255,255,255,.24);
  transform: scale(1.05);
}

#i4u-ai-messages{
  height: 230px;
  overflow-y: auto;
  padding: 14px;
  background: #f5f8ff;
  scroll-behavior: smooth;
}

#i4u-ai-input-area{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-top: 1px solid #e8eef9;
}

#i4u-ai-input{
  flex: 1;
  border: 1px solid #c8d7f2;
  border-radius: 999px;
  padding: 11px 14px;
  font-size: 14px;
  outline: none;
}

#i4u-ai-input:focus{
  border-color: #4a86e8;
  box-shadow: 0 0 0 3px rgba(74, 134, 232, .14);
}

#i4u-ai-send{
  border: none;
  background: linear-gradient(135deg, #4a86e8, #2f67c8);
  color: #fff;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s ease;
}

#i4u-ai-send:hover{
  background: linear-gradient(135deg, #5a93ef, #3d78dc);
  transform: scale(1.03);
}

.i4u-ai-msg{
  display: flex;
  margin-bottom: 12px;
}

.i4u-ai-msg.user{
  justify-content: flex-end;
}

.i4u-ai-bubble{
  max-width: 82%;
  padding: 11px 13px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.i4u-ai-msg.bot .i4u-ai-bubble{
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #d7e3f6;
  border-bottom-left-radius: 6px;
  box-shadow: 0 4px 12px rgba(74, 134, 232, 0.06);
}

.i4u-ai-msg.user .i4u-ai-bubble{
  background: linear-gradient(135deg, #4a86e8, #2f67c8);
  color: #fff;
  border-bottom-right-radius: 6px;
}

#i4u-ai-typing{
  display: none;
  padding: 0 14px 10px;
  background: #f5f8ff;
}

#i4u-ai-typing span{
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-radius: 50%;
  background: #4a86e8;
  animation: i4uTyping 1.2s infinite;
}

#i4u-ai-typing span:nth-child(2){ animation-delay: .2s; }
#i4u-ai-typing span:nth-child(3){ animation-delay: .4s; }

@keyframes i4uTyping{
  0%, 60%, 100%{
    transform: translateY(0);
    opacity: .5;
  }
  30%{
    transform: translateY(-5px);
    opacity: 1;
  }
}

#i4u-ai-suggestions{
  padding: 12px 14px 14px;
  background: #fff;
  border-top: 1px solid #e8eef9;
}

#i4u-ai-suggestions-title{
  font-size: 12px;
  color: #4f5f78;
  margin-bottom: 10px;
  font-weight: 700;
}

.i4u-ai-chip-wrap{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.i4u-ai-chip{
  border: 1px solid #c7d9f5;
  background: #eef4ff;
  color: #326dce;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: .2s ease;
  text-align: center;
}

.i4u-ai-chip:hover{
  background: #4a86e8;
  color: #fff;
  border-color: #4a86e8;
  transform: translateY(-1px);
}

@media (max-width: 480px){
  #i4u-ai-assistant{
    right: 12px;
    bottom: 12px;
  }

  #i4u-ai-box{
    width: calc(100vw - 24px);
    max-width: 360px;
    height: 550px;
  }

  #i4u-ai-toggle-text{
    display: none;
  }

  .i4u-ai-chip-wrap{
    grid-template-columns: 1fr;
  }
}