/* =============================================
   CARNET CATALAN AI — Homepage Widget
   ============================================= */

#cc-ai-widget {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 640px;
    z-index: 99999;
}

#cc-ai-widget-inner {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 50px;
    padding: 6px 6px 6px 20px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    gap: 10px;
    transition: box-shadow 0.25s;
}

#cc-ai-widget-inner:focus-within {
    box-shadow: 0 8px 50px rgba(192, 57, 43, 0.25);
}

#cc-ai-widget-icon {
    font-size: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

#cc-ai-widget-field {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    min-height: 44px;
}

#cc-ai-widget-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    color: #222;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 0;
    position: relative;
    z-index: 2;
}

/* Placeholder animé */
#cc-ai-typewriter {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 16px;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    z-index: 1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Curseur clignotant */
#cc-ai-typewriter::after {
    content: '|';
    animation: cc-blink 0.7s infinite;
    opacity: 1;
    color: #c0392b;
    font-weight: 300;
}

@keyframes cc-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* Bouton envoyer */
#cc-ai-widget-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 10px rgba(192, 57, 43, 0.4);
}

#cc-ai-widget-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(192, 57, 43, 0.5);
}

#cc-ai-widget-btn:active {
    transform: scale(0.95);
}

/* Responsive */
@media (max-width: 480px) {
    #cc-ai-widget-input,
    #cc-ai-typewriter { font-size: 14px; }
    #cc-ai-widget-inner { padding: 5px 5px 5px 16px; }
}
