/* Muriel AI Advisor - Modern Premium Glassmorphism UI */
:root {
  --ai-primary: #c5a059;
  --ai-accent: #c5a059;
  --ai-glass: rgba(255, 255, 255, 0.75);
  --ai-glass-dark: rgba(17, 17, 17, 0.85);
  --ai-shadow: 0 30px 60px rgba(0,0,0,0.12);
  --ai-border: rgba(0, 0, 0, 0.08);
  --ai-text: #111;
  --ai-message-ai: #111;
  --ai-message-user: #c5a059;
  --ai-bg-light: #ffffff;
  --ai-bg-dark: #111111;
}

[data-theme="dark"] {
  --ai-glass: rgba(17, 17, 17, 0.75);
  --ai-border: rgba(255, 255, 255, 0.1);
  --ai-text: #ffffff;
  --ai-message-ai: #ffffff;
  --ai-bg-light: #111111;
  --ai-bg-dark: #ffffff;
}

/* Floating Trigger */
.ai-advisor-trigger {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 64px;
  height: 64px;
  background: var(--ai-bg-dark);
  color: var(--ai-bg-light);
  border-radius: 50%;
  border: 1px solid var(--ai-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  z-index: 2100;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  animation: pulse-gold 3s infinite;
}

@keyframes pulse-gold {
  0% { box-shadow: 0 0 0 0 rgba(197, 160, 89, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(197, 160, 89, 0); }
  100% { box-shadow: 0 0 0 0 rgba(197, 160, 89, 0); }
}

.ai-advisor-trigger:hover {
  transform: scale(1.1);
  background: var(--ai-primary);
  color: #fff;
}

.ai-advisor-trigger svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

/* Chat Container */
.ai-advisor-container {
  position: fixed;
  bottom: 6.5rem;
  right: 2rem;
  width: 420px;
  max-width: calc(100vw - 4rem);
  height: 650px;
  max-height: calc(100vh - 12rem);
  background: var(--ai-glass);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--ai-border);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--ai-shadow);
  z-index: 2100;
  overflow: hidden;
  display: none; /* Controlled by JS */
  transform-origin: bottom right;
  animation: ai-container-reveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes ai-container-reveal {
  from { opacity: 0; transform: translateY(40px) scale(0.9) rotate(2deg); filter: blur(10px); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); filter: blur(0); }
}

/* Header UI - Moved inline styles here */
.ai-header {
  padding: 1.5rem 2rem;
  background: var(--ai-message-ai);
  color: var(--ai-bg-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--ai-border);
}

.ai-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-header-logo {
    height: 32px;
    filter: brightness(0) invert(1);
}

[data-theme="dark"] .ai-header-logo {
    filter: brightness(0);
}

.ai-header-tag {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    opacity: 0.8;
    text-transform: uppercase;
}

.ai-header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ai-reset-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: inherit;
    font-size: 0.6rem;
    padding: 4px 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    border-radius: 100px;
    transition: all 0.3s ease;
}

.ai-reset-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--ai-primary);
}

#ai-close {
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

#ai-close:hover {
    opacity: 1;
}

/* Chat Body */
.ai-chat-body {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  scrollbar-width: none;
}

.ai-chat-body::-webkit-scrollbar { display: none; }

/* Messages */
.message {
  max-width: 85%;
  padding: 1.25rem 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
  border-radius: 20px;
  position: relative;
  animation: message-reveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes message-reveal {
  from { opacity: 0; transform: translateY(20px) scale(0.95); filter: blur(5px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.message.ai {
  align-self: flex-start;
  background: var(--ai-bg-dark);
  color: var(--ai-bg-light);
  border-bottom-left-radius: 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.message.user {
  align-self: flex-end;
  background: var(--ai-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 10px 25px rgba(197, 160, 89, 0.2);
}

.message.system {
    align-self: center;
    background: rgba(0,0,0,0.05);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Input Area */
.ai-input-area {
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 1rem;
  border-top: 1px solid var(--ai-border);
  align-items: center;
}

.ai-input-wrapper {
  flex: 1;
  background: rgba(var(--bg-dark-rgb, 17, 17, 17), 0.05);
  border: 1px solid var(--ai-border);
  border-radius: 30px;
  padding: 0 1.5rem;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-input-wrapper:focus-within {
  border-color: var(--ai-primary);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 30px rgba(197, 160, 89, 0.1);
}

#ai-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--ai-text);
  font-size: 0.95rem;
  padding: 0.85rem 0;
  outline: none;
}

.ai-send-btn {
  background: var(--ai-message-ai);
  color: var(--ai-bg-light);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.ai-send-btn:hover {
  background: var(--ai-primary);
  color: #fff;
  transform: scale(1.05);
}

/* Thinking Indicator */
.typing {
  display: flex;
  gap: 6px;
  padding: 0.4rem 0.5rem;
}

.typing span {
  width: 6px;
  height: 6px;
  background: var(--ai-primary);
  border-radius: 50%;
  animation: typing-dot 1.5s infinite ease-in-out both;
}

.typing span:nth-child(1) { animation-delay: -0.32s; }
.typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-dot {
  0%, 80%, 100% { transform: scale(0.5); opacity: 0.4; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* Visual Cards */
.ai-visual-card {
    border-radius: 16px;
    background: var(--ai-bg-light) !important;
    border: 1px solid var(--ai-border) !important;
    overflow: hidden;
    margin-top: 1.5rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1) !important;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-visual-card img {
    width: 100%;
    display: block;
    aspect-ratio: 1;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.ai-visual-card:hover img {
    transform: scale(1.05);
}

.ai-card-label {
    padding: 1.25rem;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--text-primary);
    text-align: center;
    letter-spacing: 0.05em;
}

.ai-card-inquire-btn {
    width: 100%;
    padding: 1rem;
    background: var(--ai-primary);
    color: #fff;
    border: none;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.ai-card-inquire-btn:hover {
    background: var(--ai-bg-dark);
}

/* Scrollbar styling */
.ai-chat-body::-webkit-scrollbar {
    width: 3px;
}

.ai-chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.ai-chat-body::-webkit-scrollbar-thumb {
    background: rgba(197, 160, 89, 0.2);
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 500px) {
  .ai-advisor-container {
    bottom: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
  }
}

