/* =========================================
   PETROSOFT AI CHATBOT
========================================= */

.ps-chatbot-wrapper{

  position:fixed;

  right:20px;
  bottom:20px;

  z-index:999999;

  font-family:'Inter',sans-serif;

}

/* =========================================
   FLOATING BUTTON
========================================= */

.ps-chat-toggle{

  width:62px;
  height:62px;

  border:none;

  border-radius:18px;

  cursor:pointer;

  background:
  linear-gradient(
    135deg,
    #2563eb 0%,
    #06b6d4 100%
  );

  color:#fff;

  display:flex;
  align-items:center;
  justify-content:center;

  position:relative;

  overflow:hidden;

  transition:.3s ease;

  box-shadow:
    0 15px 40px rgba(37,99,235,.28);

}

.ps-chat-toggle:hover{

  transform:
    translateY(-4px)
    scale(1.03);

}

.ps-chat-toggle svg{

  position:relative;
  z-index:2;

}

/* PULSE */

.ps-pulse{

  position:absolute;

  inset:0;

  border-radius:18px;

  background:
    rgba(37,99,235,.25);

  animation:psPulse 2s infinite;

}

@keyframes psPulse{

  0%{

    transform:scale(1);

    opacity:.5;

  }

  70%{

    transform:scale(1.4);

    opacity:0;

  }

  100%{

    opacity:0;

  }

}

/* =========================================
   CHAT WINDOW
========================================= */

.ps-chat-container{

  width:340px;
  height:560px;

  background:#fff;

  border-radius:24px;

  overflow:hidden;

  display:none;

  flex-direction:column;

  margin-bottom:14px;

  border:
    1px solid #e5e7eb;

  box-shadow:
    0 25px 70px rgba(0,0,0,.12);

  animation:psOpen .25s ease;

}

@keyframes psOpen{

  from{

    opacity:0;

    transform:
      translateY(20px)
      scale(.96);

  }

  to{

    opacity:1;

    transform:
      translateY(0)
      scale(1);

  }

}

/* =========================================
   HEADER
========================================= */

.ps-chat-header{

  padding:16px 18px;

  background:
  linear-gradient(
    135deg,
    #0f172a 0%,
    #2563eb 100%
  );

  color:#fff;

  display:flex;

  align-items:center;

  justify-content:space-between;

}

.ps-header-content{

  display:flex;

  align-items:center;

  gap:12px;

}

/* AVATAR */

.ps-avatar{

  width:44px;
  height:44px;

  border-radius:14px;

  overflow:hidden;

  background:#fff;

  flex-shrink:0;

}

.ps-avatar img{

  width:100%;
  height:100%;

  object-fit:cover;

}

/* TEXT */

.ps-chat-header h3{

  margin:0;

  font-size:17px;

  font-weight:800;

  line-height:1.2;

}

.ps-chat-header p{

  margin:2px 0 0;

  font-size:11px;

  opacity:.85;

}

/* CLOSE */

#psChatClose{

  width:34px;
  height:34px;

  border:none;

  border-radius:10px;

  background:
    rgba(255,255,255,.12);

  color:#fff;

  cursor:pointer;

  transition:.25s ease;

}

#psChatClose:hover{

  transform:rotate(90deg);

  background:
    rgba(255,255,255,.2);

}

/* =========================================
   BODY
========================================= */

.ps-chat-body{

  flex:1;

  overflow-y:auto;

  padding:14px;

  background:#f8fafc;

  scroll-behavior:smooth;

}

.ps-chat-body::-webkit-scrollbar{

  width:4px;

}

.ps-chat-body::-webkit-scrollbar-thumb{

  background:#cbd5e1;

  border-radius:20px;

}

/* =========================================
   CHAT BUBBLES
========================================= */

.ps-bot-message,
.ps-user-message{

  max-width:84%;

  padding:12px 14px;

  margin-bottom:10px;

  border-radius:16px;

  font-size:13px;

  line-height:1.5;

  animation:psMsg .2s ease;

}

@keyframes psMsg{

  from{

    opacity:0;

    transform:translateY(8px);

  }

  to{

    opacity:1;

    transform:translateY(0);

  }

}

/* BOT */

.ps-bot-message{

  background:#fff;

  color:#0f172a;

  border:
    1px solid #e5e7eb;

  border-bottom-left-radius:5px;

}

/* USER */

.ps-user-message{

  margin-left:auto;

  color:#fff;

  background:
  linear-gradient(
    135deg,
    #2563eb 0%,
    #06b6d4 100%
  );

  border-bottom-right-radius:5px;

}

/* =========================================
   OPTIONS GRID
========================================= */

.ps-chat-options{

  padding:14px;

  display:grid;

  grid-template-columns:1fr 1fr;

  gap:10px;

  background:#fff;

  border-top:
    1px solid #e5e7eb;

}

/* BUTTON */

.ps-option-btn{

  width:100%;

  height:64px;

  border:none;

  border-radius:14px;

  background:#eff6ff;

  color:#2563eb;

  font-size:12px;

  font-weight:700;

  text-align:center;

  line-height:1.4;

  cursor:pointer;

  transition:.25s ease;

  padding:10px;

}

.ps-option-btn:hover{

  background:
  linear-gradient(
    135deg,
    #2563eb 0%,
    #06b6d4 100%
  );

  color:#fff;

  transform:
    translateY(-2px);

}

/* =========================================
   TYPING
========================================= */

.ps-typing{

  width:max-content;

  display:flex;

  align-items:center;

  gap:4px;

  padding:12px 14px;

  background:#fff;

  border-radius:16px;

  margin-bottom:10px;

}

.ps-typing span{

  width:6px;
  height:6px;

  border-radius:50%;

  background:#2563eb;

  animation:psTyping 1.2s infinite;

}

.ps-typing span:nth-child(2){

  animation-delay:.2s;

}

.ps-typing span:nth-child(3){

  animation-delay:.4s;

}

@keyframes psTyping{

  0%,80%,100%{

    opacity:.3;

    transform:scale(.8);

  }

  40%{

    opacity:1;

    transform:scale(1);

  }

}

/* =========================================
   MOBILE
========================================= */

@media(max-width:768px){

  .ps-chatbot-wrapper{

    right:12px;
    bottom:12px;

  }

  .ps-chat-container{

    width:calc(100vw - 24px);

    height:72vh;

    border-radius:20px;

  }

  .ps-chat-toggle{

    width:56px;
    height:56px;

    border-radius:16px;

  }

  .ps-chat-options{

    grid-template-columns:1fr;

  }

  .ps-option-btn{

    height:56px;

    font-size:12px;

  }

}