/**
 * MistralChat Pro - Feuille de style
 * Design moderne avec effet glassmorphique
 */

:root {
    --primary-color: #1A1A2E;
    --secondary-color: #16213E;
    --accent-color: #0F3460;
    --highlight-color: #E94560;
    --text-color: #F1F5F9;
    --border-color: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo i {
    font-size: 24px;
    color: var(--highlight-color);
    margin-right: 10px;
}

h1 {
    margin: 0;
    font-size: 24px;
    background: linear-gradient(45deg, #E94560, #0F3460);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.main-content {
    display: flex;
    flex: 1;
    gap: 20px;
}

.chat-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.keywords-column {
    width: 300px;
    background: rgba(16, 23, 42, 0.4);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.keywords-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.keywords-title {
    font-size: 16px;
    font-weight: 600;
}

.keywords-count {
    background: rgba(233, 69, 96, 0.2);
    color: var(--highlight-color);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.keywords-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    align-content: flex-start;
    overflow-y: auto;
}

.keyword-tag {
    background: rgba(15, 52, 96, 0.6);
    border: 1px solid rgba(233, 69, 96, 0.3);
    color: var(--text-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.keyword-tag:hover {
    background: rgba(233, 69, 96, 0.3);
    transform: translateY(-2px);
}

.keyword-tag .count {
    margin-left: 5px;
    background: rgba(233, 69, 96, 0.3);
    color: var(--text-color);
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
}

.chat-container {
    flex: 1;
    background: rgba(16, 23, 42, 0.4);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.welcome-message {
    text-align: center;
    margin: auto;
    max-width: 600px;
}

.welcome-message i {
    font-size: 48px;
    color: var(--highlight-color);
    margin-bottom: 20px;
}

.welcome-message h2 {
    margin-bottom: 15px;
    font-size: 24px;
    background: linear-gradient(45deg, #E94560, #0F3460);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.welcome-message p {
    margin-bottom: 20px;
    opacity: 0.8;
    line-height: 1.6;
}

.message {
    display: flex;
    max-width: 80%;
}

.message.user {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message.assistant {
    margin-right: auto;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.message.user .message-avatar {
    margin-right: 0;
    margin-left: 12px;
    background-color: var(--accent-color);
}

.message.assistant .message-avatar {
    background-color: var(--highlight-color);
}

.message-content {
    background: rgba(22, 33, 62, 0.7);
    padding: 12px 16px;
    border-radius: 18px;
    max-width: calc(100% - 48px);
}

.message.user .message-content {
    background: rgba(15, 52, 96, 0.7);
    border-top-right-radius: 4px;
}

.message.assistant .message-content {
    background: rgba(22, 33, 62, 0.7);
    border-top-left-radius: 4px;
}

.message-bubble {
    line-height: 1.5;
}

.extracted-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.extracted-keyword {
    background: rgba(233, 69, 96, 0.2);
    color: var(--highlight-color);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    display: flex;
    align-items: center;
}

.extracted-keyword i {
    margin-right: 4px;
    font-size: 10px;
}

.input-container {
    background: rgba(16, 23, 42, 0.4);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    gap: 10px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.message-input {
    flex: 1;
    background: rgba(22, 33, 62, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-color);
    resize: none;
    outline: none;
    transition: border-color 0.3s ease;
    min-height: 20px;
    max-height: 150px;
}

.message-input:focus {
    border-color: var(--highlight-color);
}

.send-button {
    background: var(--highlight-color);
    color: white;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-end;
}

.send-button:hover {
    background: #d13151;
    transform: translateY(-2px);
}

.send-button:disabled {
    background: #4a4a6a;
    cursor: not-allowed;
    transform: none;
}

.typing-indicator {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    color: #9ca3af;
}

.typing-indicator .dots {
    display: flex;
    margin-left: 8px;
}

.typing-indicator .dot {
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background-color: #9ca3af;
    border-radius: 50%;
    animation: typing 1.5s infinite ease-in-out;
}

.typing-indicator .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.api-key-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--secondary-color);
    border-radius: 12px;
    padding: 25px;
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--border-color);
}

.modal-header {
    margin-bottom: 20px;
    text-align: center;
}

.modal-header h2 {
    margin-bottom: 10px;
    color: var(--highlight-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    background: rgba(16, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: var(--highlight-color);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
}

.modal-button {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.primary-button {
    background: var(--highlight-color);
    color: white;
}

.primary-button:hover {
    background: #d13151;
    transform: translateY(-2px);
}

footer {
    text-align: center;
    padding: 20px;
    font-size: 0.8em;
    opacity: 0.7;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .keywords-column {
        width: 100%;
        margin-bottom: 20px;
        order: -1;
    }
    
    .message {
        max-width: 90%;
    }
}
