/**
 * Freelance Matcher - Chat Form Styles
 * 
 * @package FreelanceMatcher
 * @version 1.0.7
 */

.fm-chat-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.06);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.fm-chat-header {
    text-align: center;
    margin-bottom: 30px;
}

.fm-chat-title {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
}

.fm-chat-subtitle {
    margin: 0;
    font-size: 16px;
    color: #666;
}

.fm-chat-form {
    margin-bottom: 25px;
}

.fm-chat-input-wrapper {
    margin-bottom: 15px;
}

.fm-chat-input {
    width: 100%;
    max-width: 100%;
    padding: 15px;
    font-size: 16px;
    line-height: 1.5;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    box-sizing: border-box;
    display: block;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.fm-chat-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.fm-char-counter {
    text-align: right;
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

.fm-char-counter.warning {
    color: #d63638;
    font-weight: 600;
}

.fm-chat-submit {
    width: 100%;
    padding: 15px 30px;
    font-size: 17px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #2271b1 0%, #1a5a8a 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.fm-chat-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #1a5a8a 0%, #135075 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(34, 113, 177, 0.3);
}

.fm-chat-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.fm-spinner {
    animation: rotate 2s linear infinite;
    width: 20px;
    height: 20px;
}

.fm-spinner .path {
    stroke: #ffffff;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.fm-chat-response {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #00a32a;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

.fm-response-header {
    margin-bottom: 12px;
    font-size: 15px;
    color: #00a32a;
}

.fm-response-content {
    font-size: 16px;
    line-height: 1.7;
    color: #1a1a1a;
    word-wrap: break-word;
}

/* Styles pour le contenu markdown */
.fm-response-content p {
    margin: 0 0 12px 0;
}

.fm-response-content p:last-child {
    margin-bottom: 0;
}

.fm-response-content strong {
    font-weight: 700;
    color: #000;
}

.fm-response-content em {
    font-style: italic;
}

.fm-response-content code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-size: 14px;
    color: #d63638;
}

.fm-response-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 15px 0;
}

.fm-response-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: 14px;
}

.fm-response-content ul,
.fm-response-content ol {
    margin: 12px 0;
    padding-left: 25px;
}

.fm-response-content li {
    margin: 6px 0;
}

.fm-response-content h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 20px 0 12px 0;
    color: #1a1a1a;
}

.fm-response-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 18px 0 10px 0;
    color: #1a1a1a;
}

.fm-response-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 16px 0 8px 0;
    color: #1a1a1a;
}

.fm-response-content a {
    color: #2271b1;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.fm-response-content a:hover {
    border-bottom-color: #2271b1;
}

.fm-response-content.streaming::after {
    content: '▊';
    animation: blink 1s infinite;
    margin-left: 2px;
}

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

.fm-response-meta {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 13px;
}

.fm-chat-error {
    padding: 15px 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-left: 4px solid #ff9800;
    border-radius: 8px;
    color: #856404;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

.fm-chat-error strong {
    display: block;
    margin-bottom: 5px;
    color: #d63638;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .fm-chat-container {
        padding: 20px;
        margin: 20px 15px;
    }
    
    .fm-chat-title {
        font-size: 24px;
    }
    
}
