/* Telegram Chat Demo - 3D Tablet */

.telegram-tablet-wrapper {
  position: absolute;
  top: 50%;
  right: calc(5% + 75px);
  transform: translateY(-50%);
  perspective: 1500px;
  z-index: 5;
}

.telegram-tablet {
  width: 450px;
  height: 600px;
  background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
  border-radius: 30px;
  padding: 20px;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.5),
    inset 0 0 0 3px rgba(98, 255, 0, 0.3),
    0 0 40px rgba(98, 255, 0, 0.2);
  transform: rotateY(-15deg) rotateX(5deg);
  transition: transform 0.6s ease;
  position: relative;
  animation: float 6s ease-in-out infinite;
}

.telegram-tablet:hover {
  transform: rotateY(0deg) rotateX(0deg) scale(1.02);
}

@keyframes float {
  0%,
  100% {
    transform: rotateY(-15deg) rotateX(5deg) translateY(0px);
  }
  50% {
    transform: rotateY(-15deg) rotateX(5deg) translateY(-20px);
  }
}

/* Lime Glowing Border - Matches Site Color */
.telegram-tablet::before {
  content: "";
  position: absolute;
  inset: -10px;
  background: linear-gradient(
    45deg,
    #ccff00,
    #d1ff0f,
    #ccff00,
    #d1ff0f,
    #ccff00
  );
  background-size: 400% 400%;
  border-radius: 38px;
  z-index: -1;
  opacity: 0.9;
  filter: blur(25px);
  animation:
    borderGlow 4s ease-in-out infinite,
    gradientShift 8s ease infinite;
}

@keyframes borderGlow {
  0%,
  100% {
    opacity: 0.8;
    filter: blur(25px);
    transform: scale(1);
  }
  50% {
    opacity: 1;
    filter: blur(30px);
    transform: scale(1.02);
  }
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Additional inner glow */
.telegram-tablet::after {
  content: "";
  position: absolute;
  inset: -3px;
  background: linear-gradient(
    45deg,
    rgba(204, 255, 0, 0.4),
    rgba(209, 255, 15, 0.4)
  );
  border-radius: 32px;
  z-index: -1;
  opacity: 0.6;
  filter: blur(8px);
}

/* Telegram App Container */
.telegram-app {
  width: 100%;
  height: 100%;
  background: #0e1621;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Telegram Header */
.telegram-header {
  background: #17212b;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.telegram-header .chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #62ff00, #00ff88);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #000;
  font-size: 18px;
}

.telegram-header .chat-info h3 {
  margin: 0;
  font-size: 15px;
  color: #fff;
  font-weight: 600;
}

.telegram-header .chat-info p {
  margin: 0;
  font-size: 12px;
  color: #707579;
}

/* Chat Messages */
.telegram-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #0e1621;
}

.telegram-messages::-webkit-scrollbar {
  width: 6px;
}

.telegram-messages::-webkit-scrollbar-thumb {
  background: rgba(98, 255, 0, 0.3);
  border-radius: 3px;
}

/* Message Bubble */
.message {
  display: flex;
  gap: 10px;
  opacity: 1;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.user {
  flex-direction: row-reverse;
}

.message .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.message.client .avatar {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

.message.agent .avatar {
  background: linear-gradient(135deg, #62ff00, #00ff88);
  color: #000;
}

.message.user .avatar {
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: #fff;
}

.message .bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  position: relative;
}

.message.client .bubble {
  background: #182533;
  color: #e5e5ea;
}

.message.agent .bubble {
  background: linear-gradient(
    135deg,
    rgba(98, 255, 0, 0.15),
    rgba(0, 255, 136, 0.15)
  );
  border: 1px solid rgba(98, 255, 0, 0.3);
  color: #e5e5ea;
}

.message.user .bubble {
  background: #2b5278;
  color: #fff;
}

.message .bubble .name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  opacity: 0.9;
}

.message.client .bubble .name {
  color: #8774e1;
}

.message.agent .bubble .name {
  color: #62ff00;
}

.message .bubble .text {
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 4px;
}

.message .bubble .link {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 12px;
  background: rgba(98, 255, 0, 0.2);
  border: 1px solid rgba(98, 255, 0, 0.4);
  border-radius: 8px;
  color: #62ff00;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.3s;
}

.message .bubble .link:hover {
  background: rgba(98, 255, 0, 0.3);
  transform: translateY(-2px);
}

.message .bubble .time {
  font-size: 11px;
  color: #707579;
  text-align: right;
  margin-top: 4px;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  background: #182533;
  border-radius: 12px;
  max-width: fit-content;
}

.typing-indicator .dots {
  display: flex;
  gap: 4px;
}

.typing-indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #62ff00;
  animation: typingDot 1.4s infinite;
}

.typing-indicator .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingDot {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Scenario Switcher */
.scenario-switcher {
  position: absolute;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.scenario-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.scenario-btn.active {
  background: #62ff00;
  box-shadow: 0 0 15px rgba(98, 255, 0, 0.6);
  width: 30px;
  border-radius: 6px;
}

/* Responsive */
@media (max-width: 1400px) {
  .telegram-tablet-wrapper {
    right: 2%;
  }

  .telegram-tablet {
    width: 380px;
    height: 520px;
  }
}

@media (max-width: 1200px) {
  .telegram-tablet-wrapper {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    margin: 40px auto;
  }

  .telegram-tablet {
    transform: none;
    animation: none;
  }

  .telegram-tablet:hover {
    transform: scale(1.02);
  }
}

@media (max-width: 768px) {
  .telegram-tablet-wrapper {
    position: fixed;
    right: 5px;
    top: 80px;
    z-index: 1000;
  }

  .telegram-tablet {
    width: 250px;
    height: 350px;
  }

  .telegram-tablet::before,
  .telegram-tablet::after {
    display: none;
  }

  .telegram-header {
    padding: 10px 12px;
  }

  .telegram-header .chat-avatar {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .telegram-header .chat-info h3 {
    font-size: 12px;
  }

  .telegram-header .chat-info p {
    font-size: 10px;
  }

  .telegram-messages {
    padding: 12px;
    gap: 8px;
  }

  .message .avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .message .bubble {
    max-width: 75%;
    padding: 6px 10px;
  }

  .message .bubble .name {
    font-size: 11px;
  }

  .message .bubble .text {
    font-size: 12px;
  }

  .message .bubble .time {
    font-size: 9px;
  }

  .scenario-switcher {
    bottom: -40px;
  }

  .scenario-btn {
    width: 8px;
    height: 8px;
  }

  .scenario-btn.active {
    width: 20px;
  }
}
