/* idealgpt-widget.css - Version du Plugin 1.0.0
* (c) 2025 Agence de communication Idealcom | Lausanne | Suisse
* https://www.idealcom.ch
*/ 
/* (c) 2025 Agence de communication Idealcom | Lausanne | Suisse
* https://www.idealcom.ch
* Proprietary - Usage, copying, modification or redistribution
* without explicit permission is prohibited. */

:root {
    --idealgpt-primary-rgb: 90 27 143; /* Couleur par défaut, sera écrasée par le plugin */
    --idealgpt-primary: rgb(var(--idealgpt-primary-rgb));
    --idealgpt-secondary: #4a1578;
    --idealgpt-secondary: color-mix(in srgb, var(--idealgpt-primary), black 18%);
    --idealgpt-success: #28a745;
    --idealgpt-error: #dc3545;
    --idealgpt-text: #333333;
    --idealgpt-light: #f7f8fa;
    --idealgpt-border: #e0e0e0;
    --idealgpt-shadow: 0 12px 40px rgba(0,0,0,0.15);
    --idealgpt-radius: 16px;
    --idealgpt-transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    --idealgpt-offset-left: 30px;
    --idealgpt-offset-bottom: 20px;
    --visual-viewport-height: 100vh;
    --scrollbar-width: 0px;
}
*, *::before, *::after { box-sizing: border-box; }
body.igpt-body-lock { overflow: hidden; }
#idealgpt-widget, #idealgpt-widget * { font-weight: 400; -webkit-tap-highlight-color: transparent; overscroll-behavior: contain; }
#idealgpt-widget { position: fixed; left: var(--idealgpt-offset-left); bottom: var(--idealgpt-offset-bottom); z-index: 2147483647 !important; pointer-events: none; }
.igpt-window { display: flex; flex-direction: column; position: fixed; top: 0; left: 0; width: 100%; height: var(--visual-viewport-height); height: 100dvh; background: white; border-radius: 0; box-shadow: var(--idealgpt-shadow); overflow: hidden; opacity: 0; transform: translateY(20px); transition: var(--idealgpt-transition); pointer-events: none; z-index: 1; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.igpt-window.igpt-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
#idealgpt-widget .igpt-bubble { position: fixed; left: var(--idealgpt-offset-left); bottom: var(--idealgpt-offset-bottom); width: 60px; height: 60px; background: linear-gradient(135deg, var(--idealgpt-primary), var(--idealgpt-secondary)); border-radius: 50%; box-shadow: var(--idealgpt-shadow); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--idealgpt-transition); pointer-events: auto; z-index: 2; animation: igpt-pulse 2s infinite; }
#idealgpt-widget .igpt-bubble:hover { transform: scale(1.1); box-shadow: 0 16px 50px rgba(0,0,0,0.2); }
body.igpt-active #idealgpt-widget .igpt-bubble { opacity: 0 !important; pointer-events: none !important; transform: scale(0.8) !important; }
body.igpt-active iframe[title="chat widget"] { display: none !important; }
.ios #idealgpt-widget .igpt-bubble { bottom: calc(var(--idealgpt-offset-bottom) + env(safe-area-inset-bottom)) !important; }
.igpt-header { background: linear-gradient(135deg, var(--idealgpt-primary), var(--idealgpt-secondary)); color: white; padding: 16px; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; position: relative; z-index: 2; }
.igpt-profile { display: flex; align-items: center; gap: 12px; }
.igpt-header .igpt-avatar { width: 36px; height: 36px; }
.igpt-header .igpt-avatar svg { width: 22px; height: 22px; }
#idealgpt-widget .igpt-info h3 { color: #ffffff; font-size: 16px; line-height: 1.2; margin: 0; font-weight: 500; }
.igpt-status { font-size: 8px; opacity: 0.9; display: flex; align-items: center; gap: 6px; }
.igpt-status-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--idealgpt-success); animation: igpt-blink 1.5s infinite; }
.igpt-controls { display: flex; gap: 8px; }
.igpt-btn { background: rgba(255,255,255,0.2); border: none; color: white; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--idealgpt-transition); font-size: 14px; }
.igpt-btn:hover { background: rgba(255,255,255,0.3); transform: scale(1.05); }
#idealgpt-widget #igpt-fullscreen, #idealgpt-widget #igpt-minimize { display: none !important; }
.igpt-avatar, .igpt-bubble-icon, .igpt-message-avatar { display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 50%; background: var(--idealgpt-primary); overflow: hidden; }
.igpt-avatar svg, .igpt-bubble-icon svg, .igpt-message-avatar svg { width: 30px; height: auto; fill: currentColor; }
.igpt-avatar, .igpt-bubble-icon { color: white; }
.igpt-message-avatar { width: 15px; color: var(--idealgpt-primary); background: none !important; border-radius: 0 !important; }
.igpt-message-avatar svg { width: 100%; }
.igpt-messages { flex: 1; min-height: 0; padding: 16px; background: var(--idealgpt-light); overflow-y: auto; -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
.igpt-message { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; animation: igpt-message-in 0.3s ease-out; }
.igpt-message.igpt-user { flex-direction: row-reverse; }
.igpt-message-bubble { max-width: 75%; padding: 12px 16px; border-radius: 18px; word-wrap: break-word; line-height: 1.4;font-size: 14px; }
.igpt-message.igpt-bot .igpt-message-bubble { background: white; color: var(--idealgpt-text); border: 1px solid var(--idealgpt-border); border-bottom-left-radius: 6px; }
.igpt-message.igpt-user .igpt-message-bubble { background: var(--idealgpt-primary); color: white; border-bottom-right-radius: 6px; padding: 8px 16px; }
.igpt-typing { display: none; align-items: center; gap: 6px; padding: 0; background: none; border: none; }
.igpt-typing.igpt-show { display: flex; animation: igpt-fade-in 0.3s ease-out; }
.igpt-typing span {font-size: 0.60em!important; /* 60% de la police de base */ opacity: 0.9;}
.igpt-dots { display: flex; gap: 4px; }
.igpt-dot { width: 8px; height: 8px; background: var(--idealgpt-secondary); border-radius: 50%; animation: igpt-dot-bounce 1.4s infinite ease-in-out; }
.igpt-dot:nth-child(1) { animation-delay: -0.32s; }
.igpt-dot:nth-child(2) { animation-delay: -0.16s; }
.igpt-input-area { display: flex; align-items: center; gap: 8px; padding: 16px 16px 5px 16px; background: white; border-top: 1px solid var(--idealgpt-border); flex-shrink: 0; position: relative; z-index: 2; }
.igpt-input-wrapper { flex: 1; min-width: 0; }
.igpt-input { width: 100%; min-height: 48px; line-height: 1.3; max-height: 88px; padding: 12px 16px; border: 2px solid var(--idealgpt-border); border-radius: 12px; background: var(--idealgpt-light); font-size: 16px; resize: none; outline: none; }
.igpt-input:focus { border-color: var(--idealgpt-primary); background: white; }
.igpt-send-btn { width: 48px; height: 48px; border: none; border-radius: 12px; background: var(--idealgpt-primary); color: white; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; flex-shrink: 0; }
.igpt-send-btn:hover:not(:disabled) { background: var(--idealgpt-secondary); transform: scale(1.05); }
.igpt-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.igpt-footer { text-align: center; padding: 0 16px 12px; margin-top: 0px; flex-shrink: 0; position: relative; z-index: 2; }
.igpt-footer-line1, .igpt-footer-line2 { color: rgb(73, 73, 73); text-align: center; }
.igpt-footer-line1 { font-size: 0.57rem; margin-bottom: 4px; font-weight: 400; }
.igpt-footer-line2 { font-size: 0.51rem; line-height: 1.48; opacity: 0.85; }
@keyframes igpt-pulse { 0%, 100% { box-shadow: var(--idealgpt-shadow), 0 0 0 0 rgb(from var(--idealgpt-secondary) r g b / 0.7); } 50% { box-shadow: var(--idealgpt-shadow), 0 0 0 10px rgb(from var(--idealgpt-secondary) r g b / 0); } }
@keyframes igpt-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes igpt-message-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes igpt-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes igpt-dot-bounce { 0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; } 40% { transform: scale(1.2); opacity: 1; } }
.igpt-messages::-webkit-scrollbar { width: 6px; }
.igpt-messages::-webkit-scrollbar-track { background: transparent; }
.igpt-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 3px; }
@media (min-width: 769px) {
  #idealgpt-widget .igpt-window { width: 350px; height: auto; min-height: 200px; max-height: 80vh; position: fixed; top: auto; left: var(--idealgpt-offset-left); bottom: calc(var(--idealgpt-offset-bottom) + 85px); border-radius: var(--idealgpt-radius); padding: 0; }
  #idealgpt-widget .igpt-window.igpt-fullscreen { width: 100%; height: 100vh; top: 0; left: 0; bottom: 0; border-radius: 0; max-height: 100vh; }
  body.igpt-active #idealgpt-widget .igpt-bubble { opacity: 1 !important; pointer-events: auto !important; transform: scale(1) !important; }
  #idealgpt-widget #igpt-fullscreen { display: flex !important; }
  .igpt-message-bubble { max-width: 280px; }
  body.igpt-body-lock { padding-right: var(--scrollbar-width); }
}