@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300&family=Jost:wght@300;400;500&display=swap');

:root {
  --gold-1:   #8b6f1f;
  --gold-2:   #a67c00;
  --gold-3:   #ceccc7;
  --gold-4:   #f5e1a1;
  --gold-5:   #c9a961;
  --gold-6:   #b8860b;
  --gold-grad: linear-gradient(39deg, #8b6f1f 0%, #a67c00 20%, #ceccc7 40%, #f5e1a1 50%, #c9a961 60%, #b8860b 80%, #8b6f1f 100%);

  --chat-bg:       #0e0c0a;
  --chat-surface:  #181410;
  --chat-border:   rgba(197, 168, 97, 0.2);
  --chat-radius:   18px;
  --chat-width:    360px;
  --chat-height:   520px;
  --font-display:  'Cormorant Garamond', serif;
  --font-body:     'Jost', sans-serif;
}

/* Bubble */
#dienis-chat-bubble {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--gold-grad);
  background-size: 200% 200%;
  border: none;
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(139, 111, 31, 0.45);
  animation: gradientShift 4s ease infinite, bubblePulse 3s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#dienis-chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 32px rgba(197, 168, 97, 0.6);
}

#dienis-chat-bubble svg {
  width: 26px;
  height: 26px;
  fill: #0e0c0a;
  transition: transform 0.3s ease;
}

#dienis-chat-bubble.open svg {
  transform: rotate(90deg);
}

/* Notification dot */
#dienis-chat-bubble::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 10px;
  height: 10px;
  background: #f5e1a1;
  border-radius: 50%;
  border: 2px solid #0e0c0a;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#dienis-chat-bubble.has-notification::after {
  opacity: 1;
}

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

@keyframes bubblePulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(139, 111, 31, 0.45); }
  50%       { box-shadow: 0 4px 36px rgba(197, 168, 97, 0.65); }
}

/* Window */
#dienis-chat-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: var(--chat-width);
  height: var(--chat-height);
  background: var(--chat-bg);
  border: 1px solid var(--chat-border);
  border-radius: var(--chat-radius);
  display: flex;
  flex-direction: column;
  z-index: 9998;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(197,168,97,0.08);
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.25s ease;
}

#dienis-chat-window.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* Header */
#dienis-chat-header {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--chat-border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--chat-surface);
  position: relative;
  overflow: hidden;
}

#dienis-chat-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gold-grad);
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}

.dienis-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gold-grad);
  background-size: 200%;
  animation: gradientShift 4s ease infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 16px;
  color: #0e0c0a;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.dienis-header-info {
  flex: 1;
}

.dienis-header-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: #f5e1a1;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.dienis-header-status {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 300;
  color: var(--gold-5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.dienis-header-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7ecb8f;
  display: inline-block;
  box-shadow: 0 0 6px #7ecb8f;
}

#dienis-chat-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gold-5);
  opacity: 0.6;
  transition: opacity 0.2s;
  padding: 4px;
  display: flex;
  align-items: center;
}

#dienis-chat-close:hover { opacity: 1; }

/* Messages */
#dienis-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

#dienis-chat-messages::-webkit-scrollbar { width: 4px; }
#dienis-chat-messages::-webkit-scrollbar-track { background: transparent; }
#dienis-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(197, 168, 97, 0.25);
  border-radius: 2px;
}

.dienis-msg {
  max-width: 82%;
  animation: msgIn 0.25s ease;
}

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

.dienis-msg-bot {
  align-self: flex-start;
}

.dienis-msg-user {
  align-self: flex-end;
}

.dienis-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

.dienis-msg-bot .dienis-msg-bubble {
  background: var(--chat-surface);
  border: 1px solid var(--chat-border);
  color: #e8dcc8;
  border-bottom-left-radius: 4px;
}

.dienis-msg-user .dienis-msg-bubble {
  background: linear-gradient(135deg, #8b6f1f, #b8860b);
  color: #0e0c0a;
  font-weight: 400;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.dienis-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 14px;
  background: var(--chat-surface);
  border: 1px solid var(--chat-border);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.dienis-typing span {
  width: 6px;
  height: 6px;
  background: var(--gold-5);
  border-radius: 50%;
  animation: typingDot 1.2s ease-in-out infinite;
}

.dienis-typing span:nth-child(2) { animation-delay: 0.2s; }
.dienis-typing span:nth-child(3) { animation-delay: 0.4s; }

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

/* ── Input area ──────────────────────────────────────────── */
#dienis-chat-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--chat-border);
  background: var(--chat-surface);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

#dienis-chat-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--chat-border);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 300;
  color: #e8dcc8;
  resize: none;
  outline: none;
  max-height: 100px;
  min-height: 40px;
  line-height: 1.5;
  transition: border-color 0.2s ease;
}

#dienis-chat-input::placeholder {
  color: rgba(197, 168, 97, 0.35);
  letter-spacing: 0.03em;
}

#dienis-chat-input:focus {
  border-color: rgba(197, 168, 97, 0.5);
}

#dienis-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--gold-grad);
  background-size: 200%;
  animation: gradientShift 4s ease infinite;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

#dienis-chat-send:hover  { transform: scale(1.05); }
#dienis-chat-send:active { transform: scale(0.95); }
#dienis-chat-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

#dienis-chat-send svg {
  width: 17px;
  height: 17px;
  fill: #0e0c0a;
}

/* Mobile */
@media (max-width: 480px) {
  #dienis-chat-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 85dvh;
    border-radius: var(--chat-radius) var(--chat-radius) 0 0;
  }

  #dienis-chat-bubble {
    bottom: 20px;
    right: 20px;
  }
}