/* ============================================================
   SportGPT – Widget CSS
   À inclure dans le template de La Centrale du Sport
   sportpourtous.center
   ============================================================ */

/* Bouton flottant */
#sportgpt-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    width: 52px;
    height: 52px;
    background: #030d06;
    border: 1px solid #00ff41;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 18px rgba(0,255,65,0.35);
    transition: box-shadow 0.2s, transform 0.15s;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: bold;
    color: #00ff41;
    letter-spacing: 0.5px;
    text-align: center;
    line-height: 1.2;
}
#sportgpt-fab:hover {
    box-shadow: 0 0 28px rgba(0,255,65,0.6);
    transform: scale(1.05);
}
#sportgpt-fab.open {
    background: #00ff41;
    color: #030d06;
}

/* Overlay fond */
#sportgpt-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9998;
}
#sportgpt-overlay.visible { display: block; }

/* Fenêtre principale */
#sportgpt-modal {
    display: none;
    position: fixed;
    bottom: 88px;
    right: 24px;
    width: 360px;
    max-height: 520px;
    z-index: 9999;
    background: #030d06;
    border: 1px solid #00ff41;
    box-shadow: 0 0 40px rgba(0,255,65,0.2), inset 0 0 40px rgba(0,255,65,0.02);
    display: none;
    flex-direction: column;
    font-family: 'Courier New', monospace;
    animation: sgpt-appear 0.18s ease;
}
#sportgpt-modal.visible {
    display: flex;
}
@keyframes sgpt-appear {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Scan line animée */
#sportgpt-modal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00ff41, transparent);
    animation: sgpt-scan 3s linear infinite;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}
@keyframes sgpt-scan {
    0%   { top: 0; }
    100% { top: 100%; }
}

/* Header */
#sportgpt-header {
    background: #001a0a;
    border-bottom: 1px solid #00ff41;
    padding: 9px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.sgpt-avatar {
    width: 30px; height: 30px;
    border: 1px solid #00ff41;
    border-radius: 50%;
    background: #001a0a;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: bold; color: #00ff41;
    flex-shrink: 0;
    position: relative;
}
.sgpt-avatar::after {
    content: '';
    position: absolute; bottom: 0; right: 0;
    width: 7px; height: 7px;
    background: #00ff41;
    border-radius: 50%;
    box-shadow: 0 0 5px #00ff41;
}
.sgpt-info { flex: 1; }
.sgpt-name  { font-size: 12px; font-weight: bold; letter-spacing: 2px; color: #00ff41; }
.sgpt-status { font-size: 9px; color: #008f24; letter-spacing: 1px; }
#sportgpt-close {
    background: transparent; border: none;
    color: #008f24; cursor: pointer; font-size: 16px;
    line-height: 1; padding: 2px 4px;
    transition: color 0.15s;
}
#sportgpt-close:hover { color: #00ff41; }

/* Zone messages */
#sportgpt-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex; flex-direction: column; gap: 10px;
    min-height: 240px;
    max-height: 280px;
    scroll-behavior: smooth;
}
#sportgpt-messages::-webkit-scrollbar { width: 3px; }
#sportgpt-messages::-webkit-scrollbar-track { background: #030d06; }
#sportgpt-messages::-webkit-scrollbar-thumb { background: #00ff41; }

.sgpt-msg { display: flex; gap: 7px; align-items: flex-start; }
.sgpt-msg.user { flex-direction: row-reverse; }
.sgpt-bubble {
    max-width: 84%;
    padding: 8px 11px;
    font-size: 12px; line-height: 1.6;
    border: 1px solid #00ff41;
    word-break: break-word;
}
.sgpt-msg.bot  .sgpt-bubble { background: #001a0a; color: #00ff41; border-radius: 0 7px 7px 7px; }
.sgpt-msg.user .sgpt-bubble { background: #002910; color: #00ff41; border-radius: 7px 0 7px 7px; }
.sgpt-icon {
    width: 22px; height: 22px; flex-shrink: 0;
    border: 1px solid #00ff41; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: bold; color: #00ff41;
    background: #001a0a; margin-top: 2px;
}
.sgpt-msg.user .sgpt-icon { background: #002910; }

/* Typing dots */
.sgpt-dots span {
    display: inline-block;
    width: 4px; height: 4px;
    background: #00ff41; border-radius: 50%;
    margin: 0 2px;
    animation: sgpt-blink 1.2s infinite;
}
.sgpt-dots span:nth-child(2) { animation-delay: 0.2s; }
.sgpt-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes sgpt-blink { 0%,80%,100%{opacity:0.2} 40%{opacity:1} }

/* Suggestions rapides */
#sportgpt-quick {
    padding: 6px 12px;
    display: flex; gap: 5px; flex-wrap: wrap;
    border-top: 1px solid rgba(0,255,65,0.15);
}
.sgpt-quick-btn {
    font-size: 9px; font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    background: #001a0a; color: #008f24;
    border: 1px solid #008f24;
    padding: 3px 8px; cursor: pointer;
    transition: all 0.15s;
}
.sgpt-quick-btn:hover { background: #002910; color: #00ff41; border-color: #00ff41; }

/* Zone saisie */
#sportgpt-input-area {
    border-top: 1px solid #00ff41;
    padding: 9px 12px;
    display: flex; gap: 7px; align-items: center;
    background: #001a0a;
    flex-shrink: 0;
}
.sgpt-prompt { color: #008f24; font-size: 12px; flex-shrink: 0; }
#sportgpt-input {
    flex: 1;
    background: transparent; border: none; outline: none;
    color: #00ff41;
    font-family: 'Courier New', monospace; font-size: 12px;
    caret-color: #00ff41;
}
#sportgpt-input::placeholder { color: #005918; }
#sportgpt-input:disabled { opacity: 0.4; }
#sportgpt-send {
    background: #001a0a; color: #00ff41;
    border: 1px solid #00ff41;
    padding: 5px 11px;
    font-family: 'Courier New', monospace;
    font-size: 11px; font-weight: bold;
    letter-spacing: 1px; cursor: pointer;
    transition: all 0.15s; flex-shrink: 0;
}
#sportgpt-send:hover:not(:disabled) { background: #00ff41; color: #030d06; }
#sportgpt-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* Footer quota */
#sportgpt-footer {
    border-top: 1px solid rgba(0,255,65,0.15);
    padding: 5px 12px;
    display: flex; justify-content: space-between; align-items: center;
    background: #030d06; flex-shrink: 0;
}
.sgpt-footer-l { font-size: 8px; color: #004d14; letter-spacing: 1px; }
.sgpt-footer-r { font-size: 8px; color: #004d14; }
.sgpt-quota-val { color: #008f24; font-weight: bold; }

/* Responsive mobile */
@media (max-width: 480px) {
    #sportgpt-modal {
        right: 10px; left: 10px;
        bottom: 80px;
        width: auto;
    }
    #sportgpt-fab { bottom: 16px; right: 16px; }
}
