@import url('style.css');

/* ===== TOPIC BUTTONS ===== */
.topic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.topic-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #1e293b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.topic-btn:hover {
    background: #f1f5f9;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.topic-btn i {
    font-size: 16px;
    color: var(--primary);
    width: 20px;
    text-align: center;
}

.topic-btn:active {
    transform: scale(0.98);
}

/* ===== HISTORY LIST ===== */
.history-list {
    padding: 4px 0;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.history-item:hover {
    background: #f8fafc;
}

.history-item.active {
    background: #eff6ff;
    border-left-color: var(--primary);
}

.history-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 16px;
    flex-shrink: 0;
}

.history-title {
    font-size: 13px;
    font-weight: 500;
    margin: 0;
    color: #1e293b;
}

.history-time {
    font-size: 11px;
    color: #94a3b8;
}

/* ===== LEGAL CHAT ===== */
.legal-chat {
    height: 480px;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #fafcff;
}

.legal-chat .message {
    display: flex;
    gap: 12px;
    max-width: 90%;
}

.legal-chat .message.bot {
    align-self: flex-start;
}

.legal-chat .message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.legal-chat .message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.legal-chat .message.bot .message-avatar {
    background: var(--primary);
    color: #fff;
}

.legal-chat .message.user .message-avatar {
    background: #e2e8f0;
    color: #64748b;
}

.legal-chat .message-bubble {
    padding: 14px 18px;
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
    position: relative;
    flex: 1;
}

.legal-chat .message.bot .message-bubble {
    border-top-left-radius: 4px;
    border: 1px solid #e2e8f0;
}

.legal-chat .message.user .message-bubble {
    background: var(--primary);
    color: #fff;
    border-top-right-radius: 4px;
}

.legal-chat .message-bubble p {
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.6;
}

.legal-chat .message-bubble ul {
    margin: 4px 0;
    padding-left: 20px;
    font-size: 13px;
    line-height: 1.6;
}

.legal-chat .message-bubble ul li {
    margin: 2px 0;
}

.legal-chat .message.user .message-bubble ul {
    color: #fff;
}

.legal-chat .message-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.legal-chat .message.user .message-title {
    color: #fff;
}

/* ===== LEGAL REFERENCE ===== */
.legal-reference {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
    font-size: 13px;
    margin: 4px 0;
}

.legal-reference i {
    color: var(--primary);
    font-size: 16px;
    margin-top: 2px;
}

.legal-reference span {
    color: #1e293b;
}

/* ===== BADGES ===== */
.legal-chat .badge {
    font-size: 11px;
    padding: 3px 12px;
    margin-right: 4px;
}

/* ===== MESSAGE TIME ===== */
.legal-chat .message-time {
    font-size: 10px;
    color: #94a3b8;
    display: block;
    margin-top: 8px;
}

.legal-chat .message.user .message-time {
    color: rgba(255, 255, 255, 0.7);
}

/* ===== CHAT INPUT ===== */
.legal-chat + .chat-input-area {
    border-top: 1px solid #e2e8f0;
    padding: 16px 24px 20px;
    background: #fff;
    border-radius: 0 0 12px 12px;
}

.legal-chat + .chat-input-area .chat-input-wrapper {
    display: flex;
    gap: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 4px;
    transition: all 0.2s;
}

.legal-chat + .chat-input-area .chat-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

.legal-chat + .chat-input-area .chat-input {
    flex: 1;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    background: transparent;
}

.legal-chat + .chat-input-area .chat-send-btn {
    padding: 8px 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.legal-chat + .chat-input-area .chat-send-btn:hover {
    background: var(--primary-dark);
}

.legal-chat + .chat-input-area .chat-input-hint {
    padding: 6px 12px 0;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .topic-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .legal-chat {
        height: 380px;
        padding: 16px;
    }
    
    .legal-chat .message {
        max-width: 95%;
    }
    
    .topic-grid {
        grid-template-columns: 1fr;
    }
    
    .legal-chat + .chat-input-area {
        padding: 12px 16px 16px;
    }
}

@media (max-width: 576px) {
    .legal-chat {
        height: 320px;
        padding: 12px;
    }
    
    .legal-chat .message-bubble {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .legal-chat .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .topic-btn {
        font-size: 12px;
        padding: 8px 10px;
    }
}