/* chat.css - Styles spécifiques à l'interface de chat */

/* Layout général */
.chat-page {
    background: linear-gradient(135deg, #f5f7fa, #e4e8f0);
    min-height: 100vh;
}

.chat-container {
    display: flex;
    height: calc(100vh);
    /* margin-top: 80px; */
    position: relative;
    align-items: center;
}

/* Sidebar styles */
.chat-sidebar {
    height: 90%;
    width: 280px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.glass-sidebar {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 0 15px 15px 0;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-logo {
    height: 30px;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.sidebar-btn.primary {
    background: var(--gradient);
    color: white;
}

.sidebar-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.sidebar-btn.primary:hover {
    background: linear-gradient(135deg, #0c0d5a, #4fa6d1);
}

.conversations-list {
    flex-grow: 1;
    overflow-y: auto;
    margin: 20px 0;
}

.conversations-list h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.conversation-item {
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: var(--transition);
}

.conversation-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.conversation-item.active {
    background: rgba(74, 0, 224, 0.1);
    color: var(--primary-color);
    font-weight: 500;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Chat main area */
.chat-main {
    height: 100vh;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    display: none;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.online {
    background: #4CAF50;
}

.status-dot.typing {
    background: #FFC107;
}

.status-dot.offline {
    background: #F44336;
}

.messages-container {
    flex-grow: 1;
    padding: 20px 30px;
    overflow-y: auto;
    scroll-behavior: smooth;
    background-color: rgba(255, 255, 255, 0.6);
}

/* Messages styles */
.message {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.user-message .message-avatar {
    background: var(--accent-color);
}

.message-content {
    flex-grow: 1;
    max-width: calc(100% - 70px);
}

.message-text {
    padding: 15px;
    border-radius: 15px;
    position: relative;
    line-height: 1.5;
}

.ai-message .message-text {
    background: white;
    border-top-left-radius: 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.user-message .message-text {
    background: var(--primary-color);
    color: white;
    border-top-right-radius: 0;
}

.message-text p {
    margin-bottom: 0;
}

.message-text pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
}

.message-text code {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.9em;
}

.user-message .message-text code {
    background: rgba(255, 255, 255, 0.2);
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 5px;
    margin-left: 15px;
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-message .message-time {
    color: rgba(255, 255, 255, 0.7);
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 15px;
    background: white;
    border-radius: 15px;
    border-top-left-radius: 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-light);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes typingAnimation {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Input area */
.input-container {
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.7);
}

.glass-input {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.input-wrapper {
    flex-grow: 1;
    position: relative;
}

.input-container textarea {
    width: 100%;
    border: none;
    background: white;
    border-radius: 20px;
    padding: 12px 20px;
    font-family: 'Poppins', sans-serif;
    resize: none;
    max-height: 120px;
    height: 45px;
    overflow-y: auto;
    margin-bottom: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.input-container textarea:focus {
    outline: none;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.input-hints {
    display: none;
}

.attachment-btn, .send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: white;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.send-btn {
    background: var(--gradient);
    color: white;
}

.attachment-btn:hover, .send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.glass-modal {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .glass-modal {
    transform: translateY(0);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px;
}

.setting-option {
    margin-bottom: 20px;
}

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

.setting-option select, .setting-option input[type="text"] {
    width: 100%;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-family: 'Poppins', sans-serif;
    background: white;
}

.setting-option input[type="checkbox"] {
    margin-right: 10px;
}

.danger-btn {
    background: #F44336;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    cursor: pointer;
    transition: var(--transition);
}

.danger-btn:hover {
    background: #D32F2F;
    transform: translateY(-2px);
}

/* Responsive design */
@media (max-width: 992px) {
    .chat-sidebar {
        position: fixed;
        left: -280px;
        top: 80px;
        bottom: 0;
        z-index: 900;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    }
    
    .chat-sidebar.active {
        left: 0;
    }
    
    .chat-main {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
}

@media (max-width: 768px) {
    .chat-header {
        padding: 15px;
    }
    
    .messages-container {
        padding: 15px;
    }
    
    .input-container {
        padding: 10px 15px;
    }
    
    .message {
        gap: 10px;
    }
    
    .message-avatar {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .message-content {
        max-width: calc(100% - 55px);
    }
    
    .message-text {
        padding: 10px;
    }
}

@media (max-width: 576px) {
    .chat-header h1 {
        font-size: 1.2rem;
    }
    
    .chat-status span {
        display: none;
    }
    
    .input-hints {
        display: none;
    }
}